difftreelog
temporary disable inflation pallet
in: master
7 files changed
Cargo.lockdiffbeforeafterboth--- a/Cargo.lock
+++ b/Cargo.lock
@@ -11690,7 +11690,6 @@
"pallet-evm-migration",
"pallet-evm-transaction-payment",
"pallet-fungible",
- "pallet-inflation",
"pallet-nonfungible",
"pallet-randomness-collective-flip",
"pallet-refungible",
runtime/Cargo.tomldiffbeforeafterboth--- a/runtime/Cargo.toml
+++ b/runtime/Cargo.toml
@@ -33,7 +33,7 @@
'pallet-refungible/runtime-benchmarks',
'pallet-nonfungible/runtime-benchmarks',
'pallet-unique/runtime-benchmarks',
- 'pallet-inflation/runtime-benchmarks',
+# 'pallet-inflation/runtime-benchmarks',
'pallet-xcm/runtime-benchmarks',
'sp-runtime/runtime-benchmarks',
'xcm-builder/runtime-benchmarks',
@@ -75,7 +75,7 @@
'fp-self-contained/std',
'parachain-info/std',
'serde',
- 'pallet-inflation/std',
+# 'pallet-inflation/std',
'pallet-common/std',
'pallet-fungible/std',
'pallet-refungible/std',
@@ -379,7 +379,7 @@
pallet-unique = { path = '../pallets/unique', default-features = false }
up-rpc = { path = "../primitives/rpc", default-features = false }
up-evm-mapping = { path = "../primitives/evm-mapping", default-features = false }
-pallet-inflation = { path = '../pallets/inflation', default-features = false }
+# pallet-inflation = { path = '../pallets/inflation', default-features = false }
up-data-structs = { path = '../primitives/data-structs', default-features = false }
pallet-common = { default-features = false, path = "../pallets/common" }
pallet-fungible = { default-features = false, path = "../pallets/fungible" }
runtime/src/lib.rsdiffbeforeafterboth--- a/runtime/src/lib.rs
+++ b/runtime/src/lib.rs
@@ -784,17 +784,17 @@
type Event = Event;
type WeightInfo = pallet_unique::weights::SubstrateWeight<Self>;
}
-
+/*
parameter_types! {
pub const InflationBlockInterval: BlockNumber = 100; // every time per how many blocks inflation is applied
-}
+} */
/// Used for the pallet inflation
-impl pallet_inflation::Config for Runtime {
+/* impl pallet_inflation::Config for Runtime {
type Currency = Balances;
type TreasuryAccountId = TreasuryAccountId;
type InflationBlockInterval = InflationBlockInterval;
-}
+} */
// parameter_types! {
// pub MaximumSchedulerWeight: Weight = Perbill::from_percent(50) *
@@ -881,7 +881,7 @@
DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 53,
// Unique Pallets
- Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,
+ // Inflation: pallet_inflation::{Pallet, Call, Storage} = 60,
Unique: pallet_unique::{Pallet, Call, Storage, Event<T>} = 61,
// Scheduler: pallet_unq_scheduler::{Pallet, Call, Storage, Event<T>} = 62,
// free = 63
@@ -1366,7 +1366,7 @@
list_benchmark!(list, extra, pallet_evm_migration, EvmMigration);
list_benchmark!(list, extra, pallet_unique, Unique);
- list_benchmark!(list, extra, pallet_inflation, Inflation);
+ //list_benchmark!(list, extra, pallet_inflation, Inflation);
list_benchmark!(list, extra, pallet_fungible, Fungible);
list_benchmark!(list, extra, pallet_refungible, Refungible);
list_benchmark!(list, extra, pallet_nonfungible, Nonfungible);
@@ -1400,7 +1400,7 @@
add_benchmark!(params, batches, pallet_evm_migration, EvmMigration);
add_benchmark!(params, batches, pallet_unique, Unique);
- add_benchmark!(params, batches, pallet_inflation, Inflation);
+ //add_benchmark!(params, batches, pallet_inflation, Inflation);
add_benchmark!(params, batches, pallet_fungible, Fungible);
add_benchmark!(params, batches, pallet_refungible, Refungible);
add_benchmark!(params, batches, pallet_nonfungible, Nonfungible);
tests/src/creditFeesToTreasury.test.tsdiffbeforeafterboth--- a/tests/src/creditFeesToTreasury.test.ts
+++ b/tests/src/creditFeesToTreasury.test.ts
@@ -34,7 +34,7 @@
// Skip the inflation block pauses if the block is close to inflation block
// until the inflation happens
/*eslint no-async-promise-executor: "off"*/
-function skipInflationBlock(api: ApiPromise): Promise<void> {
+/*function skipInflationBlock(api: ApiPromise): Promise<void> {
const promise = new Promise<void>(async (resolve) => {
const blockInterval = (await api.consts.inflation.inflationBlockInterval).toNumber();
const unsubscribe = await api.rpc.chain.subscribeNewHeads(head => {
@@ -49,7 +49,7 @@
});
return promise;
-}
+}*/
describe('integration test: Fees must be credited to Treasury:', () => {
before(async () => {
@@ -61,7 +61,7 @@
it('Total issuance does not change', async () => {
await usingApi(async (api) => {
- await skipInflationBlock(api);
+ //await skipInflationBlock(api);
await waitNewBlocks(api, 1);
const totalBefore = (await api.query.balances.totalIssuance()).toBigInt();
@@ -81,7 +81,7 @@
it('Sender balance decreased by fee+sent amount, Treasury balance increased by fee', async () => {
await usingApi(async (api) => {
- await skipInflationBlock(api);
+ //await skipInflationBlock(api);
await waitNewBlocks(api, 1);
const alicePrivateKey = privateKey('//Alice');
@@ -104,7 +104,7 @@
it('Treasury balance increased by failed tx fee', async () => {
await usingApi(async (api) => {
- await skipInflationBlock(api);
+ //await skipInflationBlock(api);
await waitNewBlocks(api, 1);
const bobPrivateKey = privateKey('//Bob');
@@ -125,7 +125,7 @@
it('NFT Transactions also send fees to Treasury', async () => {
await usingApi(async (api) => {
- await skipInflationBlock(api);
+ //await skipInflationBlock(api);
await waitNewBlocks(api, 1);
const treasuryBalanceBefore = (await api.query.system.account(TREASURY)).data.free.toBigInt();
@@ -144,7 +144,7 @@
it('Fees are sane', async () => {
await usingApi(async (api) => {
- await skipInflationBlock(api);
+ //await skipInflationBlock(api);
await waitNewBlocks(api, 1);
const aliceBalanceBefore: bigint = (await api.query.system.account(alicesPublicKey)).data.free.toBigInt();
@@ -161,7 +161,7 @@
it('NFT Transfer fee is close to 0.1 Unique', async () => {
await usingApi(async (api) => {
- await skipInflationBlock(api);
+ //await skipInflationBlock(api);
await waitNewBlocks(api, 1);
const collectionId = await createCollectionExpectSuccess();
tests/src/inflation.test.tsdiffbeforeafterboth--- a/tests/src/inflation.test.ts
+++ b/tests/src/inflation.test.ts
@@ -10,7 +10,7 @@
chai.use(chaiAsPromised);
const expect = chai.expect;
-describe('integration test: Inflation', () => {
+describe.skip('integration test: Inflation', () => {
it('First year inflation is 10%', async () => {
await usingApi(async (api) => {
tests/src/pallet-presence.test.tsdiffbeforeafterboth--- a/tests/src/pallet-presence.test.ts
+++ b/tests/src/pallet-presence.test.ts
@@ -34,7 +34,7 @@
'polkadotxcm',
'cumulusxcm',
'dmpqueue',
- 'inflation',
+ //'inflation',
'unique',
'nonfungible',
'refungible',
tests/src/setOffchainSchema.test.tsdiffbeforeafterboth1//2// This file is subject to the terms and conditions defined in3// file 'LICENSE', which is part of this source code package.4//56import {IKeyringPair} from '@polkadot/types/types';7import chai from 'chai';8import chaiAsPromised from 'chai-as-promised';9import privateKey from './substrate/privateKey';10import usingApi from './substrate/substrate-api';11import {12 createCollectionExpectSuccess,13 destroyCollectionExpectSuccess,14 findNotExistingCollection,15 queryCollectionExpectSuccess,16 setOffchainSchemaExpectFailure,17 setOffchainSchemaExpectSuccess,18 addCollectionAdminExpectSuccess,19} from './util/helpers';2021chai.use(chaiAsPromised);22const expect = chai.expect;2324const DATA = [1, 2, 3, 4];2526describe('Integration Test setOffchainSchema', () => {27 let alice: IKeyringPair;28 let bob: IKeyringPair;2930 before(async () => {31 await usingApi(async () => {32 alice = privateKey('//Alice');33 bob = privateKey('//Bob');34 });35 });3637 it('execute setOffchainSchema, verify data was set', async () => {38 await usingApi(async api => {39 const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});40 await setOffchainSchemaExpectSuccess(alice, collectionId, DATA);41 const collection = await queryCollectionExpectSuccess(api, collectionId);4243 expect('0x' + Buffer.from(collection.offchainSchema).toString('hex')).to.be.equal('0x' + Buffer.from(DATA).toString('hex'));44 });45 });4647 it('execute setOffchainSchema (collection admin), verify data was set', async () => {48 await usingApi(async api => {49 const collectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});50 await addCollectionAdminExpectSuccess(alice, collectionId, bob.address);51 await setOffchainSchemaExpectSuccess(bob, collectionId, DATA);52 const collection = await queryCollectionExpectSuccess(api, collectionId);5354 expect('0x' + Buffer.from(collection.offchainSchema).toString('hex')).to.be.equal('0x' + Buffer.from(DATA).toString('hex'));55 });56 });57});5859describe('Negative Integration Test setOffchainSchema', () => {60 let alice: IKeyringPair;61 let bob: IKeyringPair;6263 let validCollectionId: number;6465 before(async () => {66 await usingApi(async () => {67 alice = privateKey('//Alice');68 bob = privateKey('//Bob');6970 validCollectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});71 });72 });7374 it('fails on not existing collection id', async () => {75 const nonExistingCollectionId = await usingApi(findNotExistingCollection);7677 await setOffchainSchemaExpectFailure(alice, nonExistingCollectionId, DATA);78 });7980 it('fails on destroyed collection id', async () => {81 const destroyedCollectionId = await createCollectionExpectSuccess({mode: {type: 'NFT'}});82 await destroyCollectionExpectSuccess(destroyedCollectionId);8384 await setOffchainSchemaExpectFailure(alice, destroyedCollectionId, DATA);85 });8687 it.only('fails on too long data', async () => {88 const tooLongData = new Array(8 * 1024 + 10).fill(0xff);8990 await setOffchainSchemaExpectFailure(alice, validCollectionId, tooLongData);91 });9293 it('fails on execution by non-owner', async () => {94 await setOffchainSchemaExpectFailure(bob, validCollectionId, DATA);95 });96});