(ctx contractapi.TransactionContextInterface)
| 257 | } |
| 258 | |
| 259 | func txUnixTime(ctx contractapi.TransactionContextInterface) (int64, error) { |
| 260 | timestamp, err := ctx.GetStub().GetTxTimestamp() |
| 261 | if err != nil { |
| 262 | return 0, fmt.Errorf("failed to read transaction timestamp: %w", err) |
| 263 | } |
| 264 | return timestamp.Seconds, nil |
| 265 | } |
| 266 | |
| 267 | func nextID(ctx contractapi.TransactionContextInterface, counterKey string) (int, error) { |
| 268 | id, err := currentID(ctx, counterKey) |