Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e2e7495

Browse files
author
Grigoriy Simonov
committedApr 18, 2023
fix: benchmarking
1 parent f1ee266 commit e2e7495

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed
 

‎Cargo.lock

+1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎frame/ethereum/src/lib.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -1014,9 +1014,15 @@ impl From<InvalidEvmTransactionError> for InvalidTransactionWrapper {
10141014
}
10151015
}
10161016

1017-
#[derive(TypeInfo, PartialEq, Eq, Clone, Debug, Encode, Decode)]
1017+
#[derive(TypeInfo, PartialEq, Eq, Clone, Debug, Encode, Decode, Default)]
10181018
pub struct FakeTransactionFinalizer<T>(PhantomData<T>);
10191019

1020+
impl<T> FakeTransactionFinalizer<T> {
1021+
pub fn new() -> Self {
1022+
Self(Default::default())
1023+
}
1024+
}
1025+
10201026
impl<T: Config + TypeInfo + core::fmt::Debug + Send + Sync> sp_runtime::traits::SignedExtension
10211027
for FakeTransactionFinalizer<T>
10221028
{

‎template/node/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ substrate-frame-rpc-system = { workspace = true }
6363
frame-benchmarking = { workspace = true, optional = true }
6464
frame-benchmarking-cli = { workspace = true, optional = true }
6565
frame-system = { workspace = true }
66+
pallet-ethereum = { workspace = true }
6667
pallet-transaction-payment = { workspace = true }
6768

6869
# Frontier
@@ -92,4 +93,5 @@ runtime-benchmarks = [
9293
"frame-benchmarking-cli/runtime-benchmarks",
9394
"sc-service/runtime-benchmarks",
9495
"frontier-template-runtime/runtime-benchmarks",
96+
"pallet-ethereum/runtime-benchmarks",
9597
]

‎template/node/src/benchmarking.rs

+2
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ pub fn create_benchmark_extrinsic(
151151
frame_system::CheckNonce::<runtime::Runtime>::from(nonce),
152152
frame_system::CheckWeight::<runtime::Runtime>::new(),
153153
pallet_transaction_payment::ChargeTransactionPayment::<runtime::Runtime>::from(0),
154+
pallet_ethereum::FakeTransactionFinalizer::<runtime::Runtime>::new(),
154155
);
155156

156157
let raw_payload = runtime::SignedPayload::from_raw(
@@ -165,6 +166,7 @@ pub fn create_benchmark_extrinsic(
165166
(),
166167
(),
167168
(),
169+
(),
168170
),
169171
);
170172
let signature = raw_payload.using_encoded(|e| sender.sign(e));

0 commit comments

Comments
 (0)
Please sign in to comment.