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.rsdiffbeforeafterboth34 BackwardsAddressMapping,34 BackwardsAddressMapping,35};35};36use pallet_ethereum::PostLogContent;36use pallet_ethereum::PostLogContent;37use parity_scale_codec::{Encode, Decode, MaxEncodedLen};37use codec::{Encode, Decode, MaxEncodedLen};38use scale_info::TypeInfo;38use scale_info::TypeInfo;393940use up_data_structs::mapping::{CrossTokenAddressMapping, EvmTokenAddressMapping};40use up_data_structs::mapping::{CrossTokenAddressMapping, EvmTokenAddressMapping};63 UncheckedExtrinsic = UncheckedExtrinsic,63 UncheckedExtrinsic = UncheckedExtrinsic,64 {64 {65 System: frame_system,65 System: frame_system,66 Timestamp: pallet_timestamp,66 Unique: pallet_unique::{Pallet, Call, Storage},67 Unique: pallet_unique::{Pallet, Call, Storage},67 Balances: pallet_balances::{Pallet, Call, Storage, Event<T>},68 Balances: pallet_balances::{Pallet, Call, Storage, Event<T>},68 Common: pallet_common::{Pallet, Storage, Event<T>},69 Common: pallet_common::{Pallet, Storage, Event<T>},123 type MaxLocks = MaxLocks;124 type MaxLocks = MaxLocks;124 type MaxReserves = ();125 type MaxReserves = ();125 type ReserveIdentifier = [u8; 8];126 type ReserveIdentifier = [u8; 8];127 type MaxFreezes = MaxLocks;128 type FreezeIdentifier = [u8; 8];129 type MaxHolds = MaxLocks;130 type HoldIdentifier = [u8; 8];126}131}127132128parameter_types! {133parameter_types! {212 type RuntimeEvent = RuntimeEvent;217 type RuntimeEvent = RuntimeEvent;213 type StateRoot = pallet_ethereum::IntermediateStateRoot<Self>;218 type StateRoot = pallet_ethereum::IntermediateStateRoot<Self>;214 type PostLogContent = PostBlockAndTxnHashes;219 type PostLogContent = PostBlockAndTxnHashes;220 type ExtraDataLength = ConstU32<32>;215}221}216222217impl pallet_evm::Config for Test {223impl pallet_evm::Config for Test {224 type WeightInfo = pallet_evm::weights::SubstrateWeight<Self>;218 type CrossAccountId = TestCrossAccountId;225 type CrossAccountId = TestCrossAccountId;219 type AddressMapping = TestEvmAddressMapping;226 type AddressMapping = TestEvmAddressMapping;220 type BackwardsAddressMapping = TestEvmBackwardsAddressMapping;227 type BackwardsAddressMapping = TestEvmBackwardsAddressMapping;236 type FindAuthor = ();243 type FindAuthor = ();237 type BlockHashMapping = SubstrateBlockHashMapping<Self>;244 type BlockHashMapping = SubstrateBlockHashMapping<Self>;238 type TransactionValidityHack = ();245 type TransactionValidityHack = ();246 type Timestamp = Timestamp;239}247}240impl pallet_evm_coder_substrate::Config for Test {}248impl pallet_evm_coder_substrate::Config for Test {}241249272 pub Symbol: String = "TST".to_string();280 pub Symbol: String = "TST".to_string();273}281}274impl pallet_balances_adapter::Config for Test {282impl pallet_balances_adapter::Config for Test {275 type Currency = Balances;283 type Inspect = Balances;284 type Mutate = Balances;276 type CurrencyBalance = <Balances as Currency<Self::AccountId>>::Balance;285 type CurrencyBalance = <Balances as Currency<Self::AccountId>>::Balance;277 type Decimals = Decimals;286 type Decimals = Decimals;278 type Name = Name;287 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>>();