(value string)
| 304 | } |
| 305 | |
| 306 | func parsePositiveAmount(value string) (int, error) { |
| 307 | amount, err := strconv.Atoi(value) |
| 308 | if err != nil { |
| 309 | return 0, fmt.Errorf("amount must be an integer: %w", err) |
| 310 | } |
| 311 | if amount <= 0 { |
| 312 | return 0, fmt.Errorf("amount must be greater than zero") |
| 313 | } |
| 314 | return amount, nil |
| 315 | } |
| 316 | |
| 317 | func recordTransaction(ctx contractapi.TransactionContextInterface, fromType int, fromID int, toType int, toID int, amount int) (*Transaction, error) { |
| 318 | id, err := nextID(ctx, transferCounterKey) |
no outgoing calls
no test coverage detected