add get_multiple_accounts to BenchTpsClient (#27379)
This commit is contained in:
parent
1ccfc65a52
commit
8c81ed0203
|
@ -91,6 +91,8 @@ pub trait BenchTpsClient {
|
||||||
pubkey: &Pubkey,
|
pubkey: &Pubkey,
|
||||||
commitment_config: CommitmentConfig,
|
commitment_config: CommitmentConfig,
|
||||||
) -> Result<Account>;
|
) -> Result<Account>;
|
||||||
|
|
||||||
|
fn get_multiple_accounts(&self, pubkeys: &[Pubkey]) -> Result<Vec<Option<Account>>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
mod bank_client;
|
mod bank_client;
|
||||||
|
|
|
@ -107,4 +107,8 @@ impl BenchTpsClient for BankClient {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn get_multiple_accounts(&self, _pubkeys: &[Pubkey]) -> Result<Vec<Option<Account>>> {
|
||||||
|
unimplemented!("BankClient doesn't support get_multiple_accounts");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -99,4 +99,8 @@ impl BenchTpsClient for RpcClient {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn get_multiple_accounts(&self, pubkeys: &[Pubkey]) -> Result<Vec<Option<Account>>> {
|
||||||
|
RpcClient::get_multiple_accounts(self, pubkeys).map_err(|err| err.into())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,4 +104,10 @@ impl BenchTpsClient for ThinClient {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn get_multiple_accounts(&self, pubkeys: &[Pubkey]) -> Result<Vec<Option<Account>>> {
|
||||||
|
self.rpc_client()
|
||||||
|
.get_multiple_accounts(pubkeys)
|
||||||
|
.map_err(|err| err.into())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,4 +118,10 @@ impl BenchTpsClient for TpuClient {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn get_multiple_accounts(&self, pubkeys: &[Pubkey]) -> Result<Vec<Option<Account>>> {
|
||||||
|
self.rpc_client()
|
||||||
|
.get_multiple_accounts(pubkeys)
|
||||||
|
.map_err(|err| err.into())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue