Open rqzrqh opened 2 years ago
type ReceiptView struct { PredecessorID types.AccountID json:"predecessor_id" ReceiverID types.AccountID json:"receiver_id" ReceiptID hash.CryptoHash json:"receipt_id" Receipt json.RawMessage json:"receipt" // TODO: needs a type! }
json:"predecessor_id"
json:"receiver_id"
json:"receipt_id"
json:"receipt"
Now the type of the Receipt field is RawMessage, I have to parse it by gjson. Of course the better way is use a Receipt Struct. In nearcore the receipt is a Enum Type, it seems a bit hard to unmarshal it.
Enum parsing is not going to be very pretty, see e.g Action struct. I'll see during this week, but PRs are accepted in the meantime.
type ReceiptView struct { PredecessorID types.AccountID
json:"predecessor_id"
ReceiverID types.AccountIDjson:"receiver_id"
ReceiptID hash.CryptoHashjson:"receipt_id"
Receipt json.RawMessagejson:"receipt"
// TODO: needs a type! }Now the type of the Receipt field is RawMessage, I have to parse it by gjson. Of course the better way is use a Receipt Struct. In nearcore the receipt is a Enum Type, it seems a bit hard to unmarshal it.