Expose last-valid-slot to BankClient and ThinClient users (#10478)

automerge
This commit is contained in:
Greg Fitzgerald
2020-06-09 18:07:32 -06:00
committed by GitHub
parent b250e8c614
commit 4131eee94d
10 changed files with 52 additions and 34 deletions

View File

@ -134,8 +134,13 @@ impl SyncClient for BankClient {
fn get_recent_blockhash_with_commitment(
&self,
_commitment_config: CommitmentConfig,
) -> Result<(Hash, FeeCalculator)> {
Ok(self.bank.last_blockhash_with_fee_calculator())
) -> Result<(Hash, FeeCalculator, u64)> {
let (blockhash, fee_calculator) = self.bank.last_blockhash_with_fee_calculator();
let last_valid_slot = self
.bank
.get_blockhash_last_valid_slot(&blockhash)
.expect("bank blockhash queue should contain blockhash");
Ok((blockhash, fee_calculator, last_valid_slot))
}
fn get_fee_calculator_for_blockhash(&self, blockhash: &Hash) -> Result<Option<FeeCalculator>> {