Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
chore: add gas_mut function (#1427)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse authored Jun 29, 2022
1 parent f579352 commit 7e85b33
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ethers-core/src/types/transaction/eip2718.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,14 @@ impl TypedTransaction {
}
}

pub fn gas_mut(&mut self) -> &mut Option<U256> {
match self {
Legacy(inner) => &mut inner.gas,
Eip2930(inner) => &mut inner.tx.gas,
Eip1559(inner) => &mut inner.gas,
}
}

pub fn set_gas<T: Into<U256>>(&mut self, gas: T) -> &mut Self {
let gas = gas.into();
match self {
Expand Down

0 comments on commit 7e85b33

Please sign in to comment.