diff --git a/ethers-core/src/types/transaction/eip2718.rs b/ethers-core/src/types/transaction/eip2718.rs index 87c6325f..df147ebf 100644 --- a/ethers-core/src/types/transaction/eip2718.rs +++ b/ethers-core/src/types/transaction/eip2718.rs @@ -158,6 +158,14 @@ impl TypedTransaction { } } + pub fn gas_mut(&mut self) -> &mut Option { + match self { + Legacy(inner) => &mut inner.gas, + Eip2930(inner) => &mut inner.tx.gas, + Eip1559(inner) => &mut inner.gas, + } + } + pub fn set_gas>(&mut self, gas: T) -> &mut Self { let gas = gas.into(); match self {