Fix token rpc-client methods (#11361)

* Convert None to error in parse_keyed_accounts

* Allow encoding configuration in getTokenAccounts methods
This commit is contained in:
Tyera Eulberg
2020-08-04 11:11:30 -06:00
committed by GitHub
parent cad36e1b3c
commit d0144ce382
3 changed files with 37 additions and 19 deletions

View File

@ -1120,7 +1120,15 @@ fn parse_keyed_accounts(
request,
)
})?;
pubkey_accounts.push((pubkey, account.decode().unwrap()));
pubkey_accounts.push((
pubkey,
account.decode().ok_or_else(|| {
ClientError::new_with_request(
RpcError::ParseError("Account from rpc".to_string()).into(),
request,
)
})?,
));
}
Ok(pubkey_accounts)
}