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.tomldiffbeforeafterboth181819frame-support = { workspace = true }19frame-support = { workspace = true }20frame-system = { workspace = true }20frame-system = { workspace = true }21pallet-xcm = { workspace = true }212222pallet-balances = { features = ["insecure_zero_ed"], workspace = true }23pallet-balances = { features = ["insecure_zero_ed"], workspace = true }23pallet-timestamp = { workspace = true }24pallet-timestamp = { workspace = true }363737pallet-evm-coder-substrate = { workspace = true }38pallet-evm-coder-substrate = { workspace = true }383939codec = { workspace = true }40codec = { workspace = true, package = "parity-scale-codec" }40scale-info = { workspace = true }41scale-info = { workspace = true }414242evm-coder = { workspace = true }43evm-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.rsdiffbeforeafterboth--- a/runtime/tests/src/tests.rs
+++ b/runtime/tests/src/tests.rs
@@ -31,11 +31,10 @@
fn add_balance(user: u64, value: u64) {
const DONOR_USER: u64 = 999;
- assert_ok!(<pallet_balances::Pallet<Test>>::set_balance(
+ assert_ok!(<pallet_balances::Pallet<Test>>::force_set_balance(
RuntimeOrigin::root(),
DONOR_USER,
value,
- 0
));
assert_ok!(<pallet_balances::Pallet<Test>>::force_transfer(
RuntimeOrigin::root(),
@@ -199,7 +198,7 @@
fn check_not_sufficient_founds() {
new_test_ext().execute_with(|| {
let acc: u64 = 1;
- <pallet_balances::Pallet<Test>>::set_balance(RuntimeOrigin::root(), acc, 0, 0).unwrap();
+ <pallet_balances::Pallet<Test>>::force_set_balance(RuntimeOrigin::root(), acc, 0).unwrap();
let name: Vec<u16> = "Test1\0".encode_utf16().collect::<Vec<u16>>();
let description: Vec<u16> = "TestDescription1\0".encode_utf16().collect::<Vec<u16>>();