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

Commit

Permalink
feat(types/chain): is_legacy helper
Browse files Browse the repository at this point in the history
moving this into ethers-rs from foundry so it can be more easily use elsewhere
  • Loading branch information
tarrencev committed Jan 27, 2022
1 parent a97526d commit a36cee5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ethers-core/src/types/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,12 @@ impl FromStr for Chain {
})
}
}

impl Chain {
/// Helper function for checking if a chainid corresponds to a legacy chainid
/// without eip1559
pub fn is_legacy(&self) -> bool {
// TODO: Add other chains which do not support EIP1559.
matches!(self, Chain::Optimism | Chain::OptimismKovan | Chain::Fantom | Chain::FantomTestnet)
}
}

0 comments on commit a36cee5

Please sign in to comment.