feat(types/chain): is_legacy helper (#835)
moving this into ethers-rs from foundry so it can be more easily use elsewhere
This commit is contained in:
parent
f434e0f57f
commit
c22dd8eab4
|
@ -116,3 +116,15 @@ 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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue