Separate activation_timestamp and mainnet_activation_timestamp methods (#6261)

This commit is contained in:
Thomas Coratger
2024-01-28 16:55:13 +01:00
committed by GitHub
parent d68a3dacad
commit ba4f536f93

View File

@@ -88,11 +88,16 @@ impl Hardfork {
}
}
/// Retrieves the activation timestamp for the specified hardfork on the Ethereum mainnet.
pub fn mainnet_activation_timestamp(&self, chain: Chain) -> Option<u64> {
/// Retrieves the activation timestamp for the specified hardfork on the given chain.
pub fn activation_timestamp(&self, chain: Chain) -> Option<u64> {
if chain != Chain::mainnet() {
return None;
}
self.mainnet_activation_timestamp()
}
/// Retrieves the activation timestamp for the specified hardfork on the Ethereum mainnet.
pub fn mainnet_activation_timestamp(&self) -> Option<u64> {
match self {
Hardfork::Frontier => Some(1438226773),
Hardfork::Homestead => Some(1457938193),