feat: Support unnamed OP chains (#8488)

This commit is contained in:
Brian Bland
2024-06-03 11:01:59 -07:00
committed by GitHub
parent b686872716
commit 6e446084f0
2 changed files with 136 additions and 16 deletions

View File

@ -20,8 +20,9 @@ impl NetworkStackId {
/// ENR fork ID kv-pair key, for an Optimism CL node.
pub const OPSTACK: &'static [u8] = b"opstack";
#[allow(clippy::missing_const_for_fn)]
/// Returns the [`NetworkStackId`] that matches the given [`ChainSpec`].
pub const fn id(chain: &ChainSpec) -> Option<&'static [u8]> {
pub fn id(chain: &ChainSpec) -> Option<&'static [u8]> {
if chain.is_optimism() {
return Some(Self::OPEL)
} else if chain.is_eth() {