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

Fix token rpc-client methods #11361

Merged

Conversation

CriesofCarrots
Copy link
Contributor

@CriesofCarrots CriesofCarrots commented Aug 4, 2020

Problem

getTokenAccountsByDelegate and getTokenAccountsByOwner attempted to be clever and return jsonParsed data by default. However, rpc_client needs access to the raw data in order to decode a proper Account struct.

Summary of Changes

  • Allow encoding configuration in getTokenAccounts methods, and default to Binary to stay consistent with getAccountInfo and getProgramAccounts

Fixes panic on solana-labs/solana-program-library#188

@codecov
Copy link

codecov bot commented Aug 4, 2020

Codecov Report

Merging #11361 into master will decrease coverage by 0.0%.
The diff coverage is 55.5%.

@@            Coverage Diff            @@
##           master   #11361     +/-   ##
=========================================
- Coverage    82.3%    82.3%   -0.1%     
=========================================
  Files         315      315             
  Lines       74157    74168     +11     
=========================================
+ Hits        61080    61082      +2     
- Misses      13077    13086      +9     

@CriesofCarrots CriesofCarrots merged commit d0144ce into solana-labs:master Aug 4, 2020
mergify bot pushed a commit that referenced this pull request Aug 4, 2020
* Convert None to error in parse_keyed_accounts

* Allow encoding configuration in getTokenAccounts methods

(cherry picked from commit d0144ce)

# Conflicts:
#	core/src/rpc.rs
mergify bot added a commit that referenced this pull request Aug 4, 2020
* Fix token rpc-client methods (#11361)

* Convert None to error in parse_keyed_accounts

* Allow encoding configuration in getTokenAccounts methods

(cherry picked from commit d0144ce)

# Conflicts:
#	core/src/rpc.rs

* Fix conflicts

Co-authored-by: Tyera Eulberg <[email protected]>
Co-authored-by: Tyera Eulberg <[email protected]>
@CriesofCarrots CriesofCarrots deleted the fix-token-client-methods branch September 1, 2020 19:58
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 this pull request may close these issues.

2 participants