mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: add updated beacon root contract address (#4665)
This commit is contained in:
@ -558,19 +558,18 @@ mod tests {
|
||||
use reth_interfaces::RethResult;
|
||||
use reth_primitives::{
|
||||
constants::{BEACON_ROOTS_ADDRESS, SYSTEM_ADDRESS},
|
||||
hex_literal::hex,
|
||||
keccak256, Account, Bytecode, Bytes, ChainSpecBuilder, ForkCondition, StorageKey, MAINNET,
|
||||
};
|
||||
use reth_provider::{AccountReader, BlockHashReader, StateRootProvider};
|
||||
use reth_revm_primitives::TransitionState;
|
||||
use revm::Database;
|
||||
use std::{collections::HashMap, str::FromStr};
|
||||
use std::collections::HashMap;
|
||||
|
||||
use super::*;
|
||||
|
||||
/// Returns the beacon root contract code
|
||||
fn beacon_root_contract_code() -> Bytes {
|
||||
Bytes::from_str("0x3373fffffffffffffffffffffffffffffffffffffffe14604457602036146024575f5ffd5b620180005f350680545f35146037575f5ffd5b6201800001545f5260205ff35b6201800042064281555f359062018000015500").unwrap()
|
||||
}
|
||||
const BEACON_ROOT_CONTRACT_CODE: [u8; 97] =
|
||||
hex!("3373fffffffffffffffffffffffffffffffffffffffe14604d57602036146024575f5ffd5b5f35801560495762001fff810690815414603c575f5ffd5b62001fff01545f5260205ff35b5f5ffd5b62001fff42064281555f359062001fff015500");
|
||||
|
||||
#[derive(Debug, Default, Clone, Eq, PartialEq)]
|
||||
struct StateProviderTest {
|
||||
@ -661,7 +660,7 @@ mod tests {
|
||||
|
||||
let mut db = StateProviderTest::default();
|
||||
|
||||
let beacon_root_contract_code = beacon_root_contract_code();
|
||||
let beacon_root_contract_code = Bytes::from(BEACON_ROOT_CONTRACT_CODE);
|
||||
|
||||
let beacon_root_contract_account = Account {
|
||||
balance: U256::ZERO,
|
||||
@ -718,7 +717,7 @@ mod tests {
|
||||
// header.timestamp
|
||||
// * The storage value at header.timestamp % HISTORY_BUFFER_LENGTH + HISTORY_BUFFER_LENGTH
|
||||
// should be parent_beacon_block_root
|
||||
let history_buffer_length = 98304u64;
|
||||
let history_buffer_length = 8191u64;
|
||||
let timestamp_index = header.timestamp % history_buffer_length;
|
||||
let parent_beacon_block_root_index =
|
||||
timestamp_index % history_buffer_length + history_buffer_length;
|
||||
@ -785,7 +784,7 @@ mod tests {
|
||||
// during the pre-block call
|
||||
let mut db = StateProviderTest::default();
|
||||
|
||||
let beacon_root_contract_code = beacon_root_contract_code();
|
||||
let beacon_root_contract_code = Bytes::from(BEACON_ROOT_CONTRACT_CODE);
|
||||
|
||||
let beacon_root_contract_account = Account {
|
||||
balance: U256::ZERO,
|
||||
@ -843,7 +842,7 @@ mod tests {
|
||||
fn eip_4788_genesis_call() {
|
||||
let mut db = StateProviderTest::default();
|
||||
|
||||
let beacon_root_contract_code = beacon_root_contract_code();
|
||||
let beacon_root_contract_code = Bytes::from(BEACON_ROOT_CONTRACT_CODE);
|
||||
|
||||
let beacon_root_contract_account = Account {
|
||||
balance: U256::ZERO,
|
||||
@ -923,7 +922,7 @@ mod tests {
|
||||
|
||||
let mut db = StateProviderTest::default();
|
||||
|
||||
let beacon_root_contract_code = beacon_root_contract_code();
|
||||
let beacon_root_contract_code = Bytes::from(BEACON_ROOT_CONTRACT_CODE);
|
||||
|
||||
let beacon_root_contract_account = Account {
|
||||
balance: U256::ZERO,
|
||||
@ -966,7 +965,7 @@ mod tests {
|
||||
// header.timestamp
|
||||
// * The storage value at header.timestamp % HISTORY_BUFFER_LENGTH + HISTORY_BUFFER_LENGTH
|
||||
// should be parent_beacon_block_root
|
||||
let history_buffer_length = 98304u64;
|
||||
let history_buffer_length = 8191u64;
|
||||
let timestamp_index = header.timestamp % history_buffer_length;
|
||||
let parent_beacon_block_root_index =
|
||||
timestamp_index % history_buffer_length + history_buffer_length;
|
||||
|
||||
Reference in New Issue
Block a user