chore: move Filter to rpc-types (#2648)

This commit is contained in:
Matthias Seitz
2023-05-12 18:15:03 +02:00
committed by GitHub
parent f2cf105227
commit 4a492f6cd1
10 changed files with 1268 additions and 1245 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -19,7 +19,6 @@ mod chain;
mod checkpoints;
pub mod constants;
pub mod contract;
pub mod filter;
mod forkid;
mod genesis;
mod hardfork;

View File

@@ -1,14 +1,12 @@
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::{
filter::Filter, Address, BlockHash, BlockId, BlockNumberOrTag, Bytes, H256, U256, U64,
};
use reth_primitives::{Address, BlockHash, BlockId, BlockNumberOrTag, Bytes, H256, U256, U64};
use reth_rpc_types::{
engine::{
ExecutionPayload, ExecutionPayloadBodies, ExecutionPayloadEnvelope, ForkchoiceState,
ForkchoiceUpdated, PayloadAttributes, PayloadId, PayloadStatus, TransitionConfiguration,
},
state::StateOverride,
CallRequest, Log, RichBlock, SyncStatus,
CallRequest, Filter, Log, RichBlock, SyncStatus,
};
#[cfg_attr(not(feature = "client"), rpc(server))]

View File

@@ -1,6 +1,5 @@
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use reth_primitives::filter::Filter;
use reth_rpc_types::{FilterChanges, FilterId, Log};
use reth_rpc_types::{Filter, FilterChanges, FilterId, Log};
/// Rpc Interface for poll-based ethereum filter API.
#[cfg_attr(not(feature = "client"), rpc(server))]

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,7 @@
//! Ethereum types for pub-sub
use crate::{Log, RichHeader};
use reth_primitives::{filter::Filter, H256};
use crate::{eth::Filter, Log, RichHeader};
use reth_primitives::H256;
use serde::{de::Error, Deserialize, Deserializer, Serialize, Serializer};
/// Subscription result.

View File

@@ -1,9 +1,9 @@
use jsonrpsee::core::RpcResult as Result;
use reth_primitives::{filter::Filter, Address, BlockId, BlockNumberOrTag, Bytes, H256, U256, U64};
use reth_primitives::{Address, BlockId, BlockNumberOrTag, Bytes, H256, U256, U64};
use reth_rpc_api::{EngineEthApiServer, EthApiServer, EthFilterApiServer};
/// Re-export for convenience
pub use reth_rpc_engine_api::EngineApi;
use reth_rpc_types::{state::StateOverride, CallRequest, Log, RichBlock, SyncStatus};
use reth_rpc_types::{state::StateOverride, CallRequest, Filter, Log, RichBlock, SyncStatus};
use tracing_futures::Instrument;
macro_rules! engine_span {

View File

@@ -9,13 +9,10 @@ use crate::{
};
use async_trait::async_trait;
use jsonrpsee::{core::RpcResult, server::IdProvider};
use reth_primitives::{
filter::{Filter, FilterBlockOption, FilteredParams},
Receipt, SealedBlock,
};
use reth_primitives::{Receipt, SealedBlock};
use reth_provider::{BlockIdProvider, BlockProvider, EvmEnvProvider};
use reth_rpc_api::EthFilterApiServer;
use reth_rpc_types::{FilterChanges, FilterId, Log};
use reth_rpc_types::{Filter, FilterBlockOption, FilterChanges, FilterId, FilteredParams, Log};
use reth_transaction_pool::TransactionPool;
use std::{collections::HashMap, iter::StepBy, ops::RangeInclusive, sync::Arc, time::Instant};
use tokio::sync::Mutex;

View File

@@ -1,5 +1,5 @@
use reth_primitives::{filter::FilteredParams, BlockNumHash, ChainInfo, Receipt, TxHash, U256};
use reth_rpc_types::Log;
use reth_primitives::{BlockNumHash, ChainInfo, Receipt, TxHash, U256};
use reth_rpc_types::{FilteredParams, Log};
/// Returns all matching logs of a block's receipts grouped with the hash of their transaction.
pub(crate) fn matching_block_logs<I>(
@@ -97,7 +97,8 @@ pub(crate) fn get_filter_block_range(
#[cfg(test)]
mod tests {
use super::*;
use reth_primitives::{filter::Filter, BlockNumberOrTag};
use reth_primitives::BlockNumberOrTag;
use reth_rpc_types::Filter;
#[test]
fn test_log_range_from_and_to() {

View File

@@ -3,9 +3,10 @@ use crate::eth::logs_utils;
use futures::StreamExt;
use jsonrpsee::{server::SubscriptionMessage, PendingSubscriptionSink, SubscriptionSink};
use reth_network_api::NetworkInfo;
use reth_primitives::{filter::FilteredParams, TxHash};
use reth_primitives::TxHash;
use reth_provider::{BlockProvider, CanonStateSubscriptions, EvmEnvProvider};
use reth_rpc_api::EthPubSubApiServer;
use reth_rpc_types::FilteredParams;
use reth_rpc_types::{
pubsub::{