From fbe1581b0e5f6b9d9e75283e0b238da7004a7278 Mon Sep 17 00:00:00 2001 From: Edwin Wang Date: Tue, 31 Aug 2021 17:51:07 +0800 Subject: [PATCH] fix bad mandatory error --- pallets/assets/src/mock.rs | 2 +- pallets/bancor/src/mock.rs | 2 +- pallets/bid/src/mock.rs | 4 ++-- pallets/bridge-eos/src/mock.rs | 26 +++++++++++++++++--------- pallets/flexible-fee/src/mock.rs | 2 +- pallets/liquidity-mining/src/mock.rs | 2 +- pallets/minter-reward/src/mock.rs | 2 +- pallets/proxy-validator/src/mock.rs | 15 +++++++++------ pallets/salp/src/mock.rs | 2 +- pallets/staking-reward/src/mock.rs | 2 +- pallets/swap/src/mock.rs | 2 +- pallets/vesting/src/lib.rs | 2 +- pallets/vsbond-auction/src/mock.rs | 2 +- pallets/vtoken-mint/src/mock.rs | 2 +- runtime/asgard/src/lib.rs | 2 +- runtime/dev/src/lib.rs | 2 +- xcm-support/src/mock.rs | 4 ++-- 17 files changed, 43 insertions(+), 32 deletions(-) diff --git a/pallets/assets/src/mock.rs b/pallets/assets/src/mock.rs index e183908330..a218170d46 100644 --- a/pallets/assets/src/mock.rs +++ b/pallets/assets/src/mock.rs @@ -63,7 +63,7 @@ parameter_types! { impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountId; - type BaseCallFilter = (); + type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); type BlockNumber = u64; diff --git a/pallets/bancor/src/mock.rs b/pallets/bancor/src/mock.rs index c82ade5af5..84777e8224 100644 --- a/pallets/bancor/src/mock.rs +++ b/pallets/bancor/src/mock.rs @@ -68,7 +68,7 @@ parameter_types! { impl frame_system::Config for Test { type AccountData = (); type AccountId = AccountId; - type BaseCallFilter = (); + type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); type BlockNumber = u64; diff --git a/pallets/bid/src/mock.rs b/pallets/bid/src/mock.rs index 8a8e287f44..e6f5286872 100644 --- a/pallets/bid/src/mock.rs +++ b/pallets/bid/src/mock.rs @@ -21,7 +21,7 @@ // use super::*; use frame_support::{ construct_runtime, parameter_types, - traits::{OnFinalize, OnInitialize}, + traits::{Everything, OnFinalize, OnInitialize}, }; use node_primitives::{CurrencyId, TokenSymbol}; use sp_core::H256; @@ -61,7 +61,7 @@ parameter_types! { impl frame_system::Config for Test { type AccountData = balances::AccountData; type AccountId = u128; - type BaseCallFilter = (); + type BaseCallFilter = Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); type BlockNumber = u64; diff --git a/pallets/bridge-eos/src/mock.rs b/pallets/bridge-eos/src/mock.rs index 2145c124bc..6dbf327513 100644 --- a/pallets/bridge-eos/src/mock.rs +++ b/pallets/bridge-eos/src/mock.rs @@ -18,15 +18,20 @@ #![cfg(test)] -use crate as pallet_bridge_eos; use codec::Decode; use frame_support::{ - construct_runtime, parameter_types, ConsensusEngineId, PalletId, - traits::{OnInitialize, OnFinalize, FindAuthor} + construct_runtime, parameter_types, + traits::{FindAuthor, OnFinalize, OnInitialize}, + ConsensusEngineId, PalletId, }; use sp_core::H256; -use sp_runtime::{testing::{Header, TestXt}, traits::{BlakeTwo256, IdentityLookup}}; +use sp_runtime::{ + testing::{Header, TestXt}, + traits::{BlakeTwo256, IdentityLookup}, +}; + use super::*; +use crate as pallet_bridge_eos; pub type AccountId = u64; pub type BlockNumber = u64; pub type Amount = i128; @@ -61,7 +66,7 @@ parameter_types! { frame_system::limits::BlockWeights::simple_max(1024); } impl frame_system::Config for Test { - type BaseCallFilter = (); + type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); @@ -136,7 +141,8 @@ pub struct AuthorGiven; impl FindAuthor for AuthorGiven { fn find_author<'a, I>(digests: I) -> Option - where I: 'a + IntoIterator + where + I: 'a + IntoIterator, { for (id, data) in digests { if id == TEST_ID { @@ -162,7 +168,8 @@ impl pallet_authorship::Config for Test { /// An extrinsic type used for tests. pub type Extrinsic = TestXt; -impl frame_system::offchain::SendTransactionTypes for Test where +impl frame_system::offchain::SendTransactionTypes for Test +where Call: From, { type Extrinsic = Extrinsic; @@ -186,7 +193,6 @@ impl crate::Config for Test { type WeightInfo = (); } - parameter_types! { // 3 hours(1800 blocks) as an era pub const VtokenMintDuration: u32 = 3 * 60 * 1; @@ -243,6 +249,8 @@ pub(crate) fn new_test_ext() -> sp_io::TestExternalities { all_crosschain_privilege: Vec::new(), cross_trade_eos_limit: 50, eos_asset_id: CurrencyId::Token(TokenSymbol::EOS), - }.assimilate_storage(&mut t).unwrap(); + } + .assimilate_storage(&mut t) + .unwrap(); t.into() } diff --git a/pallets/flexible-fee/src/mock.rs b/pallets/flexible-fee/src/mock.rs index 42f49893ba..6d404268d6 100644 --- a/pallets/flexible-fee/src/mock.rs +++ b/pallets/flexible-fee/src/mock.rs @@ -80,7 +80,7 @@ parameter_types! { impl system::Config for Test { type AccountData = balances::AccountData; type AccountId = AccountId; - type BaseCallFilter = (); + type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); type BlockNumber = u64; diff --git a/pallets/liquidity-mining/src/mock.rs b/pallets/liquidity-mining/src/mock.rs index daecf0e814..77b44a1b45 100644 --- a/pallets/liquidity-mining/src/mock.rs +++ b/pallets/liquidity-mining/src/mock.rs @@ -66,7 +66,7 @@ parameter_types! { impl frame_system::Config for T { type AccountData = pallet_balances::AccountData; type AccountId = AccountId; - type BaseCallFilter = (); + type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); type BlockNumber = BlockNumber; diff --git a/pallets/minter-reward/src/mock.rs b/pallets/minter-reward/src/mock.rs index b1d7a6b4f6..f4b18e7553 100644 --- a/pallets/minter-reward/src/mock.rs +++ b/pallets/minter-reward/src/mock.rs @@ -84,7 +84,7 @@ parameter_types! { impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = sp_runtime::AccountId32; - type BaseCallFilter = (); + type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); type BlockNumber = u64; diff --git a/pallets/proxy-validator/src/mock.rs b/pallets/proxy-validator/src/mock.rs index a46c8c00e3..1e99972823 100644 --- a/pallets/proxy-validator/src/mock.rs +++ b/pallets/proxy-validator/src/mock.rs @@ -19,13 +19,16 @@ #![cfg(test)] use frame_support::{ - construct_runtime, parameter_types -}; -use frame_support::traits::{ - OnInitialize, OnFinalize + construct_runtime, parameter_types, + traits::{OnFinalize, OnInitialize}, }; use sp_core::H256; -use sp_runtime::{Perbill, testing::Header, traits::{BlakeTwo256, IdentityLookup}}; +use sp_runtime::{ + testing::Header, + traits::{BlakeTwo256, IdentityLookup}, + Perbill, +}; + use super::*; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic; @@ -49,7 +52,7 @@ parameter_types! { frame_system::limits::BlockWeights::simple_max(1024); } impl frame_system::Config for Test { - type BaseCallFilter = (); + type BaseCallFilter = frame_support::traits::Everything; type BlockWeights = (); type BlockLength = (); type DbWeight = (); diff --git a/pallets/salp/src/mock.rs b/pallets/salp/src/mock.rs index 285482a69f..456a805fd8 100644 --- a/pallets/salp/src/mock.rs +++ b/pallets/salp/src/mock.rs @@ -82,7 +82,7 @@ parameter_types! { impl frame_system::Config for Test { type AccountData = pallet_balances::AccountData; type AccountId = AccountId; - type BaseCallFilter = (); + type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); type BlockNumber = BlockNumber; diff --git a/pallets/staking-reward/src/mock.rs b/pallets/staking-reward/src/mock.rs index c1ad8a3c34..8da0159b84 100644 --- a/pallets/staking-reward/src/mock.rs +++ b/pallets/staking-reward/src/mock.rs @@ -58,7 +58,7 @@ parameter_types! { impl frame_system::Config for Test { type AccountData = pallet_balances::AccountData; type AccountId = u64; - type BaseCallFilter = (); + type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); type BlockNumber = u64; diff --git a/pallets/swap/src/mock.rs b/pallets/swap/src/mock.rs index 2c6de58f2e..5e522b634b 100644 --- a/pallets/swap/src/mock.rs +++ b/pallets/swap/src/mock.rs @@ -60,7 +60,7 @@ parameter_types! { impl frame_system::Config for Test { type AccountData = pallet_balances::AccountData; type AccountId = u64; - type BaseCallFilter = (); + type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); type BlockNumber = u64; diff --git a/pallets/vesting/src/lib.rs b/pallets/vesting/src/lib.rs index 1ff107f138..9b1369a907 100644 --- a/pallets/vesting/src/lib.rs +++ b/pallets/vesting/src/lib.rs @@ -530,7 +530,7 @@ mod tests { impl frame_system::Config for Test { type AccountData = pallet_balances::AccountData; type AccountId = u64; - type BaseCallFilter = (); + type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); type BlockNumber = u64; diff --git a/pallets/vsbond-auction/src/mock.rs b/pallets/vsbond-auction/src/mock.rs index 4d7546bbbc..5457157266 100644 --- a/pallets/vsbond-auction/src/mock.rs +++ b/pallets/vsbond-auction/src/mock.rs @@ -54,7 +54,7 @@ parameter_types! { impl frame_system::Config for Test { type AccountData = (); type AccountId = AccountId; - type BaseCallFilter = (); + type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); type BlockNumber = BlockNumber; diff --git a/pallets/vtoken-mint/src/mock.rs b/pallets/vtoken-mint/src/mock.rs index 0a0035f8df..17396fc0b8 100644 --- a/pallets/vtoken-mint/src/mock.rs +++ b/pallets/vtoken-mint/src/mock.rs @@ -86,7 +86,7 @@ parameter_types! { impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountId; - type BaseCallFilter = (); + type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); type BlockNumber = u64; diff --git a/runtime/asgard/src/lib.rs b/runtime/asgard/src/lib.rs index d3d3e5e431..237d02bac4 100644 --- a/runtime/asgard/src/lib.rs +++ b/runtime/asgard/src/lib.rs @@ -186,7 +186,7 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; /// The identifier used to distinguish between accounts. type AccountId = AccountId; - type BaseCallFilter = (); + type BaseCallFilter = Everything; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = BlockHashCount; type BlockLength = RuntimeBlockLength; diff --git a/runtime/dev/src/lib.rs b/runtime/dev/src/lib.rs index d92cae2186..a6133e417d 100644 --- a/runtime/dev/src/lib.rs +++ b/runtime/dev/src/lib.rs @@ -192,7 +192,7 @@ impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; /// The identifier used to distinguish between accounts. type AccountId = AccountId; - type BaseCallFilter = (); + type BaseCallFilter = frame_support::traits::Everything; /// Maximum number of block number to block hash mappings to keep (oldest pruned first). type BlockHashCount = BlockHashCount; type BlockLength = RuntimeBlockLength; diff --git a/xcm-support/src/mock.rs b/xcm-support/src/mock.rs index f9808d0368..a89c5b0b51 100644 --- a/xcm-support/src/mock.rs +++ b/xcm-support/src/mock.rs @@ -338,7 +338,7 @@ pub mod para { impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountId; - type BaseCallFilter = (); + type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); type BlockNumber = u64; @@ -559,7 +559,7 @@ pub mod relay { impl frame_system::Config for Runtime { type AccountData = pallet_balances::AccountData; type AccountId = AccountId; - type BaseCallFilter = (); + type BaseCallFilter = frame_support::traits::Everything; type BlockHashCount = BlockHashCount; type BlockLength = (); type BlockNumber = u64;