Open
Description
Legend:
🔴: High priority.
🟡: Medium priority.
🟢: Low priority.
🔵: Discussion.
General
- 🟢 Since the TPC-C methods are overloaded based on their parameter types (string or strongly typed/parsed object), a more explicit separation of such methods would make sense. Accordingly, the current
TPCC
class could be namedTPCCContractAPI
(orTpccContractApi
, not sure about the commonly used casing), and the strongly typed methods could be extracted into aTpccBusinessApi
class, which now deals purely with business-level objects, not Fabric API-enforced strings.
- 🟢 The following and similar nested statements should be split into multiple statements using variable assignments, so it's easier to read (and would facilitate step-by-step debugging if we could set that up 😄).
Delivery
- 🟡 The name of the
getOldestNewOrderForDistrict
method is misleading. It doesn't return the oldest new order, but actually "performs" the delivery. It should either be renamed to something likedeliverOldestNewOrderForDistrict
to reflect its functionality or its contents should be inlined into the shortdelivery
method, except for thegetOldestNewOrder
functionality (just like in the JS version) since that's the "abstraction border" between the business-level and registry-level functionality.
- 🔴 🔵 If I understand correctly, the
select
implementation now reads every entry of a given type, then it's filtered inside the chaincode usingmatching
:
This is really wasteful if it works that way and could cause a lot of MVCC conflicts. The originalselect
supported a partial iterator and early-break functionality for such scenarios (we only need the first/earliest new order of a given warehouse and district). The implementation is functionally correct, but not robust enough extra-functionally. - 🟡 The
getOrderLineAmount
function also does more than its name suggests:
New Order
- 🟡 I find single-statement for/if/etc blocks without curly brackets really error-prone. We should always use them for clarity, and in the name of defensive programming. The following is just an example
- 🔴 The existence of a referenced item must be checked (i.e., the exception handled) because it determines the return value of the transaction.
See here:
- 🔴 The
dist_info
attribute must be assigned the value of the requireds_dist_xx
attribute from theStock
instance.
See here:
Order Status
- 🟡 Single statement blocks without curly braces:
- 🔴 Sorting by customer first name is missing:
See here:
Payment
LGTM
Stock Level
- 🟢 The minimum constraint should be propagated back to the JS implementation to make it more robust:
- 🟡 Single statement block without curly braces:
Other components
TBD