Deprecate more Fee/Blockhash APIs (#21140)

This commit is contained in:
Jack May
2021-11-02 16:38:23 -07:00
committed by GitHub
parent b9eee66f94
commit 1adf255e3a
6 changed files with 105 additions and 18 deletions

View File

@@ -281,6 +281,22 @@ impl Banks for BanksServer {
bank.get_account(&address).map(Account::from)
}
async fn get_latest_blockhash_with_context(self, _: Context) -> Hash {
let bank = self.bank(CommitmentLevel::default());
bank.last_blockhash()
}
async fn get_latest_blockhash_with_commitment_and_context(
self,
_: Context,
commitment: CommitmentLevel,
) -> Option<(Hash, u64)> {
let bank = self.bank(commitment);
let blockhash = bank.last_blockhash();
let last_valid_block_height = bank.get_blockhash_last_valid_block_height(&blockhash)?;
Some((blockhash, last_valid_block_height))
}
async fn get_fee_for_message_with_commitment_and_context(
self,
_: Context,