Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement ReceiptView's Receipt parsing #14

Open
rqzrqh opened this issue May 23, 2022 · 1 comment
Open

Implement ReceiptView's Receipt parsing #14

rqzrqh opened this issue May 23, 2022 · 1 comment
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@rqzrqh
Copy link

rqzrqh commented May 23, 2022

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!
}

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.

@mikroskeem
Copy link
Member

mikroskeem commented May 23, 2022

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.

@mikroskeem mikroskeem added enhancement New feature or request help wanted Extra attention is needed labels May 23, 2022
@mikroskeem mikroskeem changed the title receipt doesn't supported yet Implement ReceiptView's Receipt parsing May 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants