mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
chore(txpool): update TransactionPool trait bounds (#376)
This commit is contained in:
@ -107,7 +107,7 @@ pub struct TransactionsManager<Pool> {
|
||||
|
||||
impl<Pool> TransactionsManager<Pool>
|
||||
where
|
||||
Pool: TransactionPool + Clone,
|
||||
Pool: TransactionPool + 'static,
|
||||
<Pool as TransactionPool>::Transaction: IntoRecoveredTransaction,
|
||||
{
|
||||
/// Sets up a new instance.
|
||||
@ -377,7 +377,7 @@ where
|
||||
/// This should be spawned or used as part of `tokio::select!`.
|
||||
impl<Pool> Future for TransactionsManager<Pool>
|
||||
where
|
||||
Pool: TransactionPool + Clone + Unpin,
|
||||
Pool: TransactionPool + Unpin + 'static,
|
||||
<Pool as TransactionPool>::Transaction: IntoRecoveredTransaction,
|
||||
{
|
||||
type Output = ();
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
//! Provides everything related to `eth_` namespace
|
||||
|
||||
use reth_interfaces::Result;
|
||||
use reth_primitives::{Transaction, U256, U64};
|
||||
use reth_primitives::{U256, U64};
|
||||
use reth_provider::{BlockProvider, StateProviderFactory};
|
||||
use reth_transaction_pool::TransactionPool;
|
||||
use std::sync::Arc;
|
||||
@ -24,8 +24,8 @@ pub struct EthApi<Pool, Client> {
|
||||
|
||||
impl<Pool, Client> EthApi<Pool, Client>
|
||||
where
|
||||
Pool: TransactionPool<Transaction = Transaction> + Clone,
|
||||
Client: BlockProvider + StateProviderFactory,
|
||||
Pool: TransactionPool + 'static,
|
||||
Client: BlockProvider + StateProviderFactory + 'static,
|
||||
{
|
||||
/// Creates a new, shareable instance.
|
||||
pub fn new(client: Arc<Client>, pool: Pool) -> Self {
|
||||
|
||||
@ -5,7 +5,7 @@ use crate::{eth::api::EthApi, result::ToRpcResult};
|
||||
use jsonrpsee::core::RpcResult as Result;
|
||||
use reth_primitives::{
|
||||
rpc::{transaction::eip2930::AccessListWithGasUsed, BlockId},
|
||||
Address, BlockNumber, Bytes, Transaction, H256, H64, U256, U64,
|
||||
Address, BlockNumber, Bytes, H256, H64, U256, U64,
|
||||
};
|
||||
use reth_provider::{BlockProvider, StateProviderFactory};
|
||||
use reth_rpc_api::EthApiServer;
|
||||
@ -19,7 +19,7 @@ use serde_json::Value;
|
||||
#[async_trait::async_trait]
|
||||
impl<Pool, Client> EthApiServer for EthApi<Pool, Client>
|
||||
where
|
||||
Pool: TransactionPool<Transaction = Transaction> + Clone + 'static,
|
||||
Pool: TransactionPool + 'static,
|
||||
Client: BlockProvider + StateProviderFactory + 'static,
|
||||
{
|
||||
fn protocol_version(&self) -> Result<U64> {
|
||||
|
||||
@ -28,7 +28,7 @@ impl<Pool, Client> EthPubSub<Pool, Client> {
|
||||
|
||||
impl<Pool, Client> EthPubSubApiServer for EthPubSub<Pool, Client>
|
||||
where
|
||||
Pool: TransactionPool + Clone,
|
||||
Pool: TransactionPool + 'static,
|
||||
Client: BlockProvider + 'static,
|
||||
{
|
||||
fn subscribe(
|
||||
|
||||
@ -9,8 +9,11 @@ use tokio::sync::mpsc::Receiver;
|
||||
/// This is intended to be used by API-consumers such as RPC that need inject new incoming,
|
||||
/// unverified transactions. And by block production that needs to get transactions to execute in a
|
||||
/// new block.
|
||||
///
|
||||
/// Note: This requires `Clone` for convenience, since it is assumed that this will be implemented
|
||||
/// for a wrapped `Arc` type, see also [`Pool`](crate::Pool).
|
||||
#[async_trait::async_trait]
|
||||
pub trait TransactionPool: Send + Sync + 'static {
|
||||
pub trait TransactionPool: Send + Sync + Clone {
|
||||
/// The transaction type of the pool
|
||||
type Transaction: PoolTransaction;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user