(ctx contractapi.TransactionContextInterface)
| 276 | } |
| 277 | |
| 278 | func (s *SmartContract) GetTransactions(ctx contractapi.TransactionContextInterface) ([]Transaction, error) { |
| 279 | count, err := currentID(ctx, transferCounterKey) |
| 280 | if err != nil { |
| 281 | return nil, err |
| 282 | } |
| 283 | transactions := make([]Transaction, 0, count) |
| 284 | for id := 0; id < count; id++ { |
| 285 | transaction, err := readTransaction(ctx, id) |
| 286 | if err != nil { |
| 287 | return nil, err |
| 288 | } |
| 289 | transactions = append(transactions, *transaction) |
| 290 | } |
| 291 | return transactions, nil |
| 292 | } |
| 293 | |
| 294 | func parseIDAndAmount(id string, amount string) (int, int, error) { |
| 295 | parsedID, err := strconv.Atoi(id) |
nothing calls this directly
no test coverage detected