mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
refactor(ethereum, primitives, evm): use Alloy EIP-4788 constants (#8208)
This commit is contained in:
@ -24,4 +24,6 @@ revm-primitives.workspace = true
|
||||
tracing.workspace = true
|
||||
|
||||
[dev-dependencies]
|
||||
reth-revm = { workspace = true, features = ["test-utils"] }
|
||||
reth-revm = { workspace = true, features = ["test-utils"] }
|
||||
alloy-eips.workspace = true
|
||||
|
||||
|
||||
@ -443,31 +443,26 @@ where
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use reth_primitives::{
|
||||
bytes,
|
||||
constants::{BEACON_ROOTS_ADDRESS, SYSTEM_ADDRESS},
|
||||
keccak256, Account, Block, Bytes, ChainSpecBuilder, ForkCondition, B256,
|
||||
};
|
||||
use alloy_eips::eip4788::{BEACON_ROOTS_ADDRESS, BEACON_ROOTS_CODE, SYSTEM_ADDRESS};
|
||||
use reth_primitives::{keccak256, Account, Block, ChainSpecBuilder, ForkCondition, B256};
|
||||
use reth_revm::{
|
||||
database::StateProviderDatabase, test_utils::StateProviderTest, TransitionState,
|
||||
};
|
||||
use std::collections::HashMap;
|
||||
|
||||
static BEACON_ROOT_CONTRACT_CODE: Bytes = bytes!("3373fffffffffffffffffffffffffffffffffffffffe14604d57602036146024575f5ffd5b5f35801560495762001fff810690815414603c575f5ffd5b62001fff01545f5260205ff35b5f5ffd5b62001fff42064281555f359062001fff015500");
|
||||
|
||||
fn create_state_provider_with_beacon_root_contract() -> StateProviderTest {
|
||||
let mut db = StateProviderTest::default();
|
||||
|
||||
let beacon_root_contract_account = Account {
|
||||
balance: U256::ZERO,
|
||||
bytecode_hash: Some(keccak256(BEACON_ROOT_CONTRACT_CODE.clone())),
|
||||
bytecode_hash: Some(keccak256(BEACON_ROOTS_CODE.clone())),
|
||||
nonce: 1,
|
||||
};
|
||||
|
||||
db.insert_account(
|
||||
BEACON_ROOTS_ADDRESS,
|
||||
beacon_root_contract_account,
|
||||
Some(BEACON_ROOT_CONTRACT_CODE.clone()),
|
||||
Some(BEACON_ROOTS_CODE.clone()),
|
||||
HashMap::new(),
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user