(ctx contractapi.TransactionContextInterface)
| 184 | } |
| 185 | |
| 186 | func (s *SmartContract) GetTransactions(ctx contractapi.TransactionContextInterface) ([]EnergyTransaction, error) { |
| 187 | count, err := currentID(ctx, energyTxCounterKey) |
| 188 | if err != nil { |
| 189 | return nil, err |
| 190 | } |
| 191 | transactions := make([]EnergyTransaction, 0, count) |
| 192 | for id := 0; id < count; id++ { |
| 193 | transaction, err := s.GetTransactionByID(ctx, strconv.Itoa(id)) |
| 194 | if err != nil { |
| 195 | return nil, err |
| 196 | } |
| 197 | transactions = append(transactions, *transaction) |
| 198 | } |
| 199 | return transactions, nil |
| 200 | } |
| 201 | |
| 202 | func putHome(ctx contractapi.TransactionContextInterface, home *Home) error { |
| 203 | if err := putJSON(ctx, homeKey(home.Address), home); err != nil { |
nothing calls this directly
no test coverage detected