Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: holesky genesis hash #9318

Merged
merged 1 commit into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crates/primitives-traits/src/constants/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ pub const GOERLI_GENESIS_HASH: B256 =
pub const SEPOLIA_GENESIS_HASH: B256 =
b256!("25a5cc106eea7138acab33231d7160d69cb777ee0c2c553fcddf5138993e6dd9");

/// Holesky genesis hash: `0xff9006519a8ce843ac9c28549d24211420b546e12ce2d170c77a8cca7964f23d`
/// Holesky genesis hash: `0xb5f7f912443c940f21fd611f12828d75b534364ed9e95ca4e307729a4661bde4`
pub const HOLESKY_GENESIS_HASH: B256 =
b256!("ff9006519a8ce843ac9c28549d24211420b546e12ce2d170c77a8cca7964f23d");
b256!("b5f7f912443c940f21fd611f12828d75b534364ed9e95ca4e307729a4661bde4");

/// Testnet genesis hash: `0x2f980576711e3617a5e4d83dd539548ec0f7792007d505a3d2e9674833af2d7c`
pub const DEV_GENESIS_HASH: B256 =
Expand Down
15 changes: 13 additions & 2 deletions crates/storage/db-common/src/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -521,15 +521,17 @@ struct GenesisAccountWithAddress {
mod tests {
use super::*;
use alloy_genesis::Genesis;
use reth_chainspec::{Chain, GOERLI, MAINNET, SEPOLIA};
use reth_chainspec::{Chain, GOERLI, HOLESKY, MAINNET, SEPOLIA};
use reth_db::DatabaseEnv;
use reth_db_api::{
cursor::DbCursorRO,
models::{storage_sharded_key::StorageShardedKey, ShardedKey},
table::{Table, TableRow},
transaction::DbTx,
};
use reth_primitives::{GOERLI_GENESIS_HASH, MAINNET_GENESIS_HASH, SEPOLIA_GENESIS_HASH};
use reth_primitives::{
GOERLI_GENESIS_HASH, HOLESKY_GENESIS_HASH, MAINNET_GENESIS_HASH, SEPOLIA_GENESIS_HASH,
};
use reth_primitives_traits::IntegerList;
use reth_provider::test_utils::create_test_provider_factory_with_chain_spec;

Expand Down Expand Up @@ -570,6 +572,15 @@ mod tests {
assert_eq!(genesis_hash, SEPOLIA_GENESIS_HASH);
}

#[test]
fn success_init_genesis_holesky() {
let genesis_hash =
init_genesis(create_test_provider_factory_with_chain_spec(HOLESKY.clone())).unwrap();

// actual, expected
assert_eq!(genesis_hash, HOLESKY_GENESIS_HASH);
}

#[test]
fn fail_init_inconsistent_db() {
let factory = create_test_provider_factory_with_chain_spec(SEPOLIA.clone());
Expand Down
Loading