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
12941 "pallet-timestamp",12941 "pallet-timestamp",
12942 "pallet-transaction-payment",12942 "pallet-transaction-payment",
12943 "pallet-unique",12943 "pallet-unique",
12944 "pallet-xcm",
12944 "parity-scale-codec",12945 "parity-scale-codec",
12945 "scale-info",12946 "scale-info",
12946 "sp-core",12947 "sp-core",
modifiedruntime/tests/Cargo.tomldiffbeforeafterboth
1818
19frame-support = { workspace = true }19frame-support = { workspace = true }
20frame-system = { workspace = true }20frame-system = { workspace = true }
21pallet-xcm = { workspace = true }
2122
22pallet-balances = { features = ["insecure_zero_ed"], workspace = true }23pallet-balances = { features = ["insecure_zero_ed"], workspace = true }
23pallet-timestamp = { workspace = true }24pallet-timestamp = { workspace = true }
3637
37pallet-evm-coder-substrate = { workspace = true }38pallet-evm-coder-substrate = { workspace = true }
3839
39codec = { workspace = true }40codec = { workspace = true, package = "parity-scale-codec" }
40scale-info = { workspace = true }41scale-info = { workspace = true }
4142
42evm-coder = { workspace = true }43evm-coder = { workspace = true }
modifiedruntime/tests/src/lib.rsdiffbeforeafterboth
34 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;
3939
40use 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}
127132
128parameter_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}
216222
217impl 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 {}
241249
272 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;
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>>();