git.delta.rocks / unique-network / refs/commits / ca8bb41c3178

difftreelog

test fix unit

Yaroslav Bolyukin2023-06-01parent: #54a000e.patch.diff
in: master

4 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -12941,6 +12941,7 @@
  "pallet-timestamp",
  "pallet-transaction-payment",
  "pallet-unique",
+ "pallet-xcm",
  "parity-scale-codec",
  "scale-info",
  "sp-core",
modifiedruntime/tests/Cargo.tomldiffbeforeafterboth
--- a/runtime/tests/Cargo.toml
+++ b/runtime/tests/Cargo.toml
@@ -18,6 +18,7 @@
 
 frame-support = { workspace = true }
 frame-system = { workspace = true }
+pallet-xcm = { workspace = true }
 
 pallet-balances = { features = ["insecure_zero_ed"], workspace = true }
 pallet-timestamp = { workspace = true }
@@ -36,7 +37,7 @@
 
 pallet-evm-coder-substrate = { workspace = true }
 
-codec = { workspace = true }
+codec = { workspace = true, package = "parity-scale-codec" }
 scale-info = { workspace = true }
 
 evm-coder = { workspace = true }
modifiedruntime/tests/src/lib.rsdiffbeforeafterboth
--- a/runtime/tests/src/lib.rs
+++ b/runtime/tests/src/lib.rs
@@ -34,7 +34,7 @@
 	BackwardsAddressMapping,
 };
 use pallet_ethereum::PostLogContent;
-use parity_scale_codec::{Encode, Decode, MaxEncodedLen};
+use codec::{Encode, Decode, MaxEncodedLen};
 use scale_info::TypeInfo;
 
 use up_data_structs::mapping::{CrossTokenAddressMapping, EvmTokenAddressMapping};
@@ -63,6 +63,7 @@
 		UncheckedExtrinsic = UncheckedExtrinsic,
 	{
 		System: frame_system,
+		Timestamp: pallet_timestamp,
 		Unique: pallet_unique::{Pallet, Call, Storage},
 		Balances: pallet_balances::{Pallet, Call, Storage, Event<T>},
 		Common: pallet_common::{Pallet, Storage, Event<T>},
@@ -123,6 +124,10 @@
 	type MaxLocks = MaxLocks;
 	type MaxReserves = ();
 	type ReserveIdentifier = [u8; 8];
+	type MaxFreezes = MaxLocks;
+	type FreezeIdentifier = [u8; 8];
+	type MaxHolds = MaxLocks;
+	type HoldIdentifier = [u8; 8];
 }
 
 parameter_types! {
@@ -212,9 +217,11 @@
 	type RuntimeEvent = RuntimeEvent;
 	type StateRoot = pallet_ethereum::IntermediateStateRoot<Self>;
 	type PostLogContent = PostBlockAndTxnHashes;
+	type ExtraDataLength = ConstU32<32>;
 }
 
 impl pallet_evm::Config for Test {
+	type WeightInfo = pallet_evm::weights::SubstrateWeight<Self>;
 	type CrossAccountId = TestCrossAccountId;
 	type AddressMapping = TestEvmAddressMapping;
 	type BackwardsAddressMapping = TestEvmBackwardsAddressMapping;
@@ -236,6 +243,7 @@
 	type FindAuthor = ();
 	type BlockHashMapping = SubstrateBlockHashMapping<Self>;
 	type TransactionValidityHack = ();
+	type Timestamp = Timestamp;
 }
 impl pallet_evm_coder_substrate::Config for Test {}
 
@@ -272,7 +280,8 @@
 	pub Symbol: String = "TST".to_string();
 }
 impl pallet_balances_adapter::Config for Test {
-	type Currency = Balances;
+	type Inspect = Balances;
+	type Mutate = Balances;
 	type CurrencyBalance = <Balances as Currency<Self::AccountId>>::Balance;
 	type Decimals = Decimals;
 	type Name = Name;
modifiedruntime/tests/src/tests.rsdiffbeforeafterboth
3131
32fn add_balance(user: u64, value: u64) {32fn add_balance(user: u64, value: u64) {
33 const DONOR_USER: u64 = 999;33 const DONOR_USER: u64 = 999;
34 assert_ok!(<pallet_balances::Pallet<Test>>::set_balance(34 assert_ok!(<pallet_balances::Pallet<Test>>::force_set_balance(
35 RuntimeOrigin::root(),35 RuntimeOrigin::root(),
36 DONOR_USER,36 DONOR_USER,
37 value,37 value,
38 0
39 ));38 ));
40 assert_ok!(<pallet_balances::Pallet<Test>>::force_transfer(39 assert_ok!(<pallet_balances::Pallet<Test>>::force_transfer(
41 RuntimeOrigin::root(),40 RuntimeOrigin::root(),
199fn check_not_sufficient_founds() {198fn check_not_sufficient_founds() {
200 new_test_ext().execute_with(|| {199 new_test_ext().execute_with(|| {
201 let acc: u64 = 1;200 let acc: u64 = 1;
202 <pallet_balances::Pallet<Test>>::set_balance(RuntimeOrigin::root(), acc, 0, 0).unwrap();201 <pallet_balances::Pallet<Test>>::force_set_balance(RuntimeOrigin::root(), acc, 0).unwrap();
203202
204 let name: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();203 let name: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
205 let description: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();204 let description: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();