(ctx contractapi.TransactionContextInterface)
| 156 | } |
| 157 | |
| 158 | func (s *SmartContract) GetHomes(ctx contractapi.TransactionContextInterface) ([]Home, error) { |
| 159 | count, err := currentID(ctx, homeCounterKey) |
| 160 | if err != nil { |
| 161 | return nil, err |
| 162 | } |
| 163 | homes := make([]Home, 0, count) |
| 164 | for id := 0; id < count; id++ { |
| 165 | home, err := readHomeByID(ctx, id) |
| 166 | if err != nil { |
| 167 | return nil, err |
| 168 | } |
| 169 | homes = append(homes, *home) |
| 170 | } |
| 171 | return homes, nil |
| 172 | } |
| 173 | |
| 174 | func (s *SmartContract) GetTransactionByID(ctx contractapi.TransactionContextInterface, id string) (*EnergyTransaction, error) { |
| 175 | transactionID, err := strconv.Atoi(id) |
nothing calls this directly
no test coverage detected