difftreelog
test fix unit
in: master
4 files changed
Cargo.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",
runtime/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 }
runtime/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;
runtime/tests/src/tests.rsdiffbeforeafterboth313132fn 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 039 ));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();203202204 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>>();