From 3d1d15df952a06f4a4c8770dee330704f8bc07cd Mon Sep 17 00:00:00 2001 From: Dino Pacandi Date: Mon, 25 Sep 2023 18:08:09 +0200 Subject: [PATCH] Fixes --- pallets/dynamic-evm-base-fee/src/benchmarking.rs | 4 ++-- pallets/dynamic-evm-base-fee/src/lib.rs | 11 ++++++++++- pallets/dynamic-evm-base-fee/src/mock.rs | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pallets/dynamic-evm-base-fee/src/benchmarking.rs b/pallets/dynamic-evm-base-fee/src/benchmarking.rs index 4b3da9bc05..73aa0fac9c 100644 --- a/pallets/dynamic-evm-base-fee/src/benchmarking.rs +++ b/pallets/dynamic-evm-base-fee/src/benchmarking.rs @@ -67,9 +67,9 @@ mod benchmarks { #[cfg(test)] mod tests { use crate::mock; - use sp_io::TestExternalities; + use frame_support::sp_io::TestExternalities; pub fn new_test_ext() -> TestExternalities { - mock::ExtBuilder::default().build() + mock::ExtBuilder::build() } } diff --git a/pallets/dynamic-evm-base-fee/src/lib.rs b/pallets/dynamic-evm-base-fee/src/lib.rs index c5fd9d170d..c2da00c304 100644 --- a/pallets/dynamic-evm-base-fee/src/lib.rs +++ b/pallets/dynamic-evm-base-fee/src/lib.rs @@ -31,7 +31,7 @@ //! //! The core formula this pallet tries to satisfy is: //! -//! base_fee_per_gas = adjustment_factor * weight_factor * 25 / 98974 +//! base_fee_per_gas = adjustment_factor * weight_factor * 25 / 98974 //! //! Where: //! * **adjustment_factor** - is a value that changes in-between the blocks, related to the block fill ratio. @@ -92,6 +92,15 @@ pub trait WeightInfo { fn set_base_fee_per_gas() -> Weight; } +impl WeightInfo for () { + fn base_fee_per_gas_adjustment() -> Weight { + Weight::zero() + } + fn set_base_fee_per_gas() -> Weight { + Weight::zero() + } +} + #[frame_support::pallet] pub mod pallet { use frame_support::pallet_prelude::*; diff --git a/pallets/dynamic-evm-base-fee/src/mock.rs b/pallets/dynamic-evm-base-fee/src/mock.rs index 452f87c2ff..f0e8d0ecde 100644 --- a/pallets/dynamic-evm-base-fee/src/mock.rs +++ b/pallets/dynamic-evm-base-fee/src/mock.rs @@ -110,6 +110,7 @@ impl pallet_dynamic_evm_base_fee::Config for TestRuntime { type AdjustmentFactor = GetAdjustmentFactor; type WeightFactor = ConstU128<30_000_000_000_000_000>; type StepLimitRatio = StepLimitRation; + type WeightInfo = (); } type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic;