@@ -79,7 +79,6 @@ pub async fn adjust_fee_wrapper(
7979 provider_address : Address ,
8080 poll_interval : Duration ,
8181 legacy_tx : bool ,
82- gas_limit : u64 ,
8382 min_profit_pct : u64 ,
8483 target_profit_pct : u64 ,
8584 max_profit_pct : u64 ,
@@ -96,7 +95,6 @@ pub async fn adjust_fee_wrapper(
9695 chain_state. id . clone ( ) ,
9796 provider_address,
9897 legacy_tx,
99- gas_limit,
10098 min_profit_pct,
10199 target_profit_pct,
102100 max_profit_pct,
@@ -133,7 +131,6 @@ pub async fn adjust_fee_if_necessary(
133131 chain_id : ChainId ,
134132 provider_address : Address ,
135133 legacy_tx : bool ,
136- gas_limit : u64 ,
137134 min_profit_pct : u64 ,
138135 target_profit_pct : u64 ,
139136 max_profit_pct : u64 ,
@@ -154,7 +151,8 @@ pub async fn adjust_fee_if_necessary(
154151
155152 // Calculate target window for the on-chain fee.
156153 let middleware = contract. client ( ) ;
157- let max_callback_cost: u128 = estimate_tx_cost ( middleware, legacy_tx, gas_limit. into ( ) )
154+ let gas_limit: u128 = u128:: from ( provider_info. default_gas_limit ) ;
155+ let max_callback_cost: u128 = estimate_tx_cost ( middleware, legacy_tx, gas_limit)
158156 . await
159157 . map_err ( |e| anyhow ! ( "Could not estimate transaction cost. error {:?}" , e) ) ?;
160158
@@ -166,7 +164,7 @@ pub async fn adjust_fee_if_necessary(
166164 metrics
167165 . gas_price_estimate
168166 . get_or_create ( & account_label)
169- . set ( ( max_callback_cost / u128 :: from ( gas_limit) ) as f64 / 1e9 ) ;
167+ . set ( ( max_callback_cost / gas_limit) as f64 / 1e9 ) ;
170168
171169 let target_fee_min = std:: cmp:: max (
172170 ( max_callback_cost * u128:: from ( min_profit_pct) ) / 100 ,
0 commit comments