From 7742ed99af1b3f9c5d4b8f1bab42370b15c5f2e2 Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 11 Oct 2021 07:53:15 +0000 Subject: [PATCH] test: fix mocks --- --- a/pallets/inflation/src/tests.rs +++ b/pallets/inflation/src/tests.rs @@ -6,7 +6,9 @@ traits::{Currency}, parameter_types, }; -use frame_support::{traits::OnInitialize}; +use frame_support::{ + traits::{OnInitialize, Everything}, +}; use sp_core::H256; use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, @@ -55,7 +57,7 @@ } impl frame_system::Config for Test { - type BaseCallFilter = (); + type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); --- a/pallets/nft/src/mock.rs +++ b/pallets/nft/src/mock.rs @@ -2,7 +2,7 @@ use crate as pallet_template; use sp_core::H256; -use frame_support::{parameter_types, weights::IdentityFee}; +use frame_support::{parameter_types, traits::Everything, weights::IdentityFee}; use sp_runtime::{ traits::{BlakeTwo256, IdentityLookup}, testing::Header, @@ -12,6 +12,7 @@ use pallet_evm::AddressMapping; use crate::{EvmBackwardsAddressMapping, CrossAccountId}; use codec::{Encode, Decode}; +use scale_info::TypeInfo; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; type Block = frame_system::mocking::MockBlock; @@ -35,7 +36,7 @@ } impl system::Config for Test { - type BaseCallFilter = (); + type BaseCallFilter = Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); @@ -79,6 +80,7 @@ parameter_types! { pub const TransactionByteFee: u64 = 1; + pub const OperationalFeeMultiplier: u8 = 5; } impl pallet_transaction_payment::Config for Test { @@ -86,6 +88,7 @@ type TransactionByteFee = TransactionByteFee; type WeightToFee = IdentityFee; type FeeMultiplierUpdate = (); + type OperationalFeeMultiplier = OperationalFeeMultiplier; } parameter_types! { @@ -118,7 +121,7 @@ } } -#[derive(Encode, Decode, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)] +#[derive(Encode, Decode, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, TypeInfo)] pub struct TestCrossAccountId(u64, sp_core::H160); impl CrossAccountId for TestCrossAccountId { fn from_sub(sub: u64) -> Self { --- a/pallets/scheduler/src/lib.rs +++ b/pallets/scheduler/src/lib.rs @@ -796,7 +796,7 @@ use frame_support::{ Hashable, assert_err, assert_noop, assert_ok, ord_parameter_types, parameter_types, - traits::{Contains, Filter, OnFinalize, OnInitialize}, + traits::{Contains, OnFinalize, OnInitialize}, weights::constants::RocksDbWeight, }; use sp_core::H256; @@ -873,7 +873,7 @@ pub struct BaseFilter; impl Contains for BaseFilter { fn contains(call: &Call) -> bool { - !matches!(call, Call::Logger(logger::Call::log(_, _))) + !matches!(call, Call::Logger(logger::Call::log { .. })) } } -- gitstuff