From 7e85b331674b451e7861f21e04253398f32ec08a Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 29 Jun 2022 17:54:07 +0200 Subject: [PATCH] chore: add gas_mut function (#1427) --- ethers-core/src/types/transaction/eip2718.rs | 8 ++++++++ 1 file changed, 8 insertions(+) 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 {