Skip to content

Commit b618695

Browse files
committed
chore : cleanup
1 parent 791471b commit b618695

File tree

31 files changed

+233
-214
lines changed

31 files changed

+233
-214
lines changed

Cargo.lock

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ signature = { version = "2.2", default-features = false }
351351
# EVM & Ethereum
352352
# (wasm)
353353
ethereum-types = { version = "0.14.1", default-features = false }
354-
ethereum = { version = "0.15.0", default-features = false, features = ["with-codec"] }
354+
ethereum = { version = "0.18.2", default-features = false, features = ["with-scale"] }
355355
evm = { version = "0.41.1", default-features = false }
356356
evm-gasometer = { version = "0.41.0", default-features = false }
357357
evm-runtime = { version = "0.41.0", default-features = false }
@@ -415,3 +415,5 @@ subxt-signer = { version = "0.39.0", default-features = false }
415415

416416
[profile.release]
417417
panic = "unwind"
418+
419+

client/rpc-core/debug/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license = "GPL-3.0-only"
77
repository = { workspace = true }
88

99
[dependencies]
10-
ethereum = { workspace = true, features = [ "with-codec" ] }
10+
ethereum = { workspace = true, features = [ "with-scale" ] }
1111
ethereum-types = { workspace = true, features = [ "std" ] }
1212
futures = { workspace = true, features = [ "compat" ] }
1313
jsonrpsee = { workspace = true, features = [ "macros", "server" ] }

client/rpc-core/txpool/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ license = "GPL-3.0-only"
77
repository = { workspace = true }
88

99
[dependencies]
10-
ethereum = { workspace = true, features = ["std", "with-codec"] }
10+
ethereum = { workspace = true, features = ["std", "with-scale"] }
1111
ethereum-types = { workspace = true, features = ["std"] }
1212
jsonrpsee = { workspace = true, features = ["macros", "server"] }
1313
serde = { workspace = true, features = ["derive"] }

client/rpc/debug/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ sp-io = { workspace = true, features = ["std"] }
2828
sp-runtime = { workspace = true, features = ["std"] }
2929

3030
# Frontier
31-
ethereum = { workspace = true, features = ["std", "with-codec"] }
31+
ethereum = { workspace = true, features = ["std", "with-scale"] }
3232
ethereum-types = { workspace = true, features = ["std"] }
3333
fc-db = { workspace = true }
3434
fc-rpc = { workspace = true, features = ["rpc-binary-search-estimate"] }

client/rpc/txpool/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ sp-blockchain = { workspace = true }
2323
sp-runtime = { workspace = true }
2424

2525
# Frontier
26-
ethereum-types = { workspace = true, features = ["std"] }
26+
ethereum-types = { workspace = true, features = ["std", "serialize"] }
2727
fc-rpc = { workspace = true }

client/rpc/txpool/src/lib.rs

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ use ethereum_types::{H160, H256, U256};
1919
use fc_rpc::{internal_err, public_key};
2020
use jsonrpsee::core::RpcResult;
2121
pub use rpc_core_txpool::{GetT, Summary, Transaction, TransactionMap, TxPoolResult, TxPoolServer};
22-
use sc_transaction_pool::{ChainApi, Pool};
23-
use sc_transaction_pool_api::InPoolTransaction;
22+
use sc_transaction_pool::ChainApi;
23+
use sc_transaction_pool_api::TransactionPool as _;
2424
use serde::Serialize;
2525
use sha3::{Digest, Keccak256};
2626
use sp_api::{ApiExt, ProvideRuntimeApi};
@@ -30,19 +30,19 @@ use std::{marker::PhantomData, sync::Arc};
3030

3131
use rpc_primitives_txpool::{Transaction as TransactionV2, TxPoolResponse, TxPoolRuntimeApi};
3232

