difftreelog
Merge pull request #263 from UniqueNetwork/release/opal-v913000
in: master
Release/opal v913000
6 files changed
Cargo.lockdiffbeforeafterboth11679 "pallet-evm-migration",11679 "pallet-evm-migration",11680 "pallet-evm-transaction-payment",11680 "pallet-evm-transaction-payment",11681 "pallet-fungible",11681 "pallet-fungible",11682 "pallet-inflation",11683 "pallet-nonfungible",11682 "pallet-nonfungible",11684 "pallet-randomness-collective-flip",11683 "pallet-randomness-collective-flip",11685 "pallet-refungible",11684 "pallet-refungible",runtime/Cargo.tomldiffbeforeafterboth33 'pallet-refungible/runtime-benchmarks',33 'pallet-refungible/runtime-benchmarks',34 'pallet-nonfungible/runtime-benchmarks',34 'pallet-nonfungible/runtime-benchmarks',35 'pallet-unique/runtime-benchmarks',35 'pallet-unique/runtime-benchmarks',36 'pallet-inflation/runtime-benchmarks',36# 'pallet-inflation/runtime-benchmarks',37 'pallet-xcm/runtime-benchmarks',37 'pallet-xcm/runtime-benchmarks',38 'sp-runtime/runtime-benchmarks',38 'sp-runtime/runtime-benchmarks',39 'xcm-builder/runtime-benchmarks',39 'xcm-builder/runtime-benchmarks',75 'fp-self-contained/std',75 'fp-self-contained/std',76 'parachain-info/std',76 'parachain-info/std',77 'serde',77 'serde',78 'pallet-inflation/std',78# 'pallet-inflation/std',79 'pallet-common/std',79 'pallet-common/std',80 'pallet-fungible/std',80 'pallet-fungible/std',81 'pallet-refungible/std',81 'pallet-refungible/std',380pallet-unique = { path = '../pallets/unique', default-features = false }380pallet-unique = { path = '../pallets/unique', default-features = false }381up-rpc = { path = "../primitives/rpc", default-features = false }381up-rpc = { path = "../primitives/rpc", default-features = false }382up-evm-mapping = { path = "../primitives/evm-mapping", default-features = false }382up-evm-mapping = { path = "../primitives/evm-mapping", default-features = false }383pallet-inflation = { path = '../pallets/inflation', default-features = false }383# pallet-inflation = { path = '../pallets/inflation', default-features = false }384up-data-structs = { path = '../primitives/data-structs', default-features = false }384up-data-structs = { path = '../primitives/data-structs', default-features = false }385pallet-common = { default-features = false, path = "../pallets/common" }385pallet-common = { default-features = false, path = "../pallets/common" }386pallet-fungible = { default-features = false, path = "../pallets/fungible" }386pallet-fungible = { default-features = false, path = "../pallets/fungible" }runtime/src/lib.rsdiffbeforeafterboth147 spec_name: create_runtime_str!("opal"),147 spec_name: create_runtime_str!("opal"),148 impl_name: create_runtime_str!("opal"),148 impl_name: create_runtime_str!("opal"),149 authoring_version: 1,149 authoring_version: 1,150 spec_version: 912204,150 spec_version: 913000,151 impl_version: 1,151 impl_version: 1,152 apis: RUNTIME_API_VERSIONS,152 apis: RUNTIME_API_VERSIONS,153 transaction_version: 1,153 transaction_version: 1,785 type Event = Event;785 type Event = Event;786 type WeightInfo = pallet_unique::weights::SubstrateWeight<Self>;786 type WeightInfo = pallet_unique::weights::SubstrateWeight<Self>;787}787}788788/*789parameter_types! {789parameter_types! {790 pub const InflationBlockInterval: BlockNumber = 100; // every time per how many blocks inflation is applied790 pub const InflationBlockInterval: BlockNumber = 100; // every time per how many blocks inflation is applied791}791} */792792793/// Used for the pallet inflation793/// Used for the pallet inflation794impl pallet_inflation::Config for Runtime {794/* impl pallet_inflation::Config for Runtime {795 type Currency = Balances;795 type Currency = Balances;796 type TreasuryAccountId = TreasuryAccountId;796 type TreasuryAccountId = TreasuryAccountId;797 type InflationBlockInterval = InflationBlockInterval;797 type InflationBlockInterval = InflationBlockInterval;798}798} */799799800// parameter_types! {800// parameter_types! {801// pub MaximumSchedulerWeight: Weight = Perbill::from_percent(50) *801// pub MaximumSchedulerWeight: Weight = Perbill::from_percent(50) *882 DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,882 DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,883883884 // Unique Pallets884 // Unique Pallets885 Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,885 // Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,886 Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,886 Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,887 // Scheduler: pallet_unq_scheduler::{Pallet, Call, Storage, Event<T>} = 62,887 // Scheduler: pallet_unq_scheduler::{Pallet, Call, Storage, Event<T>} = 62,888 // free = 63888 // free = 63136713671368 list_benchmark!(list, extra, pallet_evm_migration, EvmMigration);1368 list_benchmark!(list, extra, pallet_evm_migration, EvmMigration);1369 list_benchmark!(list, extra, pallet_unique, Unique);1369 list_benchmark!(list, extra, pallet_unique, Unique);1370 list_benchmark!(list, extra, pallet_inflation, Inflation);1370 //list_benchmark!(list, extra, pallet_inflation, Inflation);1371 list_benchmark!(list, extra, pallet_fungible, Fungible);1371 list_benchmark!(list, extra, pallet_fungible, Fungible);1372 list_benchmark!(list, extra, pallet_refungible, Refungible);1372 list_benchmark!(list, extra, pallet_refungible, Refungible);1373 list_benchmark!(list, extra, pallet_nonfungible, Nonfungible);1373 list_benchmark!(list, extra, pallet_nonfungible, Nonfungible);140114011402 add_benchmark!(params, batches, pallet_evm_migration, EvmMigration);1402 add_benchmark!(params, batches, pallet_evm_migration, EvmMigration);1403 add_benchmark!(params, batches, pallet_unique, Unique);1403 add_benchmark!(params, batches, pallet_unique, Unique);1404 add_benchmark!(params, batches, pallet_inflation, Inflation);1404 //add_benchmark!(params, batches, pallet_inflation, Inflation);1405 add_benchmark!(params, batches, pallet_fungible, Fungible);1405 add_benchmark!(params, batches, pallet_fungible, Fungible);1406 add_benchmark!(params, batches, pallet_refungible, Refungible);1406 add_benchmark!(params, batches, pallet_refungible, Refungible);1407 add_benchmark!(params, batches, pallet_nonfungible, Nonfungible);1407 add_benchmark!(params, batches, pallet_nonfungible, Nonfungible);tests/src/creditFeesToTreasury.test.tsdiffbeforeafterboth34// Skip the inflation block pauses if the block is close to inflation block34// Skip the inflation block pauses if the block is close to inflation block35// until the inflation happens35// until the inflation happens36/*eslint no-async-promise-executor: "off"*/36/*eslint no-async-promise-executor: "off"*/37function skipInflationBlock(api: ApiPromise): Promise<void> {37/*function skipInflationBlock(api: ApiPromise): Promise<void> {38 const promise = new Promise<void>(async (resolve) => {38 const promise = new Promise<void>(async (resolve) => {39 const blockInterval = (await api.consts.inflation.inflationBlockInterval).toNumber();39 const blockInterval = (await api.consts.inflation.inflationBlockInterval).toNumber();40 const unsubscribe = await api.rpc.chain.subscribeNewHeads(head => {40 const unsubscribe = await api.rpc.chain.subscribeNewHeads(head => {41 const currentBlock = head.number.toNumber();41 const currentBlock = head.number.toNumber();42 if (currentBlock % blockInterval < blockInterval - 10) {42 if (currentBlock % blockInterval < blockInterval - 10) {43 unsubscribe();43 unsubscribe();44 resolve();44 resolve();45 } else {45 } else {46 console.log(`Skipping inflation block, current block: ${currentBlock}`);46 console.log(`Skipping inflation block, current block: ${currentBlock}`);47 }47 }48 });48 });49 });49 });505051 return promise;51 return promise;52}52}*/535354describe('integration test: Fees must be credited to Treasury:', () => {54describe('integration test: Fees must be credited to Treasury:', () => {55 before(async () => {55 before(async () => {616162 it('Total issuance does not change', async () => {62 it('Total issuance does not change', async () => {63 await usingApi(async (api) => {63 await usingApi(async (api) => {64 await skipInflationBlock(api);64 //await skipInflationBlock(api);65 await waitNewBlocks(api, 1);65 await waitNewBlocks(api, 1);666667 const totalBefore = (await api.query.balances.totalIssuance()).toBigInt();67 const totalBefore = (await api.query.balances.totalIssuance()).toBigInt();818182 it('Sender balance decreased by fee+sent amount, Treasury balance increased by fee', async () => {82 it('Sender balance decreased by fee+sent amount, Treasury balance increased by fee', async () => {83 await usingApi(async (api) => {83 await usingApi(async (api) => {84 await skipInflationBlock(api);84 //await skipInflationBlock(api);85 await waitNewBlocks(api, 1);85 await waitNewBlocks(api, 1);868687 const alicePrivateKey = privateKey('//Alice');87 const alicePrivateKey = privateKey('//Alice');104104105 it('Treasury balance increased by failed tx fee', async () => {105 it('Treasury balance increased by failed tx fee', async () => {106 await usingApi(async (api) => {106 await usingApi(async (api) => {107 await skipInflationBlock(api);107 //await skipInflationBlock(api);108 await waitNewBlocks(api, 1);108 await waitNewBlocks(api, 1);109109110 const bobPrivateKey = privateKey('//Bob');110 const bobPrivateKey = privateKey('//Bob');125125126 it('NFT Transactions also send fees to Treasury', async () => {126 it('NFT Transactions also send fees to Treasury', async () => {127 await usingApi(async (api) => {127 await usingApi(async (api) => {128 await skipInflationBlock(api);128 //await skipInflationBlock(api);129 await waitNewBlocks(api, 1);129 await waitNewBlocks(api, 1);130130131 const treasuryBalanceBefore = (await api.query.system.account(TREASURY)).data.free.toBigInt();131 const treasuryBalanceBefore = (await api.query.system.account(TREASURY)).data.free.toBigInt();144144145 it('Fees are sane', async () => {145 it('Fees are sane', async () => {146 await usingApi(async (api) => {146 await usingApi(async (api) => {147 await skipInflationBlock(api);147 //await skipInflationBlock(api);148 await waitNewBlocks(api, 1);148 await waitNewBlocks(api, 1);149149150 const aliceBalanceBefore: bigint = (await api.query.system.account(alicesPublicKey)).data.free.toBigInt();150 const aliceBalanceBefore: bigint = (await api.query.system.account(alicesPublicKey)).data.free.toBigInt();161161162 it('NFT Transfer fee is close to 0.1 Unique', async () => {162 it('NFT Transfer fee is close to 0.1 Unique', async () => {163 await usingApi(async (api) => {163 await usingApi(async (api) => {164 await skipInflationBlock(api);164 //await skipInflationBlock(api);165 await waitNewBlocks(api, 1);165 await waitNewBlocks(api, 1);166166167 const collectionId = await createCollectionExpectSuccess();167 const collectionId = await createCollectionExpectSuccess();tests/src/inflation.test.tsdiffbeforeafterboth10chai.use(chaiAsPromised);10chai.use(chaiAsPromised);11const expect = chai.expect;11const expect = chai.expect;121213describe('integration test: Inflation', () => {13describe.skip('integration test: Inflation', () => {14 it('First year inflation is 10%', async () => {14 it('First year inflation is 10%', async () => {15 await usingApi(async (api) => {15 await usingApi(async (api) => {1616tests/src/pallet-presence.test.tsdiffbeforeafterboth34 'polkadotxcm',34 'polkadotxcm',35 'cumulusxcm',35 'cumulusxcm',36 'dmpqueue',36 'dmpqueue',37 'inflation',37 //'inflation',38 'unique',38 'unique',39 'nonfungible',39 'nonfungible',40 'refungible',40 'refungible',