add get_multiple_accounts to BenchTpsClient (#27379)

This commit is contained in:
kirill lykov 2022-08-25 15:44:37 +02:00 committed by GitHub
parent 1ccfc65a52
commit 8c81ed0203
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 22 additions and 0 deletions

View File

@ -91,6 +91,8 @@ pub trait BenchTpsClient {
pubkey: &Pubkey,
commitment_config: CommitmentConfig,
) -> Result<Account>;
fn get_multiple_accounts(&self, pubkeys: &[Pubkey]) -> Result<Vec<Option<Account>>>;
}
mod bank_client;

View File

@ -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");
}
}

View File

@ -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())
}
}

View File

@ -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())
}
}

View File

@ -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())
}
}