chore: add missing is functions (#6309)

This commit is contained in:
Matthias Seitz
2024-01-31 20:22:21 +01:00
committed by GitHub
parent dd40ea54dc
commit 262a9c16c2

View File

@@ -38,6 +38,21 @@ impl EthVersion {
}
}
}
/// Returns true if the version is eth/66
pub const fn is_eth66(&self) -> bool {
matches!(self, EthVersion::Eth66)
}
/// Returns true if the version is eth/67
pub const fn is_eth67(&self) -> bool {
matches!(self, EthVersion::Eth67)
}
/// Returns true if the version is eth/68
pub const fn is_eth68(&self) -> bool {
matches!(self, EthVersion::Eth68)
}
}
/// Allow for converting from a `&str` to an `EthVersion`.