33-
pub struct TxPool<B: BlockT, C, A: ChainApi> {
33+
pub struct TxPool<B: BlockT, C, P> {
3434
client: Arc<C>,
35-
graph: Arc<Pool<A>>,
35+
pool: Arc<P>,
3636
_marker: PhantomData<B>,
3737
}
3838

39-
impl<B, C, A> TxPool<B, C, A>
39+
impl<B, C, P> TxPool<B, C, P>
4040
where
4141
C: ProvideRuntimeApi<B>,
4242
C: HeaderMetadata<B, Error = BlockChainError> + HeaderBackend<B> + 'static,
4343
C: Send + Sync + 'static,
4444
B: BlockT<Hash = H256> + Send + Sync + 'static,
45-
A: ChainApi<Block = B> + 'static,
45+
P: sc_transaction_pool_api::TransactionPool<Block = B> + 'static,
4646
C::Api: TxPoolRuntimeApi<B>,
4747
{
4848
/// Use the transaction graph interface to get the extrinsics currently in the ready and future
@@ -53,19 +53,17 @@ where
5353
{
5454
// Collect transactions in the ready validated pool.
5555
let txs_ready = self
56-
.graph
57-
.validated_pool()
56+
.pool
5857
.ready()
59-
.map(|in_pool_tx| in_pool_tx.data().clone())
58+
.map(|in_pool_tx| (**in_pool_tx.data()).clone())
6059
.collect();
6160

6261
// Collect transactions in the future validated pool.
6362
let txs_future = self
64-
.graph
65-
.validated_pool()
63+
.pool
6664
.futures()
67-
.iter()
68-
.map(|(_hash, extrinsic)| extrinsic.clone())
65+
.into_iter()
66+
.map(|in_pool_tx| (**in_pool_tx.data()).clone())
6967
.collect();
7068

7169
// Use the runtime to match the (here) opaque extrinsics against ethereum transactions.
@@ -131,19 +129,19 @@ where
131129
}
132130
}
133131

134-
impl<B: BlockT, C, A: ChainApi> TxPool<B, C, A> {
135-
pub fn new(client: Arc<C>, graph: Arc<Pool<A>>) -> Self {
136-
Self { client, graph, _marker: PhantomData }
132+
impl<B: BlockT, C, P> TxPool<B, C, P> {
133+
pub fn new(client: Arc<C>, pool: Arc<P>) -> Self {
134+
Self { client, pool, _marker: PhantomData }
137135
}
138136
}
139137

140-
impl<B, C, A> TxPoolServer for TxPool<B, C, A>
138+
impl<B, C, P> TxPoolServer for TxPool<B, C, P>
141139
where
142140
C: ProvideRuntimeApi<B>,
143141
C: HeaderMetadata<B, Error = BlockChainError> + HeaderBackend<B>,
144142
C: Send + Sync + 'static,
145143
B: BlockT<Hash = H256> + Send + Sync + 'static,
146-
A: ChainApi<Block = B> + 'static,
144+
P: sc_transaction_pool_api::TransactionPool<Block = B> + 'static,
147145
C::Api: TxPoolRuntimeApi<B>,
148146
{
149147
fn content(&self) -> RpcResult<TxPoolResult<TransactionMap<Transaction>>> {
@@ -155,13 +153,13 @@ where
155153
}
156154

157155
fn status(&self) -> RpcResult<TxPoolResult<U256>> {
158-
let status = self.graph.validated_pool().status();
156+
let status = self.pool.status();
159157
Ok(TxPoolResult { pending: U256::from(status.ready), queued: U256::from(status.future) })
160158
}
161159
}
162160

163-
impl<B: BlockT, C, A: ChainApi> Clone for TxPool<B, C, A> {
161+
impl<B: BlockT, C, P> Clone for TxPool<B, C, P> {
164162
fn clone(&self) -> Self {
165-
Self::new(self.client.clone(), self.graph.clone())
163+
Self::new(self.client.clone(), self.pool.clone())
166164
}
167165
}

pallets/multi-asset-delegation/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ serde = { workspace = true, features = ["derive"], optional = true }
2828
hex = { workspace = true, features = ["alloc"] }
2929

3030
# Optional dependencies for fuzzing
31-
ethereum = { workspace = true, features = ["with-codec"], optional = true }
31+
ethereum = { workspace = true, features = ["with-scale"], optional = true }
3232
ethers = { version = "2.0", optional = true }
3333
num_enum = { workspace = true, optional = true }
3434
hex-literal = { workspace = true, optional = true }
@@ -66,7 +66,7 @@ pallet-proxy = { workspace = true, optional = true }
6666
pallet-utility = { workspace = true, optional = true }
6767

6868
[dev-dependencies]
69-
ethereum = { workspace = true, features = ["with-codec"] }
69+
ethereum = { workspace = true, features = ["with-scale"] }
7070
ethers = "2.0"
7171
num_enum = { workspace = true }
7272
hex-literal = { workspace = true }

pallets/rewards/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ hex = { workspace = true, features = ["alloc"] }
2929
pallet-multi-asset-delegation = { workspace = true, default-features = false, optional = true }
3030

3131
[dev-dependencies]
32-
ethereum = { workspace = true, features = ["with-codec"] }
32+
ethereum = { workspace = true, features = ["with-scale"] }
3333
ethers = "2.0"
3434
num_enum = { workspace = true }
3535
hex-literal = { workspace = true }

pallets/services/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ hex = { workspace = true, features = ["alloc"] }
2727
k256 = { workspace = true }
2828

2929
[dev-dependencies]
30-
ethereum = { workspace = true, features = ["with-codec"] }
30+
ethereum = { workspace = true, features = ["with-scale"] }
3131
hex = { workspace = true }
3232
num_enum = { workspace = true }
3333
hex-literal = { workspace = true }

0 commit comments

Comments
 (0)