Closed jimthematrix closed 2 years ago
Merging #236 (1c704ae) into main (7a94fbc) will increase coverage by
0.00%
. The diff coverage is100.00%
.
@@ Coverage Diff @@
## main #236 +/- ##
=======================================
Coverage 76.21% 76.22%
=======================================
Files 193 193
Lines 14098 14103 +5
=======================================
+ Hits 10745 10750 +5
Misses 2385 2385
Partials 968 968
Impacted Files | Coverage Δ | |
---|---|---|
pkg/gateway/transaction.go | 88.39% <100.00%> (+0.54%) |
:arrow_up: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 7a94fbc...1c704ae. Read the comment docs.
@andrew-coleman Do you have any comments about the additional function in the Gateway package?
There are already TransactionOption functional options to set endorsing peers and transient data when calling CreateTransaction(). I think this would be a better fit for creating a Transaction with the isInit
flag set. Something like:
func WithInit() TransactionOption {
return func(txn *Transaction) error {
txn.isInit = true
return nil
}
}
Hi Jim, if we were to implement this in the new fabric-gateway Go API, we would almost certainly adopt the pattern as suggested by Mark in the previous comment. Would you be able to do that here?
@bestbeforetoday @andrew-coleman thanks for suggesting the options approach, I can switch to that in this PR.
Thanks Jim!
Even though the latest recommendation from the Fabric team is to step away from requiring
init
, a lot of customers still use this approach, and the official docs for Fabric chaincode lifecycle still describes the--init-required
parameter, finally thefabric-samples
that is used widely by tire-kickers still implementsInitLedger()
.Added a new
SubmitInit()
instead of modifying the existing signature to allow backward compatibility