git.delta.rocks / unique-network / refs/commits / 9b836649cc42

difftreelog

fix unit tests

Trubnikov Sergey2023-05-10parent: #008dfe4.patch.diff
in: master

6 files changed

modifiedCargo.lockdiffbeforeafterboth
12926 "frame-support",12926 "frame-support",
12927 "frame-system",12927 "frame-system",
12928 "pallet-balances",12928 "pallet-balances",
12929 "pallet-balances-adapter",
12929 "pallet-common",12930 "pallet-common",
12930 "pallet-configuration",
12931 "pallet-ethereum",12931 "pallet-ethereum",
12932 "pallet-evm",12932 "pallet-evm",
12933 "pallet-evm-coder-substrate",12933 "pallet-evm-coder-substrate",
12938 "pallet-timestamp",12938 "pallet-timestamp",
12939 "pallet-transaction-payment",12939 "pallet-transaction-payment",
12940 "pallet-unique",12940 "pallet-unique",
12941 "pallet-xcm",
12942 "parity-scale-codec",12941 "parity-scale-codec",
12943 "scale-info",12942 "scale-info",
12944 "sp-core",12943 "sp-core",
modifiedpallets/balances-adapter/src/common.rsdiffbeforeafterboth
249249
250 fn account_tokens(&self, account: <T>::CrossAccountId) -> Vec<TokenId> {250 fn account_tokens(&self, account: <T>::CrossAccountId) -> Vec<TokenId> {
251 let balance = <T as Config>::Currency::total_balance(account.as_sub());251 let balance = <T as Config>::Currency::total_balance(account.as_sub());
252 let balance: u128 = balance.into();
252 if balance != 0 {253 if balance != 0 {
253 vec![TokenId::default()]254 vec![TokenId::default()]
254 } else {255 } else {
modifiedpallets/balances-adapter/src/lib.rsdiffbeforeafterboth
76 Balance = Self::CurrencyBalance,76 Balance = Self::CurrencyBalance,
77 >;77 >;
78 /// Balance type of chain78 /// Balance type of chain
79 type CurrencyBalance: Into<U256> + TryFrom<U256> + PartialEq<u128> + From<u128> + Into<u128>;79 type CurrencyBalance: Into<U256> + TryFrom<U256> + TryFrom<u128> + Into<u128>;
8080
81 /// Decimals of balance81 /// Decimals of balance
82 type Decimals: Get<u8>;82 type Decimals: Get<u8>;
144 <T as Config>::Currency::transfer(144 <T as Config>::Currency::transfer(
145 from.as_sub(),145 from.as_sub(),
146 to.as_sub(),146 to.as_sub(),
147 amount.into(),147 amount
148 .try_into()
149 .map_err(|_| sp_runtime::ArithmeticError::Overflow)?,
148 ExistenceRequirement::KeepAlive,150 ExistenceRequirement::KeepAlive,
149 )?;151 )?;
150152
modifiedruntime/common/config/pallets/mod.rsdiffbeforeafterboth
5454
55parameter_types! {55parameter_types! {
56 pub const CollectionCreationPrice: Balance = 2 * UNIQUE;56 pub const CollectionCreationPrice: Balance = 2 * UNIQUE;
57 pub const Decimals: u8 = DECIMALS;
58 pub TreasuryAccountId: AccountId = TreasuryModuleId::get().into_account_truncating();57 pub TreasuryAccountId: AccountId = TreasuryModuleId::get().into_account_truncating();
59 pub Name: String = RUNTIME_NAME.to_string();
60 pub Symbol: String = TOKEN_SYMBOL.to_string();
61}58}
6259
63impl pallet_common::Config for Runtime {60impl pallet_common::Config for Runtime {
89 type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;86 type WeightInfo = pallet_nonfungible::weights::SubstrateWeight<Self>;
90}87}
88
89parameter_types! {
90 pub const Decimals: u8 = DECIMALS;
91 pub Name: String = RUNTIME_NAME.to_string();
92 pub Symbol: String = TOKEN_SYMBOL.to_string();
93}
91impl pallet_balances_adapter::Config for Runtime {94impl pallet_balances_adapter::Config for Runtime {
92 type Currency = Balances;95 type Currency = Balances;
93 type CurrencyBalance = <Balances as Currency<Self::AccountId>>::Balance;96 type CurrencyBalance = <Balances as Currency<Self::AccountId>>::Balance;
modifiedruntime/tests/Cargo.tomldiffbeforeafterboth
26pallet-ethereum = { workspace = true }26pallet-ethereum = { workspace = true }
27pallet-evm = { workspace = true }27pallet-evm = { workspace = true }
2828
29pallet-balances-adapter = { workspace = true }
29pallet-common = { workspace = true }30pallet-common = { workspace = true }
30pallet-fungible = { workspace = true }31pallet-fungible = { workspace = true }
31pallet-nonfungible = { workspace = true }32pallet-nonfungible = { workspace = true }
41evm-coder = { workspace = true }42evm-coder = { workspace = true }
42up-sponsorship = { workspace = true }43up-sponsorship = { workspace = true }
43xcm = { workspace = true }44xcm = { workspace = true }
44pallet-xcm = { workspace = true }
45pallet-configuration = { workspace = true }
4645
modifiedruntime/tests/src/lib.rsdiffbeforeafterboth
19use sp_core::{H160, H256, U256};19use sp_core::{H160, H256, U256};
20use frame_support::{20use frame_support::{
21 parameter_types,21 parameter_types,
22 traits::{Everything, ConstU32, ConstU64},22 traits::{Everything, ConstU32, ConstU64, Currency},
23 weights::IdentityFee,23 weights::IdentityFee,
24 pallet_prelude::Weight,24 pallet_prelude::Weight,
25};25};
266impl pallet_nonfungible::Config for Test {266impl pallet_nonfungible::Config for Test {
267 type WeightInfo = ();267 type WeightInfo = ();
268}268}
269parameter_types! {
270 pub const Decimals: u8 = 18;
271 pub Name: String = "Test".to_string();
272 pub Symbol: String = "TST".to_string();
273}
274impl pallet_balances_adapter::Config for Test {
275 type Currency = Balances;
276 type CurrencyBalance = <Balances as Currency<Self::AccountId>>::Balance;
277 type Decimals = Decimals;
278 type Name = Name;
279 type Symbol = Symbol;
280 type WeightInfo = ();
281}
269282
270parameter_types! {283parameter_types! {
271 // 0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f284 // 0x6c4e9fe1ae37a41e93cee429e8e1881abdcbb54f