(ctx contractapi.TransactionContextInterface, id string)
| 172 | } |
| 173 | |
| 174 | func (s *SmartContract) GetTransactionByID(ctx contractapi.TransactionContextInterface, id string) (*EnergyTransaction, error) { |
| 175 | transactionID, err := strconv.Atoi(id) |
| 176 | if err != nil { |
| 177 | return nil, err |
| 178 | } |
| 179 | var transaction EnergyTransaction |
| 180 | if err := readJSON(ctx, energyTransactionKey(transactionID), &transaction); err != nil { |
| 181 | return nil, err |
| 182 | } |
| 183 | return &transaction, nil |
| 184 | } |
| 185 | |
| 186 | func (s *SmartContract) GetTransactions(ctx contractapi.TransactionContextInterface) ([]EnergyTransaction, error) { |
| 187 | count, err := currentID(ctx, energyTxCounterKey) |
no test coverage detected