(ctx contractapi.TransactionContextInterface, key string, value interface{})
| 301 | } |
| 302 | |
| 303 | func putJSON(ctx contractapi.TransactionContextInterface, key string, value interface{}) error { |
| 304 | data, err := json.Marshal(value) |
| 305 | if err != nil { |
| 306 | return fmt.Errorf("failed to encode %s: %w", key, err) |
| 307 | } |
| 308 | if err := ctx.GetStub().PutState(key, data); err != nil { |
| 309 | return fmt.Errorf("failed to write %s: %w", key, err) |
| 310 | } |
| 311 | return nil |
| 312 | } |
| 313 | |
| 314 | func homeKey(address string) string { |
| 315 | return "home:" + address |
no outgoing calls
no test coverage detected