deprecate FeeCalculator in BanksClients (#21056)

This commit is contained in:
Jack May
2021-10-28 16:00:09 -07:00
committed by GitHub
parent 0b8fcf0808
commit 3140d7741c
3 changed files with 36 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ use {
commitment_config::CommitmentLevel,
fee_calculator::FeeCalculator,
hash::Hash,
message::{Message, SanitizedMessage},
pubkey::Pubkey,
signature::Signature,
transaction::{self, Transaction},
@@ -22,6 +23,7 @@ use {
tpu_info::NullTpuInfo,
},
std::{
convert::TryFrom,
io,
net::{Ipv4Addr, SocketAddr},
sync::{
@@ -278,6 +280,17 @@ impl Banks for BanksServer {
let bank = self.bank(commitment);
bank.get_account(&address).map(Account::from)
}
async fn get_fee_for_message_with_commitment_and_context(
self,
_: Context,
commitment: CommitmentLevel,
message: Message,
) -> Option<u64> {
let bank = self.bank(commitment);
let sanitized_message = SanitizedMessage::try_from(message).ok()?;
Some(bank.get_fee_for_message(&sanitized_message))
}
}
pub async fn start_local_server(