Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Return delegated amount as UiTokenAmount #11475

Merged
merged 2 commits into from
Aug 8, 2020

Conversation

CriesofCarrots
Copy link
Contributor

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.

Summary of Changes

  • Update delegatedAmount to return UiTokenAmount
  • Omit delegate and delegatedAmount when unset/0 respectively

Fixes #11471

jstarry
jstarry previously approved these changes Aug 8, 2020
Copy link
Contributor

@jstarry jstarry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm just a nit on naming

@mergify mergify bot dismissed jstarry’s stale review August 8, 2020 17:59

Pull request has been modified.

@CriesofCarrots CriesofCarrots added the automerge Merge this Pull Request automatically once CI passes label Aug 8, 2020
@codecov
Copy link

codecov bot commented Aug 8, 2020

Codecov Report

Merging #11475 into master will decrease coverage by 0.0%.
The diff coverage is 44.4%.

@@            Coverage Diff            @@
##           master   #11475     +/-   ##
=========================================
- Coverage    81.8%    81.7%   -0.1%     
=========================================
  Files         323      323             
  Lines       74965    74970      +5     
=========================================
- Hits        61325    61299     -26     
- Misses      13640    13671     +31     

@mergify mergify bot merged commit 88d8d3d into solana-labs:master Aug 8, 2020
mergify bot pushed a commit that referenced this pull request Aug 8, 2020
* Return delegated amount as UiTokenAmount

* Omit delegate and delegatedAmount when none

(cherry picked from commit 88d8d3d)
mergify bot pushed a commit that referenced this pull request Aug 8, 2020
* Return delegated amount as UiTokenAmount

* Omit delegate and delegatedAmount when none

(cherry picked from commit 88d8d3d)
mergify bot added a commit that referenced this pull request Aug 9, 2020
* Return delegated amount as UiTokenAmount

* Omit delegate and delegatedAmount when none

(cherry picked from commit 88d8d3d)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
mergify bot added a commit that referenced this pull request Aug 9, 2020
* Return delegated amount as UiTokenAmount

* Omit delegate and delegatedAmount when none

(cherry picked from commit 88d8d3d)

Co-authored-by: Tyera Eulberg <teulberg@gmail.com>
@CriesofCarrots CriesofCarrots deleted the delegate-ui-amount branch September 1, 2020 19:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
automerge Merge this Pull Request automatically once CI passes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RPC: Token account decoding issues
2 participants