chore(rpc): make TransactionCompat::fill stateful (#11732)

This commit is contained in:
Emilia Hane
2024-10-24 06:46:07 +02:00
committed by GitHub
parent 082f2cd235
commit 7a06298cf7
22 changed files with 167 additions and 75 deletions

View File

@ -22,7 +22,7 @@ pub struct EthHandlers<Provider, Pool, Network, Events, EthApi: EthApiTypes> {
/// Polling based filter handler available on all transports
pub filter: EthFilter<Provider, Pool, EthApi>,
/// Handler for subscriptions only available for transports that support it (ws, ipc)
pub pubsub: EthPubSub<Provider, Pool, Events, Network, EthApi>,
pub pubsub: EthPubSub<Provider, Pool, Events, Network, EthApi::TransactionCompat>,
}
impl<Provider, Pool, Network, Events, EthApi> EthHandlers<Provider, Pool, Network, Events, EthApi>
@ -94,6 +94,7 @@ where
ctx.cache.clone(),
ctx.config.filter_config(),
Box::new(ctx.executor.clone()),
api.tx_resp_builder().clone(),
);
let pubsub = EthPubSub::with_spawner(
@ -102,6 +103,7 @@ where
ctx.events.clone(),
ctx.network.clone(),
Box::new(ctx.executor.clone()),
api.tx_resp_builder().clone(),
);
Self { api, cache: ctx.cache, filter, pubsub }

View File

@ -1199,9 +1199,12 @@ where
.into_rpc()
.into(),
RethRpcModule::Web3 => Web3Api::new(self.network.clone()).into_rpc().into(),
RethRpcModule::Txpool => {
TxPoolApi::<_, EthApi>::new(self.pool.clone()).into_rpc().into()
}
RethRpcModule::Txpool => TxPoolApi::new(
self.pool.clone(),
self.eth.api.tx_resp_builder().clone(),
)
.into_rpc()
.into(),
RethRpcModule::Rpc => RPCApi::new(
namespaces
.iter()