MCPcopy
hub / github.com/yeasy/blockchain_guide / readTransaction

Function readTransaction

11_app_dev/chaincode_example03.go:358–364  ·  view source on GitHub ↗
(ctx contractapi.TransactionContextInterface, id int)

Source from the content-addressed store, hash-verified

356}
357
358func readTransaction(ctx contractapi.TransactionContextInterface, id int) (*Transaction, error) {
359 var transaction Transaction
360 if err := readJSON(ctx, transactionKey(id), &transaction); err != nil {
361 return nil, err
362 }
363 return &transaction, nil
364}
365
366func nextID(ctx contractapi.TransactionContextInterface, counterKey string) (int, error) {
367 id, err := currentID(ctx, counterKey)

Callers 2

GetTransactionByIDMethod · 0.85
GetTransactionsMethod · 0.85

Calls 2

transactionKeyFunction · 0.85
readJSONFunction · 0.70

Tested by

no test coverage detected