@@ -17,7 +17,7 @@ use tendermint_rpc::endpoint::broadcast::tx_sync::Response;
17
17
use tracing:: { debug, debug_span, trace, warn} ;
18
18
19
19
use crate :: chain:: cosmos:: gas:: { adjust_estimated_gas, AdjustGas } ;
20
- use crate :: chain:: cosmos:: types:: gas:: max_gas_from_config ;
20
+ use crate :: chain:: cosmos:: types:: gas:: max_gas_from_config_opt ;
21
21
use crate :: chain:: cosmos:: types:: tx:: { TxStatus , TxSyncResult } ;
22
22
use crate :: chain:: cosmos:: wait:: all_tx_results_found;
23
23
use crate :: chain:: endpoint:: ChainEndpoint ;
@@ -165,24 +165,17 @@ impl NamadaChain {
165
165
let fee_token_str = self . config . gas_price . denom . clone ( ) ;
166
166
let fee_token = Address :: from_str ( & fee_token_str)
167
167
. map_err ( |_| NamadaError :: address_decode ( fee_token_str. clone ( ) ) ) ?;
168
- let max_gas = max_gas_from_config ( & self . config ) ;
169
168
let gas_price = self . config . gas_price . price ;
170
169
171
170
let max_block_gas_key = namada_sdk:: parameters:: storage:: get_max_block_gas_key ( ) ;
172
- let max_block_gas: u64 = match self . rt . block_on ( rpc:: query_storage_value (
173
- self . ctx . client ( ) ,
174
- & max_block_gas_key,
175
- ) ) {
176
- Ok ( max_block_gas) => max_block_gas,
177
- Err ( e) => {
178
- warn ! (
179
- id = %chain_id,
180
- "estimate_fee: error while querying max block gas, defaulting to config default. Error: {}" ,
181
- e
182
- ) ;
183
- max_gas
184
- }
185
- } ;
171
+ let max_block_gas: u64 = self
172
+ . rt
173
+ . block_on ( rpc:: query_storage_value (
174
+ self . ctx . client ( ) ,
175
+ & max_block_gas_key,
176
+ ) )
177
+ . map_err ( NamadaError :: namada) ?;
178
+ let max_gas = max_gas_from_config_opt ( & self . config ) . unwrap_or ( max_block_gas) ;
186
179
187
180
let args = args. clone ( ) . dry_run_wrapper ( true ) ;
188
181
// Set the max gas to the gas limit for the simulation
0 commit comments