Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions client/rpc/src/eth/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ where
let client = Arc::clone(&self.client);
let block_data_cache = Arc::clone(&self.block_data_cache);
let backend = Arc::clone(&self.backend);
let graph = Arc::clone(&self.graph);
let pool = Arc::clone(&self.pool);

match frontier_backend_client::native_block_id::<B, C>(
client.as_ref(),
Expand Down Expand Up @@ -143,16 +143,14 @@ where
let mut xts: Vec<<B as BlockT>::Extrinsic> = Vec::new();
// ready validated pool
xts.extend(
graph
.ready()
pool.ready()
.map(|in_pool_tx| in_pool_tx.data().as_ref().clone())
.collect::<Vec<<B as BlockT>::Extrinsic>>(),
);

// future validated pool
xts.extend(
graph
.futures()
pool.futures()
.iter()
.map(|in_pool_tx| in_pool_tx.data().as_ref().clone())
.collect::<Vec<<B as BlockT>::Extrinsic>>(),
Expand Down Expand Up @@ -194,7 +192,7 @@ where
) -> RpcResult<Option<U256>> {
if let BlockNumberOrHash::Pending = number_or_hash {
// get the pending transactions count
return Ok(Some(U256::from(self.graph.ready().count())));
return Ok(Some(U256::from(self.pool.ready().count())));
}

let block_info = self.block_info_by_number(number_or_hash).await?;
Expand Down
10 changes: 5 additions & 5 deletions client/rpc/src/eth/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ use crate::{cache::EthBlockDataCacheTask, frontier_backend_client, internal_err}
pub struct EthFilter<B: BlockT, C, BE, P> {
client: Arc<C>,
backend: Arc<dyn fc_api::Backend<B>>,
graph: Arc<P>,
pool: Arc<P>,
filter_pool: FilterPool,
max_stored_filters: usize,
max_past_logs: u32,
Expand All @@ -57,7 +57,7 @@ impl<B: BlockT, C, BE, P: TransactionPool> EthFilter<B, C, BE, P> {
pub fn new(
client: Arc<C>,
backend: Arc<dyn fc_api::Backend<B>>,
graph: Arc<P>,
pool: Arc<P>,
filter_pool: FilterPool,
max_stored_filters: usize,
max_past_logs: u32,
Expand All @@ -66,7 +66,7 @@ impl<B: BlockT, C, BE, P: TransactionPool> EthFilter<B, C, BE, P> {
Self {
client,
backend,
graph,
pool,
filter_pool,
max_stored_filters,
max_past_logs,
Expand Down Expand Up @@ -107,7 +107,7 @@ where

let pending_transaction_hashes = if let FilterType::PendingTransaction = filter_type {
let txs_ready = self
.graph
.pool
.ready()
.map(|in_pool_tx| in_pool_tx.data().as_ref().clone())
.collect();
Expand Down Expand Up @@ -220,7 +220,7 @@ where
FilterType::PendingTransaction => {
let previous_hashes = pool_item.pending_transaction_hashes;
let txs_ready = self
.graph
.pool
.ready()
.map(|in_pool_tx| in_pool_tx.data().as_ref().clone())
.collect();
Expand Down
5 changes: 0 additions & 5 deletions client/rpc/src/eth/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ impl<B: BlockT, C> EthConfig<B, C> for () {
/// Eth API implementation.
pub struct Eth<B: BlockT, C, P, CT, BE, CIDP, EC> {
pool: Arc<P>,
graph: Arc<P>,
client: Arc<C>,
convert_transaction: Option<CT>,
sync: Arc<SyncingService<B>>,
Expand Down Expand Up @@ -104,7 +103,6 @@ where
pub fn new(
client: Arc<C>,
pool: Arc<P>,
graph: Arc<P>,
convert_transaction: Option<CT>,
sync: Arc<SyncingService<B>>,
signers: Vec<Box<dyn EthSigner>>,
Expand All @@ -122,7 +120,6 @@ where
Self {
client,
pool,
graph,
convert_transaction,
sync,
is_authority,
Expand Down Expand Up @@ -254,7 +251,6 @@ where
let Self {
client,
pool,
graph,
convert_transaction,
sync,
is_authority,
Expand All @@ -274,7 +270,6 @@ where
Eth {
client,
pool,
graph,
convert_transaction,
sync,
is_authority,
Expand Down
2 changes: 1 addition & 1 deletion client/rpc/src/eth/pending.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ where

// Get all extrinsics from the ready queue.
let extrinsics: Vec<<B as BlockT>::Extrinsic> = self
.graph
.pool
.ready()
.map(|in_pool_tx| in_pool_tx.data().as_ref().clone())
.collect::<Vec<<B as BlockT>::Extrinsic>>();
Expand Down
4 changes: 2 additions & 2 deletions client/rpc/src/eth/submit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ where

pub async fn pending_transactions(&self) -> RpcResult<Vec<Transaction>> {
let ready = self
.graph
.pool
.ready()
.map(|in_pool_tx| in_pool_tx.data().as_ref().clone())
.collect::<Vec<_>>();

let future = self
.graph
.pool
.futures()
.iter()
.map(|in_pool_tx| in_pool_tx.data().as_ref().clone())
Expand Down
8 changes: 3 additions & 5 deletions client/rpc/src/eth/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ where
pub async fn transaction_by_hash(&self, hash: H256) -> RpcResult<Option<Transaction>> {
let client = Arc::clone(&self.client);
let backend = Arc::clone(&self.backend);
let graph = Arc::clone(&self.graph);
let pool = Arc::clone(&self.pool);

let (eth_block_hash, index) = match frontier_backend_client::load_transactions::<B, C>(
client.as_ref(),
Expand Down Expand Up @@ -77,16 +77,14 @@ where
let mut xts: Vec<<B as BlockT>::Extrinsic> = Vec::new();
// Collect transactions in the ready validated pool.
xts.extend(
graph
.ready()
pool.ready()
.map(|in_pool_tx| in_pool_tx.data().as_ref().clone())
.collect::<Vec<<B as BlockT>::Extrinsic>>(),
);

// Collect transactions in the future validated pool.
xts.extend(
graph
.futures()
pool.futures()
.iter()
.map(|in_pool_tx| in_pool_tx.data().as_ref().clone())
.collect::<Vec<<B as BlockT>::Extrinsic>>(),
Expand Down
10 changes: 3 additions & 7 deletions template/node/src/rpc/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ pub struct EthDeps<B: BlockT, C, P, CT, CIDP> {
pub client: Arc<C>,
/// Transaction pool instance.
pub pool: Arc<P>,
/// Graph pool instance.
pub graph: Arc<P>,
/// Ethereum transaction converter.
pub converter: Option<CT>,
/// The Node authority flag
Expand Down Expand Up @@ -102,7 +100,6 @@ where
let EthDeps {
client,
pool,
graph,
converter,
is_authority,
enable_dev_signer,
Expand All @@ -129,7 +126,6 @@ where
Eth::<B, C, P, CT, BE, CIDP, EC>::new(
client.clone(),
pool.clone(),
graph.clone(),
converter,
sync.clone(),
signers,
Expand All @@ -153,7 +149,7 @@ where
EthFilter::new(
client.clone(),
frontier_backend.clone(),
graph.clone(),
pool.clone(),
filter_pool,
500_usize, // max stored filters
max_past_logs,
Expand All @@ -165,7 +161,7 @@ where

io.merge(
EthPubSub::new(
pool,
pool.clone(),
client.clone(),
sync,
subscription_task_executor,
Expand Down Expand Up @@ -198,7 +194,7 @@ where
)?;

#[cfg(feature = "txpool")]
io.merge(TxPool::new(client, graph).into_rpc())?;
io.merge(TxPool::new(client, pool).into_rpc())?;

Ok(io)
}
1 change: 0 additions & 1 deletion template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,6 @@ where
let eth_deps = crate::rpc::EthDeps {
client: client.clone(),
pool: pool.clone(),
graph: pool.clone(),
converter: Some(TransactionConverter::<B>::default()),
is_authority,
enable_dev_signer,
Expand Down
Loading