Skip to content

Commit

Permalink
fix: holesky genesis hash
Browse files Browse the repository at this point in the history
  • Loading branch information
rkrasiuk committed Jul 4, 2024
1 parent 53d0f73 commit 26f8952
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
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

0 comments on commit 26f8952

Please sign in to comment.