Skip to content

Commit

Permalink
feat: add bohr upgrade for BSC
Browse files Browse the repository at this point in the history
  • Loading branch information
yutianwu committed Jul 29, 2024
1 parent 0fceb63 commit 4e0ea88
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions crates/precompile/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,6 +490,8 @@ impl PrecompileSpecId {
HABER => Self::HABER,
#[cfg(feature = "bsc")]
HABER_FIX => Self::HABER,
#[cfg(feature = "bsc")]
BOHR => Self::HABER,
LATEST => Self::LATEST,
}
}
Expand Down
7 changes: 6 additions & 1 deletion crates/primitives/src/specification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ pub enum SpecId {
CANCUN = 29, // Cancun timestamp(1718863500)
HABER = 30, // Haber timestamp(1718863500)
HABER_FIX = 31, // HaberFix timestamp(1720591588)
BOHR = 32, // Bohr timestamp(1720591588)

/// Not enabled in bsc
DAO_FORK = 100,
Expand Down Expand Up @@ -213,6 +214,8 @@ impl From<&str> for SpecId {
"Haber" => SpecId::HABER,
#[cfg(feature = "bsc")]
"HaberFix" => SpecId::HABER_FIX,
#[cfg(feature = "bsc")]
"Bohr" => SpecId::BOHR,
_ => Self::LATEST,
}
}
Expand Down Expand Up @@ -289,6 +292,8 @@ impl From<SpecId> for &'static str {
SpecId::HABER => "Haber",
#[cfg(feature = "bsc")]
SpecId::HABER_FIX => "HaberFix",
#[cfg(feature = "bsc")]
SpecId::BOHR => "Bohr",
SpecId::LATEST => "Latest",
}
}
Expand Down Expand Up @@ -646,7 +651,7 @@ macro_rules! spec_to_generic {
use $crate::PragueEofSpec as SPEC;
$e
}
$crate::SpecId::HABER | $crate::SpecId::HABER_FIX => {
$crate::SpecId::HABER | $crate::SpecId::HABER_FIX | $crate::SpecId::BOHR => {
use $crate::HaberSpec as SPEC;
$e
}
Expand Down

0 comments on commit 4e0ea88

Please sign in to comment.