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

Commit a76e175

Browse files
mergify[bot]mvines
andauthored
RpcClient::get_multiple_accounts() now works (#12427)
(cherry picked from commit ff890c1) Co-authored-by: Michael Vines <mvines@gmail.com>
1 parent 35a1ab9 commit a76e175

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

client/src/rpc_client.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -517,14 +517,14 @@ impl RpcClient {
517517
data_slice: None,
518518
};
519519
let pubkeys: Vec<_> = pubkeys.iter().map(|pubkey| pubkey.to_string()).collect();
520-
let response = self.send(RpcRequest::GetMultipleAccounts, json!([[pubkeys], config]))?;
520+
let response = self.send(RpcRequest::GetMultipleAccounts, json!([pubkeys, config]))?;
521521
let Response {
522522
context,
523523
value: accounts,
524-
} = serde_json::from_value::<Response<Option<UiAccount>>>(response)?;
524+
} = serde_json::from_value::<Response<Vec<Option<UiAccount>>>>(response)?;
525525
let accounts: Vec<Option<Account>> = accounts
526-
.iter()
527-
.map(|rpc_account| rpc_account.decode())
526+
.into_iter()
527+
.map(|rpc_account| rpc_account.map(|a| a.decode()).flatten())
528528
.collect();
529529
Ok(Response {
530530
context,

0 commit comments

Comments
 (0)