Remove blockhash from fee calculation (#20641)

This commit is contained in:
Jack May
2021-10-13 13:10:58 -07:00
committed by GitHub
parent 149d224557
commit da45be366a
21 changed files with 53 additions and 119 deletions

View File

@ -4800,7 +4800,7 @@ impl RpcClient {
}
#[allow(deprecated)]
pub fn get_fee_for_message(&self, blockhash: &Hash, message: &Message) -> ClientResult<u64> {
pub fn get_fee_for_message(&self, message: &Message) -> ClientResult<u64> {
if self.get_node_version()? < semver::Version::new(1, 8, 0) {
let Fees { fee_calculator, .. } = self.get_fees()?;
Ok(fee_calculator
@ -4811,7 +4811,7 @@ impl RpcClient {
serialize_and_encode::<Message>(message, UiTransactionEncoding::Base64)?;
let result = self.send::<Response<Option<u64>>>(
RpcRequest::GetFeeForMessage,
json!([blockhash.to_string(), serialized_encoded, self.commitment()]),
json!([serialized_encoded, self.commitment()]),
)?;
result
.value

View File

@ -600,9 +600,9 @@ impl SyncClient for ThinClient {
.map_err(|e| e.into())
}
fn get_fee_for_message(&self, blockhash: &Hash, message: &Message) -> TransportResult<u64> {
fn get_fee_for_message(&self, message: &Message) -> TransportResult<u64> {
self.rpc_client()
.get_fee_for_message(blockhash, message)
.get_fee_for_message(message)
.map_err(|e| e.into())
}