primitives: rm alloy BlockId reexport (#12303)

This commit is contained in:
Thomas Coratger
2024-11-04 12:47:18 +01:00
committed by GitHub
parent 566f2b4950
commit 0475af8bdb
25 changed files with 43 additions and 32 deletions

4
Cargo.lock generated
View File

@ -8706,6 +8706,7 @@ dependencies = [
name = "reth-rpc-api-testing-util"
version = "1.1.0"
dependencies = [
"alloy-eips",
"alloy-primitives",
"alloy-rpc-types",
"alloy-rpc-types-eth",
@ -8725,6 +8726,7 @@ dependencies = [
name = "reth-rpc-builder"
version = "1.1.0"
dependencies = [
"alloy-eips",
"alloy-primitives",
"alloy-rpc-types-engine",
"alloy-rpc-types-eth",
@ -8910,13 +8912,13 @@ dependencies = [
name = "reth-rpc-server-types"
version = "1.1.0"
dependencies = [
"alloy-eips",
"alloy-primitives",
"alloy-rpc-types-engine",
"jsonrpsee-core",
"jsonrpsee-types",
"reth-errors",
"reth-network-api",
"reth-primitives",
"serde",
"strum",
]

View File

@ -2,7 +2,7 @@ use crate::{
GotExpected, Header, SealedHeader, TransactionSigned, TransactionSignedEcRecovered, Withdrawals,
};
use alloc::vec::Vec;
pub use alloy_eips::eip1898::{BlockId, BlockNumHash, BlockNumberOrTag, ForkBlock, RpcBlockHash};
pub use alloy_eips::eip1898::{BlockNumHash, BlockNumberOrTag, ForkBlock, RpcBlockHash};
use alloy_eips::eip2718::Encodable2718;
use alloy_primitives::{Address, Bytes, Sealable, B256};
use alloy_rlp::{Decodable, Encodable, RlpDecodable, RlpEncodable};
@ -905,7 +905,7 @@ pub(super) mod serde_bincode_compat {
#[cfg(test)]
mod tests {
use super::{BlockNumberOrTag::*, *};
use alloy_eips::eip1898::HexStringMissingPrefixError;
use alloy_eips::{eip1898::HexStringMissingPrefixError, BlockId};
use alloy_primitives::hex_literal::hex;
use alloy_rlp::{Decodable, Encodable};
use std::str::FromStr;

View File

@ -34,8 +34,8 @@ pub mod transaction;
#[cfg(any(test, feature = "arbitrary"))]
pub use block::{generate_valid_header, valid_header_strategy};
pub use block::{
Block, BlockBody, BlockId, BlockNumHash, BlockNumberOrTag, BlockWithSenders, ForkBlock,
RpcBlockHash, SealedBlock, SealedBlockWithSenders,
Block, BlockBody, BlockNumHash, BlockNumberOrTag, BlockWithSenders, ForkBlock, RpcBlockHash,
SealedBlock, SealedBlockWithSenders,
};
#[cfg(feature = "reth-codec")]
pub use compression::*;

View File

@ -1,3 +1,4 @@
use alloy_eips::BlockId;
use alloy_primitives::{Address, Bytes, B256};
use alloy_rpc_types::{Block, Bundle, StateContext};
use alloy_rpc_types_debug::ExecutionWitness;
@ -6,7 +7,7 @@ use alloy_rpc_types_trace::geth::{
BlockTraceResult, GethDebugTracingCallOptions, GethDebugTracingOptions, GethTrace, TraceResult,
};
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::{BlockId, BlockNumberOrTag};
use reth_primitives::BlockNumberOrTag;
/// Debug rpc interface.
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "debug"))]

View File

@ -1,3 +1,4 @@
use alloy_eips::BlockId;
use alloy_json_rpc::RpcObject;
use alloy_primitives::{Address, Bytes, TxHash, B256};
use alloy_rpc_types::Header;
@ -6,7 +7,6 @@ use alloy_rpc_types_trace::otterscan::{
TransactionsWithReceipts,
};
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::BlockId;
/// Otterscan rpc interface.
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "ots"))]

View File

@ -1,6 +1,6 @@
use alloy_eips::BlockId;
use alloy_primitives::{Address, U256};
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::BlockId;
use std::collections::HashMap;
/// Reth API namespace for reth-specific methods

View File

@ -1,3 +1,4 @@
use alloy_eips::BlockId;
use alloy_primitives::{map::HashSet, Bytes, B256};
use alloy_rpc_types::{state::StateOverride, BlockOverrides, Index};
use alloy_rpc_types_eth::transaction::TransactionRequest;
@ -7,7 +8,6 @@ use alloy_rpc_types_trace::{
parity::*,
};
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::BlockId;
/// Ethereum trace API
#[cfg_attr(not(feature = "client"), rpc(server, namespace = "trace"))]

View File

@ -68,6 +68,7 @@ alloy-primitives.workspace = true
alloy-rpc-types-eth.workspace = true
alloy-rpc-types-trace.workspace = true
alloy-rpc-types-engine.workspace = true
alloy-eips.workspace = true
tokio = { workspace = true, features = ["rt", "rt-multi-thread"] }
serde_json.workspace = true

View File

@ -2,6 +2,7 @@
//! Standalone http tests
use crate::utils::{launch_http, launch_http_ws, launch_ws};
use alloy_eips::BlockId;
use alloy_primitives::{hex_literal::hex, Address, Bytes, TxHash, B256, B64, U256, U64};
use alloy_rpc_types_eth::{
transaction::TransactionRequest, Block, FeeHistory, Filter, Index, Log,
@ -18,7 +19,7 @@ use jsonrpsee::{
types::error::ErrorCode,
};
use reth_network_peers::NodeRecord;
use reth_primitives::{BlockId, BlockNumberOrTag, Receipt};
use reth_primitives::{BlockNumberOrTag, Receipt};
use reth_rpc_api::{
clients::{AdminApiClient, EthApiClient},
DebugApiClient, EthFilterApiClient, NetApiClient, OtterscanClient, TraceApiClient,

View File

@ -1,7 +1,7 @@
//! Implementation of the [`jsonrpsee`] generated [`EthApiServer`] trait. Handles RPC requests for
//! the `eth_` namespace.
use alloy_dyn_abi::TypedData;
use alloy_eips::eip2930::AccessListResult;
use alloy_eips::{eip2930::AccessListResult, BlockId};
use alloy_json_rpc::RpcObject;
use alloy_primitives::{Address, Bytes, B256, B64, U256, U64};
use alloy_rpc_types::{
@ -13,7 +13,7 @@ use alloy_rpc_types::{
};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::{BlockId, BlockNumberOrTag};
use reth_primitives::BlockNumberOrTag;
use reth_rpc_server_types::{result::internal_rpc_err, ToRpcResult};
use tracing::trace;

View File

@ -2,9 +2,10 @@
use std::sync::Arc;
use alloy_eips::BlockId;
use alloy_rpc_types::{Header, Index};
use futures::Future;
use reth_primitives::{BlockId, Receipt, SealedBlock, SealedBlockWithSenders};
use reth_primitives::{Receipt, SealedBlock, SealedBlockWithSenders};
use reth_provider::{BlockIdReader, BlockReader, BlockReaderIdExt, HeaderProvider};
use reth_rpc_types_compat::block::{from_block, uncle_block_from_header};

View File

@ -2,13 +2,14 @@
//! RPC methods.
use alloy_consensus::constants::KECCAK_EMPTY;
use alloy_eips::BlockId;
use alloy_primitives::{Address, Bytes, B256, U256};
use alloy_rpc_types::{serde_helpers::JsonStorageKey, Account, EIP1186AccountProofResponse};
use futures::Future;
use reth_chainspec::{EthChainSpec, EthereumHardforks};
use reth_errors::RethError;
use reth_evm::ConfigureEvmEnv;
use reth_primitives::{BlockId, Header};
use reth_primitives::Header;
use reth_provider::{
BlockIdReader, BlockNumReader, ChainSpecProvider, StateProvider, StateProviderBox,
StateProviderFactory,

View File

@ -3,15 +3,13 @@
use alloy_consensus::Transaction;
use alloy_dyn_abi::TypedData;
use alloy_eips::eip2718::Encodable2718;
use alloy_eips::{eip2718::Encodable2718, BlockId};
use alloy_network::TransactionBuilder;
use alloy_primitives::{Address, Bytes, TxHash, B256};
use alloy_rpc_types::{BlockNumberOrTag, TransactionInfo};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use futures::Future;
use reth_primitives::{
BlockId, Receipt, SealedBlockWithSenders, TransactionMeta, TransactionSigned,
};
use reth_primitives::{Receipt, SealedBlockWithSenders, TransactionMeta, TransactionSigned};
use reth_provider::{BlockNumReader, BlockReaderIdExt, ReceiptProvider, TransactionsProvider};
use reth_rpc_eth_types::{
utils::{binary_search, recover_raw_transaction},

View File

@ -2,11 +2,12 @@
use std::time::Duration;
use alloy_eips::BlockId;
use alloy_primitives::{Address, Bytes, U256};
use alloy_rpc_types::{error::EthRpcErrorCode, request::TransactionInputError, BlockError};
use alloy_sol_types::decode_revert_reason;
use reth_errors::RethError;
use reth_primitives::{revm_primitives::InvalidHeader, BlockId};
use reth_primitives::revm_primitives::InvalidHeader;
use reth_rpc_server_types::result::{
block_id_to_str, internal_rpc_err, invalid_params_rpc_err, rpc_err, rpc_error_with_code,
};

View File

@ -4,9 +4,10 @@
use std::time::Instant;
use alloy_eips::BlockId;
use alloy_primitives::B256;
use derive_more::Constructor;
use reth_primitives::{BlockId, BlockNumberOrTag, Receipt, SealedBlockWithSenders, SealedHeader};
use reth_primitives::{BlockNumberOrTag, Receipt, SealedBlockWithSenders, SealedHeader};
use revm_primitives::{BlockEnv, CfgEnvWithHandlerCfg};
/// Configured [`BlockEnv`] and [`CfgEnvWithHandlerCfg`] for a pending block.

View File

@ -14,11 +14,11 @@ workspace = true
[dependencies]
reth-errors.workspace = true
reth-network-api.workspace = true
reth-primitives.workspace = true
# ethereum
alloy-primitives.workspace = true
alloy-rpc-types-engine.workspace = true
alloy-eips.workspace = true
# rpc
jsonrpsee-core.workspace = true
@ -27,4 +27,3 @@ jsonrpsee-types.workspace = true
# misc
strum = { workspace = true, features = ["derive"] }
serde = { workspace = true, features = ["derive"] }

View File

@ -2,10 +2,10 @@
use std::fmt;
use alloy_eips::BlockId;
use alloy_rpc_types_engine::PayloadError;
use jsonrpsee_core::RpcResult;
use reth_errors::ConsensusError;
use reth_primitives::BlockId;
/// Helper trait to easily convert various `Result` types into [`RpcResult`]
pub trait ToRpcResult<Ok, Err>: Sized {

View File

@ -21,6 +21,7 @@ alloy-primitives.workspace = true
alloy-rpc-types-eth.workspace = true
alloy-rpc-types.workspace = true
alloy-rpc-types-trace.workspace = true
alloy-eips.workspace = true
# async
futures.workspace = true

View File

@ -6,6 +6,7 @@ use std::{
task::{Context, Poll},
};
use alloy_eips::BlockId;
use alloy_primitives::{TxHash, B256};
use alloy_rpc_types::{Block, Transaction};
use alloy_rpc_types_eth::transaction::TransactionRequest;
@ -15,7 +16,7 @@ use alloy_rpc_types_trace::{
};
use futures::{Stream, StreamExt};
use jsonrpsee::core::client::Error as RpcError;
use reth_primitives::{BlockId, Receipt};
use reth_primitives::Receipt;
use reth_rpc_api::{clients::DebugApiClient, EthApiClient};
const NOOP_TRACER: &str = include_str!("../assets/noop-tracer.js");

View File

@ -1,5 +1,6 @@
//! Helpers for testing trace calls.
use alloy_eips::BlockId;
use alloy_primitives::{map::HashSet, Bytes, TxHash, B256};
use alloy_rpc_types::Index;
use alloy_rpc_types_eth::transaction::TransactionRequest;
@ -10,7 +11,6 @@ use alloy_rpc_types_trace::{
};
use futures::{Stream, StreamExt};
use jsonrpsee::core::client::Error as RpcError;
use reth_primitives::BlockId;
use reth_rpc_api::clients::TraceApiClient;
use std::{
pin::Pin,

View File

@ -1,4 +1,4 @@
use alloy_eips::eip2718::Encodable2718;
use alloy_eips::{eip2718::Encodable2718, BlockId};
use alloy_primitives::{Address, Bytes, B256, U256};
use alloy_rlp::{Decodable, Encodable};
use alloy_rpc_types::{
@ -19,7 +19,7 @@ use reth_evm::{
system_calls::SystemCaller,
ConfigureEvmEnv,
};
use reth_primitives::{Block, BlockId, BlockNumberOrTag, TransactionSignedEcRecovered};
use reth_primitives::{Block, BlockNumberOrTag, TransactionSignedEcRecovered};
use reth_provider::{
BlockReaderIdExt, ChainSpecProvider, HeaderProvider, StateProofProvider, StateProviderFactory,
TransactionVariant,

View File

@ -1,3 +1,4 @@
use alloy_eips::BlockId;
use alloy_primitives::{Address, Bytes, B256, U256, U64};
use alloy_rpc_types::{
state::StateOverride, BlockOverrides, EIP1186AccountProofResponse, Filter, Log, SyncStatus,
@ -5,7 +6,7 @@ use alloy_rpc_types::{
use alloy_rpc_types_eth::transaction::TransactionRequest;
use alloy_serde::JsonStorageKey;
use jsonrpsee::core::RpcResult as Result;
use reth_primitives::{BlockId, BlockNumberOrTag};
use reth_primitives::BlockNumberOrTag;
use reth_rpc_api::{EngineEthApiServer, EthApiServer, EthFilterApiServer};
/// Re-export for convenience
pub use reth_rpc_engine_api::EngineApi;

View File

@ -1,4 +1,5 @@
use alloy_consensus::Transaction;
use alloy_eips::BlockId;
use alloy_network::{ReceiptResponse, TransactionResponse};
use alloy_primitives::{Address, Bytes, TxHash, B256, U256};
use alloy_rpc_types::{BlockTransactions, Header, TransactionReceipt};
@ -11,7 +12,7 @@ use alloy_rpc_types_trace::{
};
use async_trait::async_trait;
use jsonrpsee::{core::RpcResult, types::ErrorObjectOwned};
use reth_primitives::{BlockId, BlockNumberOrTag};
use reth_primitives::BlockNumberOrTag;
use reth_rpc_api::{EthApiServer, OtterscanServer};
use reth_rpc_eth_api::{
helpers::{EthTransactions, TraceExt},

View File

@ -1,10 +1,10 @@
use std::{collections::HashMap, future::Future, sync::Arc};
use alloy_eips::BlockId;
use alloy_primitives::{Address, U256};
use async_trait::async_trait;
use jsonrpsee::core::RpcResult;
use reth_errors::RethResult;
use reth_primitives::BlockId;
use reth_provider::{BlockReaderIdExt, ChangeSetReader, StateProviderFactory};
use reth_rpc_api::RethApiServer;
use reth_rpc_eth_types::{EthApiError, EthResult};

View File

@ -1,3 +1,4 @@
use alloy_eips::BlockId;
use alloy_primitives::{map::HashSet, Bytes, B256, U256};
use alloy_rpc_types::{
state::{EvmOverrides, StateOverride},
@ -17,7 +18,7 @@ use reth_consensus_common::calc::{
base_block_reward, base_block_reward_pre_merge, block_reward, ommer_reward,
};
use reth_evm::ConfigureEvmEnv;
use reth_primitives::{BlockId, Header};
use reth_primitives::Header;
use reth_provider::{BlockReader, ChainSpecProvider, EvmEnvProvider, StateProviderFactory};
use reth_revm::database::StateProviderDatabase;
use reth_rpc_api::TraceApiServer;