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

RPC: Token account decoding issues #11471

Closed
jstarry opened this issue Aug 8, 2020 · 3 comments · Fixed by #11475
Closed

RPC: Token account decoding issues #11471

jstarry opened this issue Aug 8, 2020 · 3 comments · Fixed by #11475

Comments

@jstarry
Copy link
Member

jstarry commented Aug 8, 2020

Problem

  1. When encoding token accounts to JSON in RPC, tokenAmount is a UiAmount but delegatedAmount is a number. They should be treated the same.

  2. The delegate property is returning null when unset. I would expect it to be omitted.

@jstarry jstarry changed the title RPC: Token delegatedAmount should be encoded as UiAmount RPC: Token account decoding issues Aug 8, 2020
@CriesofCarrots
Copy link
Contributor

Would you expect delegatedAmount to also be omitted when zero?

@jstarry
Copy link
Member Author

jstarry commented Aug 8, 2020

Hmm sounds reasonable to me. Seems like delegatedAmount should always be present when delegated is present. Not sure if it can be 0 when delegated is set

@CriesofCarrots
Copy link
Contributor

👍

Not sure if it can be 0 when delegated is set

Shouldn't ever be. Delegated and delegatedAmount get set/unset in tandem (approve, revoke), and delegated gets set to None when delegatedAmount reaches zero via Transfers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants