Update Execution Layer Tests for Capella

This commit is contained in:
Mark Mackey
2023-01-03 16:42:34 -06:00
parent 222a514506
commit be232c4587
9 changed files with 408 additions and 48 deletions

View File

@@ -45,6 +45,8 @@ pub struct MockExecutionConfig {
pub terminal_difficulty: Uint256,
pub terminal_block: u64,
pub terminal_block_hash: ExecutionBlockHash,
pub shanghai_time: Option<u64>,
pub eip4844_time: Option<u64>,
}
impl Default for MockExecutionConfig {
@@ -55,6 +57,8 @@ impl Default for MockExecutionConfig {
terminal_block: DEFAULT_TERMINAL_BLOCK,
terminal_block_hash: ExecutionBlockHash::zero(),
server_config: Config::default(),
shanghai_time: None,
eip4844_time: None,
}
}
}
@@ -74,6 +78,8 @@ impl<T: EthSpec> MockServer<T> {
DEFAULT_TERMINAL_DIFFICULTY.into(),
DEFAULT_TERMINAL_BLOCK,
ExecutionBlockHash::zero(),
None, // FIXME(capella): should this be the default?
None, // FIXME(eip4844): should this be the default?
)
}
@@ -84,11 +90,18 @@ impl<T: EthSpec> MockServer<T> {
terminal_block,
terminal_block_hash,
server_config,
shanghai_time,
eip4844_time,
} = config;
let last_echo_request = Arc::new(RwLock::new(None));
let preloaded_responses = Arc::new(Mutex::new(vec![]));
let execution_block_generator =
ExecutionBlockGenerator::new(terminal_difficulty, terminal_block, terminal_block_hash);
let execution_block_generator = ExecutionBlockGenerator::new(
terminal_difficulty,
terminal_block,
terminal_block_hash,
shanghai_time,
eip4844_time,
);
let ctx: Arc<Context<T>> = Arc::new(Context {
config: server_config,
@@ -140,6 +153,8 @@ impl<T: EthSpec> MockServer<T> {
terminal_difficulty: Uint256,
terminal_block: u64,
terminal_block_hash: ExecutionBlockHash,
shanghai_time: Option<u64>,
eip4844_time: Option<u64>,
) -> Self {
Self::new_with_config(
handle,
@@ -149,6 +164,8 @@ impl<T: EthSpec> MockServer<T> {
terminal_difficulty,
terminal_block,
terminal_block_hash,
shanghai_time,
eip4844_time,
},
)
}