feat: Duplicate Withdrawal and move try from impls to rpc-compat (#4186)

This commit is contained in:
Supernovahs.eth
2023-09-19 22:27:32 +05:30
committed by GitHub
parent 57c10e5b65
commit 801294252e
20 changed files with 480 additions and 317 deletions

View File

@ -21,6 +21,7 @@ reth-rpc-engine-api = { path = "../rpc-engine-api" }
reth-rpc-types.workspace = true
reth-tasks.workspace = true
reth-transaction-pool.workspace = true
reth-rpc-types-compat.workspace = true
# rpc/net
jsonrpsee = { workspace = true, features = ["server"] }

View File

@ -6,15 +6,17 @@ use reth_primitives::Block;
use reth_rpc::JwtSecret;
use reth_rpc_api::clients::EngineApiClient;
use reth_rpc_types::engine::{ForkchoiceState, PayloadId, TransitionConfiguration};
use reth_rpc_types_compat::engine::payload::{
convert_block_to_payload_input_v2, try_block_to_payload_v1,
};
#[allow(unused_must_use)]
async fn test_basic_engine_calls<C>(client: &C)
where
C: ClientT + SubscriptionClientT + Sync,
{
let block = Block::default().seal_slow();
EngineApiClient::new_payload_v1(client, block.clone().into()).await;
EngineApiClient::new_payload_v2(client, block.into()).await;
EngineApiClient::new_payload_v1(client, try_block_to_payload_v1(block.clone())).await;
EngineApiClient::new_payload_v2(client, convert_block_to_payload_input_v2(block)).await;
EngineApiClient::fork_choice_updated_v1(client, ForkchoiceState::default(), None).await;
EngineApiClient::get_payload_v1(client, PayloadId::new([0, 0, 0, 0, 0, 0, 0, 0])).await;
EngineApiClient::get_payload_v2(client, PayloadId::new([0, 0, 0, 0, 0, 0, 0, 0])).await;