git.delta.rocks / unique-network / refs/commits / 7742ed99af1b

difftreelog

test fix mocks

Yaroslav Bolyukin2021-10-11parent: #f7d05a5.patch.diff
in: master

3 files changed

modifiedpallets/inflation/src/tests.rsdiffbeforeafterboth
--- 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 = ();
modifiedpallets/nft/src/mock.rsdiffbeforeafterboth
22
3use crate as pallet_template;3use crate as pallet_template;
4use sp_core::H256;4use sp_core::H256;
5use frame_support::{parameter_types, weights::IdentityFee};5use frame_support::{parameter_types, traits::Everything, weights::IdentityFee};
6use sp_runtime::{6use sp_runtime::{
7 traits::{BlakeTwo256, IdentityLookup},7 traits::{BlakeTwo256, IdentityLookup},
8 testing::Header,8 testing::Header,
12use pallet_evm::AddressMapping;12use pallet_evm::AddressMapping;
13use crate::{EvmBackwardsAddressMapping, CrossAccountId};13use crate::{EvmBackwardsAddressMapping, CrossAccountId};
14use codec::{Encode, Decode};14use codec::{Encode, Decode};
15use scale_info::TypeInfo;
1516
16type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;17type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>;
17type Block = frame_system::mocking::MockBlock<Test>;18type Block = frame_system::mocking::MockBlock<Test>;
35}36}
3637
37impl system::Config for Test {38impl system::Config for Test {
38 type BaseCallFilter = ();39 type BaseCallFilter = Everything;
39 type BlockWeights = ();40 type BlockWeights = ();
40 type BlockLength = ();41 type BlockLength = ();
41 type DbWeight = ();42 type DbWeight = ();
7980
80parameter_types! {81parameter_types! {
81 pub const TransactionByteFee: u64 = 1;82 pub const TransactionByteFee: u64 = 1;
83 pub const OperationalFeeMultiplier: u8 = 5;
82}84}
8385
84impl pallet_transaction_payment::Config for Test {86impl pallet_transaction_payment::Config for Test {
85 type OnChargeTransaction = CurrencyAdapter<pallet_balances::Pallet<Test>, ()>;87 type OnChargeTransaction = CurrencyAdapter<pallet_balances::Pallet<Test>, ()>;
86 type TransactionByteFee = TransactionByteFee;88 type TransactionByteFee = TransactionByteFee;
87 type WeightToFee = IdentityFee<u64>;89 type WeightToFee = IdentityFee<u64>;
88 type FeeMultiplierUpdate = ();90 type FeeMultiplierUpdate = ();
91 type OperationalFeeMultiplier = OperationalFeeMultiplier;
89}92}
9093
91parameter_types! {94parameter_types! {
118 }121 }
119}122}
120123
121#[derive(Encode, Decode, Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]124#[derive(Encode, Decode, Clone, PartialEq, Eq, PartialOrd, Ord, Debug, TypeInfo)]
122pub struct TestCrossAccountId(u64, sp_core::H160);125pub struct TestCrossAccountId(u64, sp_core::H160);
123impl CrossAccountId<u64> for TestCrossAccountId {126impl CrossAccountId<u64> for TestCrossAccountId {
124 fn from_sub(sub: u64) -> Self {127 fn from_sub(sub: u64) -> Self {
modifiedpallets/scheduler/src/lib.rsdiffbeforeafterboth
--- 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<Call> for BaseFilter {
 		fn contains(call: &Call) -> bool {
-			!matches!(call, Call::Logger(logger::Call::log(_, _)))
+			!matches!(call, Call::Logger(logger::Call::log { .. }))
 		}
 	}