Skip to content

Commit

Permalink
feat: configure extra gas with env variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
serejke committed Jul 28, 2023
1 parent 9d40c7d commit e599d92
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rust/chains/hyperlane-ethereum/src/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,13 @@ where
let gas_limit = if let Some(gas_limit) = tx_gas_limit {
gas_limit
} else {
let hyp_gas_estimate_buffer: u32 = std::env::var("HYP_GAS_ESTIMATE_BUFFER")
.unwrap_or(String::from("50000"))
.parse()
.unwrap();
tx.estimate_gas()
.await?
.saturating_add(U256::from(GAS_ESTIMATE_BUFFER))
.saturating_add(U256::from(hyp_gas_estimate_buffer))
};
let Ok((max_fee, max_priority_fee)) = provider.estimate_eip1559_fees(None).await else {
// Is not EIP 1559 chain
Expand Down

0 comments on commit e599d92

Please sign in to comment.