mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
feat: use new ChainHardforks type on ChainSpec (#9065)
This commit is contained in:
@ -10,7 +10,7 @@ use reth_payload_primitives::{
|
||||
validate_payload_timestamp, EngineApiMessageVersion, PayloadAttributes,
|
||||
PayloadBuilderAttributes, PayloadOrAttributes,
|
||||
};
|
||||
use reth_primitives::{BlockHash, BlockHashOrNumber, BlockNumber, Hardfork, B256, U64};
|
||||
use reth_primitives::{BlockHash, BlockHashOrNumber, BlockNumber, EthereumHardfork, B256, U64};
|
||||
use reth_rpc_api::EngineApiServer;
|
||||
use reth_rpc_types::engine::{
|
||||
CancunPayloadFields, ClientVersionV1, ExecutionPayload, ExecutionPayloadBodiesV1,
|
||||
@ -457,7 +457,7 @@ where
|
||||
let merge_terminal_td = self
|
||||
.inner
|
||||
.chain_spec
|
||||
.fork(Hardfork::Paris)
|
||||
.fork(EthereumHardfork::Paris)
|
||||
.ttd()
|
||||
.expect("the engine API should not be running for chains w/o paris");
|
||||
|
||||
@ -1036,7 +1036,11 @@ mod tests {
|
||||
let (handle, api) = setup_engine_api();
|
||||
|
||||
let transition_config = TransitionConfiguration {
|
||||
terminal_total_difficulty: handle.chain_spec.fork(Hardfork::Paris).ttd().unwrap() +
|
||||
terminal_total_difficulty: handle
|
||||
.chain_spec
|
||||
.fork(EthereumHardfork::Paris)
|
||||
.ttd()
|
||||
.unwrap() +
|
||||
U256::from(1),
|
||||
..Default::default()
|
||||
};
|
||||
@ -1046,7 +1050,7 @@ mod tests {
|
||||
assert_matches!(
|
||||
res,
|
||||
Err(EngineApiError::TerminalTD { execution, consensus })
|
||||
if execution == handle.chain_spec.fork(Hardfork::Paris).ttd().unwrap() && consensus == U256::from(transition_config.terminal_total_difficulty)
|
||||
if execution == handle.chain_spec.fork(EthereumHardfork::Paris).ttd().unwrap() && consensus == U256::from(transition_config.terminal_total_difficulty)
|
||||
);
|
||||
}
|
||||
|
||||
@ -1063,7 +1067,11 @@ mod tests {
|
||||
random_block(&mut rng, terminal_block_number, None, None, None);
|
||||
|
||||
let transition_config = TransitionConfiguration {
|
||||
terminal_total_difficulty: handle.chain_spec.fork(Hardfork::Paris).ttd().unwrap(),
|
||||
terminal_total_difficulty: handle
|
||||
.chain_spec
|
||||
.fork(EthereumHardfork::Paris)
|
||||
.ttd()
|
||||
.unwrap(),
|
||||
terminal_block_hash: consensus_terminal_block.hash(),
|
||||
terminal_block_number: U64::from(terminal_block_number),
|
||||
};
|
||||
@ -1101,7 +1109,11 @@ mod tests {
|
||||
random_block(&mut generators::rng(), terminal_block_number, None, None, None);
|
||||
|
||||
let transition_config = TransitionConfiguration {
|
||||
terminal_total_difficulty: handle.chain_spec.fork(Hardfork::Paris).ttd().unwrap(),
|
||||
terminal_total_difficulty: handle
|
||||
.chain_spec
|
||||
.fork(EthereumHardfork::Paris)
|
||||
.ttd()
|
||||
.unwrap(),
|
||||
terminal_block_hash: terminal_block.hash(),
|
||||
terminal_block_number: U64::from(terminal_block_number),
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user