(value string)
| 241 | } |
| 242 | |
| 243 | func parseNonNegativeAmount(value string) (int, error) { |
| 244 | amount, err := strconv.Atoi(value) |
| 245 | if err != nil { |
| 246 | return 0, fmt.Errorf("amount must be an integer: %w", err) |
| 247 | } |
| 248 | if amount < 0 { |
| 249 | return 0, fmt.Errorf("amount must not be negative") |
| 250 | } |
| 251 | return amount, nil |
| 252 | } |
| 253 | |
| 254 | func newAddress(ctx contractapi.TransactionContextInterface, prefix string) string { |
| 255 | sum := sha256.Sum256([]byte(prefix + ":" + ctx.GetStub().GetTxID())) |
no outgoing calls
no test coverage detected