difftreelog
refactor Rename module in extrinsic
in: master
13 files changed
primitives/app_promotion_rpc/src/lib.rsdiffbeforeafterboth--- a/primitives/app_promotion_rpc/src/lib.rs
+++ b/primitives/app_promotion_rpc/src/lib.rs
@@ -16,11 +16,6 @@
#![cfg_attr(not(feature = "std"), no_std)]
-use up_data_structs::{
- CollectionId, TokenId, RpcCollection, CollectionStats, CollectionLimits, Property,
- PropertyKeyPermission, TokenData, TokenChild,
-};
-
use sp_std::vec::Vec;
use codec::Decode;
use sp_runtime::{
runtime/common/construct_runtime/mod.rsdiffbeforeafterboth--- a/runtime/common/construct_runtime/mod.rs
+++ b/runtime/common/construct_runtime/mod.rs
@@ -78,7 +78,7 @@
RmrkEquip: pallet_proxy_rmrk_equip::{Pallet, Call, Storage, Event<T>} = 72,
#[runtimes(opal)]
- Promotion: pallet_app_promotion::{Pallet, Call, Storage, Event<T>} = 73,
+ AppPromotion: pallet_app_promotion::{Pallet, Call, Storage, Event<T>} = 73,
// Frontier
EVM: pallet_evm::{Pallet, Config, Call, Storage, Event<T>} = 100,
tests/src/app-promotion.test.tsdiffbeforeafterboth--- a/tests/src/app-promotion.test.ts
+++ b/tests/src/app-promotion.test.ts
@@ -38,29 +38,20 @@
const palletAddress = calculatePalleteAddress('appstake');
let accounts: IKeyringPair[] = [];
-before(async function () {
- await usingPlaygrounds(async (helper, privateKeyWrapper) => {
- if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip();
- alice = privateKeyWrapper('//Alice');
- palletAdmin = privateKeyWrapper('//Charlie'); // TODO use custom address
- await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: palletAdmin.address})));
- nominal = helper.balance.getOneTokenNominal();
- await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal);
- await helper.balance.transferToSubstrate(alice, palletAddress, 1000n * nominal);
- if (!promotionStartBlock) {
- promotionStartBlock = (await helper.api!.query.parachainSystem.lastRelayChainBlockNumber()).toNumber();
- }
- await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.startAppPromotion(promotionStartBlock!)));
- accounts = await helper.arrange.createCrowd(100, 1000n, alice); // create accounts-pool to speed up tests
- });
-});
-
-after(async function () {
- await usingPlaygrounds(async (helper) => {
+describe('app-promotions.stake extrinsic', () => {
+ before(async function () {
+ await usingPlaygrounds(async (helper, privateKeyWrapper) => {
+ if (!getModuleNames(helper.api!).includes(Pallets.AppPromotion)) this.skip();
+ alice = privateKeyWrapper('//Alice');
+ palletAdmin = privateKeyWrapper('//Charlie'); // TODO use custom address
+ await helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})));
+ nominal = helper.balance.getOneTokenNominal();
+ await helper.balance.transferToSubstrate(alice, palletAdmin.address, 1000n * nominal);
+ await helper.balance.transferToSubstrate(alice, palletAddress, 1000n * nominal);
+ accounts = await helper.arrange.createCrowd(100, 1000n, alice); // create accounts-pool to speed up tests
+ });
});
-});
-describe('app-promotions.stake extrinsic', () => {
it('should "lock" staking balance, add it to "staked" map, and increase "totalStaked" amount', async () => {
await usingPlaygrounds(async (helper) => {
const [staker, recepient] = [accounts.pop()!, accounts.pop()!];
@@ -264,11 +255,11 @@
await usingPlaygrounds(async (helper) => {
const nonAdmin = accounts.pop()!;
// nonAdmin can not set admin not from himself nor as a sudo
- await expect(helper.signTransaction(nonAdmin, helper.api!.tx.promotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.eventually.rejected;
- await expect(helper.signTransaction(nonAdmin, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.eventually.rejected;
+ await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address}))).to.be.eventually.rejected;
+ await expect(helper.signTransaction(nonAdmin, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: nonAdmin.address})))).to.be.eventually.rejected;
// Alice can
- await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled;
});
});
@@ -279,12 +270,12 @@
const account = accounts.pop()!;
const ethAccount = helper.address.substrateToEth(account.address);
// Alice sets Ethereum address as a sudo. Then Substrate address back...
- await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Ethereum: ethAccount})))).to.be.eventually.fulfilled;
- await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Ethereum: ethAccount})))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address})))).to.be.eventually.fulfilled;
// ...It doesn't break anything;
const collection = await helper.nft.mintCollection(account, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
- await expect(helper.signTransaction(account, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
+ await expect(helper.signTransaction(account, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
});
});
@@ -293,11 +284,11 @@
const [oldAdmin, newAdmin, collectionOwner] = [accounts.pop()!, accounts.pop()!, accounts.pop()!];
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
- await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(oldAdmin))))).to.be.eventually.fulfilled;
- await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress(normalizeAccountId(newAdmin))))).to.be.eventually.fulfilled;
- await expect(helper.signTransaction(oldAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(oldAdmin))))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(alice, helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress(normalizeAccountId(newAdmin))))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(oldAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
- await expect(helper.signTransaction(newAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(newAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled;
});
});
});
@@ -305,7 +296,7 @@
describe('App-promotion collection sponsoring', () => {
before(async function () {
await usingPlaygrounds(async (helper) => {
- const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.promotion.setAdminAddress({Substrate: palletAdmin.address}));
+ const tx = helper.api!.tx.sudo.sudo(helper.api!.tx.appPromotion.setAdminAddress({Substrate: palletAdmin.address}));
await helper.signTransaction(alice, tx);
});
});
@@ -315,7 +306,7 @@
const [collectionOwner, tokenSender, receiver] = [accounts.pop()!, accounts.pop()!, accounts.pop()!];
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'Name', description: 'Description', tokenPrefix: 'Prefix', limits: {sponsorTransferTimeout: 0}});
const token = await collection.mintToken(collectionOwner, {Substrate: tokenSender.address});
- await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId));
+ await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId));
const palletBalanceBefore = await helper.balance.getSubstrate(palletAddress);
await token.transfer(tokenSender, {Substrate: receiver.address});
@@ -334,7 +325,7 @@
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
- await expect(helper.signTransaction(nonAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
+ await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
expect((await collection.getData())?.raw.sponsorship).to.equal('Disabled');
});
});
@@ -345,19 +336,19 @@
// Can set sponsoring for collection without sponsor
const collectionWithoutSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'No-sponsor', description: 'New Collection', tokenPrefix: 'Promotion'});
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionWithoutSponsor.collectionId))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithoutSponsor.collectionId))).to.be.eventually.fulfilled;
expect((await collectionWithoutSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
// Can set sponsoring for collection with unconfirmed sponsor
const collectionWithUnconfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Unconfirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address});
expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Unconfirmed: oldSponsor.address});
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithUnconfirmedSponsor.collectionId))).to.be.eventually.fulfilled;
expect((await collectionWithUnconfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
// Can set sponsoring for collection with confirmed sponsor
const collectionWithConfirmedSponsor = await helper.nft.mintCollection(collectionOwner, {name: 'Confirmed', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: oldSponsor.address});
await collectionWithConfirmedSponsor.confirmSponsorship(oldSponsor);
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithConfirmedSponsor.collectionId))).to.be.eventually.fulfilled;
expect((await collectionWithConfirmedSponsor.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
});
});
@@ -368,7 +359,7 @@
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
const collectionId = collection.collectionId;
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionId))).to.be.eventually.fulfilled;
// Collection limits still can be changed by the owner
expect(await collection.setLimits(collectionOwner, {sponsorTransferTimeout: 0})).to.be.true;
@@ -386,7 +377,7 @@
const limits = {ownerCanDestroy: true, ownerCanTransfer: true, sponsorTransferTimeout: 0};
const collectionWithLimits = await helper.nft.mintCollection(alice, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits});
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collectionWithLimits.collectionId))).to.be.eventually.fulfilled;
expect((await collectionWithLimits.getData())?.raw.limits).to.be.deep.contain(limits);
});
});
@@ -396,12 +387,12 @@
const collectionOwner = accounts.pop()!;
// collection has never existed
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(999999999))).to.be.eventually.rejected;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(999999999))).to.be.eventually.rejected;
// collection has been burned
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
await collection.burn(collectionOwner);
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.rejected;
});
});
});
@@ -412,9 +403,9 @@
const [collectionOwner, nonAdmin] = [accounts.pop()!, accounts.pop()!];
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId))).to.be.eventually.fulfilled;
- await expect(helper.signTransaction(nonAdmin, helper.api!.tx.promotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected;
+ await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected;
expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: palletAddress});
});
});
@@ -425,8 +416,8 @@
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', limits: {sponsorTransferTimeout: 0}});
const token = await collection.mintToken(collectionOwner, {Substrate: collectionOwner.address});
- await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.sponsorCollection(collection.collectionId));
- await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsoringCollection(collection.collectionId));
+ await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.sponsorCollection(collection.collectionId));
+ await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId));
expect((await collection.getData())?.raw.sponsorship).to.be.equal('Disabled');
@@ -444,7 +435,7 @@
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion', pendingSponsor: collectionOwner.address});
await collection.confirmSponsorship(collectionOwner);
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected;
expect((await collection.getData())?.raw.sponsorship).to.be.deep.equal({Confirmed: collectionOwner.address});
});
@@ -456,8 +447,8 @@
const collection = await helper.nft.mintCollection(collectionOwner, {name: 'New', description: 'New Collection', tokenPrefix: 'Promotion'});
await collection.burn(collectionOwner);
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected;
- await expect(helper.signTransaction(palletAdmin, helper.api!.tx.promotion.stopSponsoringCollection(999999999))).to.be.eventually.rejected;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(collection.collectionId))).to.be.eventually.rejected;
+ await expect(helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.stopSponsoringCollection(999999999))).to.be.eventually.rejected;
});
});
});
@@ -469,7 +460,7 @@
const flipper = await deployFlipper(web3, contractOwner);
const contractMethods = contractHelpers(web3, contractOwner);
- await helper.signTransaction(palletAdmin, api.tx.promotion.sponsorConract(flipper.options.address));
+ await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address));
expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true;
expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
@@ -497,7 +488,7 @@
});
// set promotion sponsoring
- await helper.signTransaction(palletAdmin, api.tx.promotion.sponsorConract(flipper.options.address));
+ await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address));
// new sponsor is pallet address
expect(await contractMethods.methods.hasSponsor(flipper.options.address).call()).to.be.true;
@@ -517,7 +508,7 @@
const contractMethods = contractHelpers(web3, contractOwner);
// contract sponsored by pallet
- await helper.signTransaction(palletAdmin, api.tx.promotion.sponsorConract(flipper.options.address));
+ await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address));
// owner sets self sponsoring
await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected;
@@ -542,7 +533,7 @@
await expect(contractMethods.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected;
// nonAdmin calls sponsorConract
- await expect(helper.signTransaction(nonAdmin, api.tx.promotion.sponsorConract(flipper.options.address))).to.be.rejected;
+ await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address))).to.be.rejected;
// contract still self-sponsored
expect((await api.query.evmContractHelpers.sponsoring(flipper.options.address)).toJSON()).to.deep.equal({
@@ -569,7 +560,7 @@
await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner});
await transferBalanceToEth(api, alice, flipper.options.address, 1000n);
- await helper.signTransaction(palletAdmin, api.tx.promotion.sponsorConract(flipper.options.address));
+ await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address));
await flipper.methods.flip().send({from: caller});
expect(await flipper.methods.getValue().call()).to.be.true;
@@ -591,8 +582,8 @@
await transferBalanceToEth(api, alice, flipper.options.address);
const contractHelper = contractHelpers(web3, contractOwner);
await contractHelper.methods.setSponsoringMode(flipper.options.address, SponsoringMode.Generous).send({from: contractOwner});
- await helper.signTransaction(palletAdmin, api.tx.promotion.sponsorConract(flipper.options.address));
- await helper.signTransaction(palletAdmin, api.tx.promotion.stopSponsoringContract(flipper.options.address));
+ await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address));
+ await helper.signTransaction(palletAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address));
expect(await contractHelper.methods.hasSponsor(flipper.options.address).call()).to.be.false;
expect((await api.query.evmContractHelpers.owner(flipper.options.address)).toJSON()).to.be.equal(contractOwner);
@@ -618,8 +609,8 @@
const contractOwner = (await createEthAccountWithBalance(api, web3, privateKeyWrapper)).toLowerCase();
const flipper = await deployFlipper(web3, contractOwner);
- await helper.signTransaction(palletAdmin, api.tx.promotion.sponsorConract(flipper.options.address));
- await expect(helper.signTransaction(nonAdmin, api.tx.promotion.stopSponsoringContract(flipper.options.address))).to.be.rejected;
+ await helper.signTransaction(palletAdmin, api.tx.appPromotion.sponsorConract(flipper.options.address));
+ await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address))).to.be.rejected;
});
});
@@ -631,7 +622,7 @@
const contractHelper = contractHelpers(web3, contractOwner);
await expect(contractHelper.methods.selfSponsoredEnable(flipper.options.address).send()).to.be.not.rejected;
- await expect(helper.signTransaction(nonAdmin, api.tx.promotion.stopSponsoringContract(flipper.options.address))).to.be.rejected;
+ await expect(helper.signTransaction(nonAdmin, api.tx.appPromotion.stopSponsoringContract(flipper.options.address))).to.be.rejected;
});
});
});
@@ -640,7 +631,7 @@
it('can not be called by non admin', async () => {
await usingPlaygrounds(async (helper) => {
const nonAdmin = accounts.pop()!;
- await expect(helper.signTransaction(nonAdmin, helper.api!.tx.promotion.payoutStakers(100))).to.be.rejected;
+ await expect(helper.signTransaction(nonAdmin, helper.api!.tx.appPromotion.payoutStakers(100))).to.be.rejected;
});
});
@@ -652,7 +643,7 @@
await helper.staking.stake(staker, 100n * nominal);
await helper.staking.stake(staker, 200n * nominal);
await waitForRelayBlock(helper.api!, 30);
- await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(100));
+ await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
const totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]);
expect(totalStakedPerBlock).to.be.deep.equal([calculateIncome(100n * nominal, 10n), calculateIncome(200n * nominal, 10n)]);
@@ -668,7 +659,7 @@
await helper.staking.stake(staker, 200n * nominal);
await waitForRelayBlock(helper.api!, 55);
- await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(100));
+ await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
const stakedPerBlock = await helper.staking.getTotalStakedPerBlock({Substrate: staker.address});
expect(stakedPerBlock[0][1]).to.be.equal(calculateIncome(100n * nominal, 10n, 2));
expect(stakedPerBlock[1][1]).to.be.equal(calculateIncome(200n * nominal, 10n, 2));
@@ -707,12 +698,12 @@
await helper.staking.stake(staker, 300n * nominal);
await waitForRelayBlock(helper.api!, 34);
- await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(100));
+ await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
let totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]);
expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n), calculateIncome(200n * nominal, 10n), calculateIncome(300n * nominal, 10n)]);
await waitForRelayBlock(helper.api!, 20);
- await helper.signTransaction(palletAdmin, helper.api!.tx.promotion.payoutStakers(100));
+ await helper.signTransaction(palletAdmin, helper.api!.tx.appPromotion.payoutStakers(100));
totalStakedPerBlock = (await helper.staking.getTotalStakedPerBlock({Substrate: staker.address})).map(s => s[1]);
expect(totalStakedPerBlock).to.deep.equal([calculateIncome(100n * nominal, 10n, 2), calculateIncome(200n * nominal, 10n, 2), calculateIncome(300n * nominal, 10n, 2)]);
});
tests/src/interfaces/augment-api-consts.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-consts.ts
+++ b/tests/src/interfaces/augment-api-consts.ts
@@ -15,6 +15,30 @@
declare module '@polkadot/api-base/types/consts' {
interface AugmentedConsts<ApiType extends ApiTypes> {
+ appPromotion: {
+ /**
+ * In chain blocks.
+ **/
+ day: u32 & AugmentedConst<ApiType>;
+ intervalIncome: Perbill & AugmentedConst<ApiType>;
+ nominal: u128 & AugmentedConst<ApiType>;
+ /**
+ * The app's pallet id, used for deriving its sovereign account ID.
+ **/
+ palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
+ /**
+ * In relay blocks.
+ **/
+ pendingInterval: u32 & AugmentedConst<ApiType>;
+ /**
+ * In relay blocks.
+ **/
+ recalculationInterval: u32 & AugmentedConst<ApiType>;
+ /**
+ * Generic const
+ **/
+ [key: string]: Codec;
+ };
balances: {
/**
* The minimum amount required to keep an account open.
@@ -61,30 +85,6 @@
* Number of blocks that pass between treasury balance updates due to inflation
**/
inflationBlockInterval: u32 & AugmentedConst<ApiType>;
- /**
- * Generic const
- **/
- [key: string]: Codec;
- };
- promotion: {
- /**
- * In chain blocks.
- **/
- day: u32 & AugmentedConst<ApiType>;
- intervalIncome: Perbill & AugmentedConst<ApiType>;
- nominal: u128 & AugmentedConst<ApiType>;
- /**
- * The app's pallet id, used for deriving its sovereign account ID.
- **/
- palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
- /**
- * In relay blocks.
- **/
- pendingInterval: u32 & AugmentedConst<ApiType>;
- /**
- * In relay blocks.
- **/
- recalculationInterval: u32 & AugmentedConst<ApiType>;
/**
* Generic const
**/
tests/src/interfaces/augment-api-errors.tsdiffbeforeafterboth1// Auto-generated via `yarn polkadot-types-from-chain`, do not edit2/* eslint-disable */34// import type lookup before we augment - in some environments5// this is required to allow for ambient/previous definitions6import '@polkadot/api-base/types/errors';78import type { ApiTypes, AugmentedError } from '@polkadot/api-base/types';910export type __AugmentedError<ApiType extends ApiTypes> = AugmentedError<ApiType>;1112declare module '@polkadot/api-base/types/errors' {13 interface AugmentedErrors<ApiType extends ApiTypes> {14 balances: {15 /**16 * Beneficiary account must pre-exist17 **/18 DeadAccount: AugmentedError<ApiType>;19 /**20 * Value too low to create account due to existential deposit21 **/22 ExistentialDeposit: AugmentedError<ApiType>;23 /**24 * A vesting schedule already exists for this account25 **/26 ExistingVestingSchedule: AugmentedError<ApiType>;27 /**28 * Balance too low to send value29 **/30 InsufficientBalance: AugmentedError<ApiType>;31 /**32 * Transfer/payment would kill account33 **/34 KeepAlive: AugmentedError<ApiType>;35 /**36 * Account liquidity restrictions prevent withdrawal37 **/38 LiquidityRestrictions: AugmentedError<ApiType>;39 /**40 * Number of named reserves exceed MaxReserves41 **/42 TooManyReserves: AugmentedError<ApiType>;43 /**44 * Vesting balance too high to send value45 **/46 VestingBalance: AugmentedError<ApiType>;47 /**48 * Generic error49 **/50 [key: string]: AugmentedError<ApiType>;51 };52 common: {53 /**54 * Account token limit exceeded per collection55 **/56 AccountTokenLimitExceeded: AugmentedError<ApiType>;57 /**58 * Can't transfer tokens to ethereum zero address59 **/60 AddressIsZero: AugmentedError<ApiType>;61 /**62 * Address is not in allow list.63 **/64 AddressNotInAllowlist: AugmentedError<ApiType>;65 /**66 * Requested value is more than the approved67 **/68 ApprovedValueTooLow: AugmentedError<ApiType>;69 /**70 * Tried to approve more than owned71 **/72 CantApproveMoreThanOwned: AugmentedError<ApiType>;73 /**74 * Destroying only empty collections is allowed75 **/76 CantDestroyNotEmptyCollection: AugmentedError<ApiType>;77 /**78 * Exceeded max admin count79 **/80 CollectionAdminCountExceeded: AugmentedError<ApiType>;81 /**82 * Collection description can not be longer than 255 char.83 **/84 CollectionDescriptionLimitExceeded: AugmentedError<ApiType>;85 /**86 * Tried to store more data than allowed in collection field87 **/88 CollectionFieldSizeExceeded: AugmentedError<ApiType>;89 /**90 * Tried to access an external collection with an internal API91 **/92 CollectionIsExternal: AugmentedError<ApiType>;93 /**94 * Tried to access an internal collection with an external API95 **/96 CollectionIsInternal: AugmentedError<ApiType>;97 /**98 * Collection limit bounds per collection exceeded99 **/100 CollectionLimitBoundsExceeded: AugmentedError<ApiType>;101 /**102 * Collection name can not be longer than 63 char.103 **/104 CollectionNameLimitExceeded: AugmentedError<ApiType>;105 /**106 * This collection does not exist.107 **/108 CollectionNotFound: AugmentedError<ApiType>;109 /**110 * Collection token limit exceeded111 **/112 CollectionTokenLimitExceeded: AugmentedError<ApiType>;113 /**114 * Token prefix can not be longer than 15 char.115 **/116 CollectionTokenPrefixLimitExceeded: AugmentedError<ApiType>;117 /**118 * Empty property keys are forbidden119 **/120 EmptyPropertyKey: AugmentedError<ApiType>;121 /**122 * Only ASCII letters, digits, and symbols `_`, `-`, and `.` are allowed123 **/124 InvalidCharacterInPropertyKey: AugmentedError<ApiType>;125 /**126 * Metadata flag frozen127 **/128 MetadataFlagFrozen: AugmentedError<ApiType>;129 /**130 * Sender parameter and item owner must be equal.131 **/132 MustBeTokenOwner: AugmentedError<ApiType>;133 /**134 * No permission to perform action135 **/136 NoPermission: AugmentedError<ApiType>;137 /**138 * Tried to store more property data than allowed139 **/140 NoSpaceForProperty: AugmentedError<ApiType>;141 /**142 * Insufficient funds to perform an action143 **/144 NotSufficientFounds: AugmentedError<ApiType>;145 /**146 * Tried to enable permissions which are only permitted to be disabled147 **/148 OwnerPermissionsCantBeReverted: AugmentedError<ApiType>;149 /**150 * Property key is too long151 **/152 PropertyKeyIsTooLong: AugmentedError<ApiType>;153 /**154 * Tried to store more property keys than allowed155 **/156 PropertyLimitReached: AugmentedError<ApiType>;157 /**158 * Collection is not in mint mode.159 **/160 PublicMintingNotAllowed: AugmentedError<ApiType>;161 /**162 * Only tokens from specific collections may nest tokens under this one163 **/164 SourceCollectionIsNotAllowedToNest: AugmentedError<ApiType>;165 /**166 * Item does not exist167 **/168 TokenNotFound: AugmentedError<ApiType>;169 /**170 * Item is balance not enough171 **/172 TokenValueTooLow: AugmentedError<ApiType>;173 /**174 * Total collections bound exceeded.175 **/176 TotalCollectionsLimitExceeded: AugmentedError<ApiType>;177 /**178 * Collection settings not allowing items transferring179 **/180 TransferNotAllowed: AugmentedError<ApiType>;181 /**182 * The operation is not supported183 **/184 UnsupportedOperation: AugmentedError<ApiType>;185 /**186 * User does not satisfy the nesting rule187 **/188 UserIsNotAllowedToNest: AugmentedError<ApiType>;189 /**190 * Generic error191 **/192 [key: string]: AugmentedError<ApiType>;193 };194 cumulusXcm: {195 /**196 * Generic error197 **/198 [key: string]: AugmentedError<ApiType>;199 };200 dmpQueue: {201 /**202 * The amount of weight given is possibly not enough for executing the message.203 **/204 OverLimit: AugmentedError<ApiType>;205 /**206 * The message index given is unknown.207 **/208 Unknown: AugmentedError<ApiType>;209 /**210 * Generic error211 **/212 [key: string]: AugmentedError<ApiType>;213 };214 ethereum: {215 /**216 * Signature is invalid.217 **/218 InvalidSignature: AugmentedError<ApiType>;219 /**220 * Pre-log is present, therefore transact is not allowed.221 **/222 PreLogExists: AugmentedError<ApiType>;223 /**224 * Generic error225 **/226 [key: string]: AugmentedError<ApiType>;227 };228 evm: {229 /**230 * Not enough balance to perform action231 **/232 BalanceLow: AugmentedError<ApiType>;233 /**234 * Calculating total fee overflowed235 **/236 FeeOverflow: AugmentedError<ApiType>;237 /**238 * Gas price is too low.239 **/240 GasPriceTooLow: AugmentedError<ApiType>;241 /**242 * Nonce is invalid243 **/244 InvalidNonce: AugmentedError<ApiType>;245 /**246 * Calculating total payment overflowed247 **/248 PaymentOverflow: AugmentedError<ApiType>;249 /**250 * Withdraw fee failed251 **/252 WithdrawFailed: AugmentedError<ApiType>;253 /**254 * Generic error255 **/256 [key: string]: AugmentedError<ApiType>;257 };258 evmCoderSubstrate: {259 OutOfFund: AugmentedError<ApiType>;260 OutOfGas: AugmentedError<ApiType>;261 /**262 * Generic error263 **/264 [key: string]: AugmentedError<ApiType>;265 };266 evmContractHelpers: {267 /**268 * No pending sponsor for contract.269 **/270 NoPendingSponsor: AugmentedError<ApiType>;271 /**272 * This method is only executable by contract owner273 **/274 NoPermission: AugmentedError<ApiType>;275 /**276 * Generic error277 **/278 [key: string]: AugmentedError<ApiType>;279 };280 evmMigration: {281 /**282 * Migration of this account is not yet started, or already finished.283 **/284 AccountIsNotMigrating: AugmentedError<ApiType>;285 /**286 * Can only migrate to empty address.287 **/288 AccountNotEmpty: AugmentedError<ApiType>;289 /**290 * Generic error291 **/292 [key: string]: AugmentedError<ApiType>;293 };294 fungible: {295 /**296 * Fungible token does not support nesting.297 **/298 FungibleDisallowsNesting: AugmentedError<ApiType>;299 /**300 * Tried to set data for fungible item.301 **/302 FungibleItemsDontHaveData: AugmentedError<ApiType>;303 /**304 * Fungible tokens hold no ID, and the default value of TokenId for Fungible collection is 0.305 **/306 FungibleItemsHaveNoId: AugmentedError<ApiType>;307 /**308 * Not Fungible item data used to mint in Fungible collection.309 **/310 NotFungibleDataUsedToMintFungibleCollectionToken: AugmentedError<ApiType>;311 /**312 * Setting item properties is not allowed.313 **/314 SettingPropertiesNotAllowed: AugmentedError<ApiType>;315 /**316 * Generic error317 **/318 [key: string]: AugmentedError<ApiType>;319 };320 nonfungible: {321 /**322 * Unable to burn NFT with children323 **/324 CantBurnNftWithChildren: AugmentedError<ApiType>;325 /**326 * Used amount > 1 with NFT327 **/328 NonfungibleItemsHaveNoAmount: AugmentedError<ApiType>;329 /**330 * Not Nonfungible item data used to mint in Nonfungible collection.331 **/332 NotNonfungibleDataUsedToMintFungibleCollectionToken: AugmentedError<ApiType>;333 /**334 * Generic error335 **/336 [key: string]: AugmentedError<ApiType>;337 };338 parachainSystem: {339 /**340 * The inherent which supplies the host configuration did not run this block341 **/342 HostConfigurationNotAvailable: AugmentedError<ApiType>;343 /**344 * No code upgrade has been authorized.345 **/346 NothingAuthorized: AugmentedError<ApiType>;347 /**348 * No validation function upgrade is currently scheduled.349 **/350 NotScheduled: AugmentedError<ApiType>;351 /**352 * Attempt to upgrade validation function while existing upgrade pending353 **/354 OverlappingUpgrades: AugmentedError<ApiType>;355 /**356 * Polkadot currently prohibits this parachain from upgrading its validation function357 **/358 ProhibitedByPolkadot: AugmentedError<ApiType>;359 /**360 * The supplied validation function has compiled into a blob larger than Polkadot is361 * willing to run362 **/363 TooBig: AugmentedError<ApiType>;364 /**365 * The given code upgrade has not been authorized.366 **/367 Unauthorized: AugmentedError<ApiType>;368 /**369 * The inherent which supplies the validation data did not run this block370 **/371 ValidationDataNotAvailable: AugmentedError<ApiType>;372 /**373 * Generic error374 **/375 [key: string]: AugmentedError<ApiType>;376 };377 polkadotXcm: {378 /**379 * The location is invalid since it already has a subscription from us.380 **/381 AlreadySubscribed: AugmentedError<ApiType>;382 /**383 * The given location could not be used (e.g. because it cannot be expressed in the384 * desired version of XCM).385 **/386 BadLocation: AugmentedError<ApiType>;387 /**388 * The version of the `Versioned` value used is not able to be interpreted.389 **/390 BadVersion: AugmentedError<ApiType>;391 /**392 * Could not re-anchor the assets to declare the fees for the destination chain.393 **/394 CannotReanchor: AugmentedError<ApiType>;395 /**396 * The destination `MultiLocation` provided cannot be inverted.397 **/398 DestinationNotInvertible: AugmentedError<ApiType>;399 /**400 * The assets to be sent are empty.401 **/402 Empty: AugmentedError<ApiType>;403 /**404 * The message execution fails the filter.405 **/406 Filtered: AugmentedError<ApiType>;407 /**408 * Origin is invalid for sending.409 **/410 InvalidOrigin: AugmentedError<ApiType>;411 /**412 * The referenced subscription could not be found.413 **/414 NoSubscription: AugmentedError<ApiType>;415 /**416 * There was some other issue (i.e. not to do with routing) in sending the message. Perhaps417 * a lack of space for buffering the message.418 **/419 SendFailure: AugmentedError<ApiType>;420 /**421 * Too many assets have been attempted for transfer.422 **/423 TooManyAssets: AugmentedError<ApiType>;424 /**425 * The desired destination was unreachable, generally because there is a no way of routing426 * to it.427 **/428 Unreachable: AugmentedError<ApiType>;429 /**430 * The message's weight could not be determined.431 **/432 UnweighableMessage: AugmentedError<ApiType>;433 /**434 * Generic error435 **/436 [key: string]: AugmentedError<ApiType>;437 };438 promotion: {439 /**440 * Error due to action requiring admin to be set441 **/442 AdminNotSet: AugmentedError<ApiType>;443 /**444 * An error related to the fact that an invalid argument was passed to perform an action445 **/446 InvalidArgument: AugmentedError<ApiType>;447 /**448 * No permission to perform an action449 **/450 NoPermission: AugmentedError<ApiType>;451 /**452 * Insufficient funds to perform an action453 **/454 NotSufficientFounds: AugmentedError<ApiType>;455 /**456 * Generic error457 **/458 [key: string]: AugmentedError<ApiType>;459 };460 refungible: {461 /**462 * Not Refungible item data used to mint in Refungible collection.463 **/464 NotRefungibleDataUsedToMintFungibleCollectionToken: AugmentedError<ApiType>;465 /**466 * Refungible token can't nest other tokens.467 **/468 RefungibleDisallowsNesting: AugmentedError<ApiType>;469 /**470 * Refungible token can't be repartitioned by user who isn't owns all pieces.471 **/472 RepartitionWhileNotOwningAllPieces: AugmentedError<ApiType>;473 /**474 * Setting item properties is not allowed.475 **/476 SettingPropertiesNotAllowed: AugmentedError<ApiType>;477 /**478 * Maximum refungibility exceeded.479 **/480 WrongRefungiblePieces: AugmentedError<ApiType>;481 /**482 * Generic error483 **/484 [key: string]: AugmentedError<ApiType>;485 };486 rmrkCore: {487 /**488 * Not the target owner of the sent NFT.489 **/490 CannotAcceptNonOwnedNft: AugmentedError<ApiType>;491 /**492 * Not the target owner of the sent NFT.493 **/494 CannotRejectNonOwnedNft: AugmentedError<ApiType>;495 /**496 * NFT was not sent and is not pending.497 **/498 CannotRejectNonPendingNft: AugmentedError<ApiType>;499 /**500 * If an NFT is sent to a descendant, that would form a nesting loop, an ouroboros.501 * Sending to self is redundant.502 **/503 CannotSendToDescendentOrSelf: AugmentedError<ApiType>;504 /**505 * Too many tokens created in the collection, no new ones are allowed.506 **/507 CollectionFullOrLocked: AugmentedError<ApiType>;508 /**509 * Only destroying collections without tokens is allowed.510 **/511 CollectionNotEmpty: AugmentedError<ApiType>;512 /**513 * Collection does not exist, has a wrong type, or does not map to a Unique ID.514 **/515 CollectionUnknown: AugmentedError<ApiType>;516 /**517 * Property of the type of RMRK collection could not be read successfully.518 **/519 CorruptedCollectionType: AugmentedError<ApiType>;520 /**521 * Could not find an ID for a collection. It is likely there were too many collections created on the chain, causing an overflow.522 **/523 NoAvailableCollectionId: AugmentedError<ApiType>;524 /**525 * Token does not exist, or there is no suitable ID for it, likely too many tokens were created in a collection, causing an overflow.526 **/527 NoAvailableNftId: AugmentedError<ApiType>;528 /**529 * Could not find an ID for the resource. It is likely there were too many resources created on an NFT, causing an overflow.530 **/531 NoAvailableResourceId: AugmentedError<ApiType>;532 /**533 * Token is marked as non-transferable, and thus cannot be transferred.534 **/535 NonTransferable: AugmentedError<ApiType>;536 /**537 * No permission to perform action.538 **/539 NoPermission: AugmentedError<ApiType>;540 /**541 * No such resource found.542 **/543 ResourceDoesntExist: AugmentedError<ApiType>;544 /**545 * Resource is not pending for the operation.546 **/547 ResourceNotPending: AugmentedError<ApiType>;548 /**549 * Could not find a property by the supplied key.550 **/551 RmrkPropertyIsNotFound: AugmentedError<ApiType>;552 /**553 * Too many symbols supplied as the property key. The maximum is [256](up_data_structs::MAX_PROPERTY_KEY_LENGTH).554 **/555 RmrkPropertyKeyIsTooLong: AugmentedError<ApiType>;556 /**557 * Too many bytes supplied as the property value. The maximum is [32768](up_data_structs::MAX_PROPERTY_VALUE_LENGTH).558 **/559 RmrkPropertyValueIsTooLong: AugmentedError<ApiType>;560 /**561 * Something went wrong when decoding encoded data from the storage.562 * Perhaps, there was a wrong key supplied for the type, or the data was improperly stored.563 **/564 UnableToDecodeRmrkData: AugmentedError<ApiType>;565 /**566 * Generic error567 **/568 [key: string]: AugmentedError<ApiType>;569 };570 rmrkEquip: {571 /**572 * Base collection linked to this ID does not exist.573 **/574 BaseDoesntExist: AugmentedError<ApiType>;575 /**576 * No Theme named "default" is associated with the Base.577 **/578 NeedsDefaultThemeFirst: AugmentedError<ApiType>;579 /**580 * Could not find an ID for a Base collection. It is likely there were too many collections created on the chain, causing an overflow.581 **/582 NoAvailableBaseId: AugmentedError<ApiType>;583 /**584 * Could not find a suitable ID for a Part, likely too many Part tokens were created in the Base, causing an overflow585 **/586 NoAvailablePartId: AugmentedError<ApiType>;587 /**588 * Cannot assign equippables to a fixed Part.589 **/590 NoEquippableOnFixedPart: AugmentedError<ApiType>;591 /**592 * Part linked to this ID does not exist.593 **/594 PartDoesntExist: AugmentedError<ApiType>;595 /**596 * No permission to perform action.597 **/598 PermissionError: AugmentedError<ApiType>;599 /**600 * Generic error601 **/602 [key: string]: AugmentedError<ApiType>;603 };604 scheduler: {605 /**606 * Failed to schedule a call607 **/608 FailedToSchedule: AugmentedError<ApiType>;609 /**610 * Cannot find the scheduled call.611 **/612 NotFound: AugmentedError<ApiType>;613 /**614 * Reschedule failed because it does not change scheduled time.615 **/616 RescheduleNoChange: AugmentedError<ApiType>;617 /**618 * Given target block number is in the past.619 **/620 TargetBlockNumberInPast: AugmentedError<ApiType>;621 /**622 * Generic error623 **/624 [key: string]: AugmentedError<ApiType>;625 };626 structure: {627 /**628 * While nesting, reached the breadth limit of nesting, exceeding the provided budget.629 **/630 BreadthLimit: AugmentedError<ApiType>;631 /**632 * While nesting, reached the depth limit of nesting, exceeding the provided budget.633 **/634 DepthLimit: AugmentedError<ApiType>;635 /**636 * While nesting, encountered an already checked account, detecting a loop.637 **/638 OuroborosDetected: AugmentedError<ApiType>;639 /**640 * Couldn't find the token owner that is itself a token.641 **/642 TokenNotFound: AugmentedError<ApiType>;643 /**644 * Generic error645 **/646 [key: string]: AugmentedError<ApiType>;647 };648 sudo: {649 /**650 * Sender must be the Sudo account651 **/652 RequireSudo: AugmentedError<ApiType>;653 /**654 * Generic error655 **/656 [key: string]: AugmentedError<ApiType>;657 };658 system: {659 /**660 * The origin filter prevent the call to be dispatched.661 **/662 CallFiltered: AugmentedError<ApiType>;663 /**664 * Failed to extract the runtime version from the new runtime.665 * 666 * Either calling `Core_version` or decoding `RuntimeVersion` failed.667 **/668 FailedToExtractRuntimeVersion: AugmentedError<ApiType>;669 /**670 * The name of specification does not match between the current runtime671 * and the new runtime.672 **/673 InvalidSpecName: AugmentedError<ApiType>;674 /**675 * Suicide called when the account has non-default composite data.676 **/677 NonDefaultComposite: AugmentedError<ApiType>;678 /**679 * There is a non-zero reference count preventing the account from being purged.680 **/681 NonZeroRefCount: AugmentedError<ApiType>;682 /**683 * The specification version is not allowed to decrease between the current runtime684 * and the new runtime.685 **/686 SpecVersionNeedsToIncrease: AugmentedError<ApiType>;687 /**688 * Generic error689 **/690 [key: string]: AugmentedError<ApiType>;691 };692 treasury: {693 /**694 * The spend origin is valid but the amount it is allowed to spend is lower than the695 * amount to be spent.696 **/697 InsufficientPermission: AugmentedError<ApiType>;698 /**699 * Proposer's balance is too low.700 **/701 InsufficientProposersBalance: AugmentedError<ApiType>;702 /**703 * No proposal or bounty at that index.704 **/705 InvalidIndex: AugmentedError<ApiType>;706 /**707 * Proposal has not been approved.708 **/709 ProposalNotApproved: AugmentedError<ApiType>;710 /**711 * Too many approvals in the queue.712 **/713 TooManyApprovals: AugmentedError<ApiType>;714 /**715 * Generic error716 **/717 [key: string]: AugmentedError<ApiType>;718 };719 unique: {720 /**721 * Decimal_points parameter must be lower than [`up_data_structs::MAX_DECIMAL_POINTS`].722 **/723 CollectionDecimalPointLimitExceeded: AugmentedError<ApiType>;724 /**725 * This address is not set as sponsor, use setCollectionSponsor first.726 **/727 ConfirmUnsetSponsorFail: AugmentedError<ApiType>;728 /**729 * Length of items properties must be greater than 0.730 **/731 EmptyArgument: AugmentedError<ApiType>;732 /**733 * Repertition is only supported by refungible collection.734 **/735 RepartitionCalledOnNonRefungibleCollection: AugmentedError<ApiType>;736 /**737 * Generic error738 **/739 [key: string]: AugmentedError<ApiType>;740 };741 vesting: {742 /**743 * The vested transfer amount is too low744 **/745 AmountLow: AugmentedError<ApiType>;746 /**747 * Insufficient amount of balance to lock748 **/749 InsufficientBalanceToLock: AugmentedError<ApiType>;750 /**751 * Failed because the maximum vesting schedules was exceeded752 **/753 MaxVestingSchedulesExceeded: AugmentedError<ApiType>;754 /**755 * This account have too many vesting schedules756 **/757 TooManyVestingSchedules: AugmentedError<ApiType>;758 /**759 * Vesting period is zero760 **/761 ZeroVestingPeriod: AugmentedError<ApiType>;762 /**763 * Number of vests is zero764 **/765 ZeroVestingPeriodCount: AugmentedError<ApiType>;766 /**767 * Generic error768 **/769 [key: string]: AugmentedError<ApiType>;770 };771 xcmpQueue: {772 /**773 * Bad overweight index.774 **/775 BadOverweightIndex: AugmentedError<ApiType>;776 /**777 * Bad XCM data.778 **/779 BadXcm: AugmentedError<ApiType>;780 /**781 * Bad XCM origin.782 **/783 BadXcmOrigin: AugmentedError<ApiType>;784 /**785 * Failed to send XCM message.786 **/787 FailedToSend: AugmentedError<ApiType>;788 /**789 * Provided weight is possibly not enough to execute the message.790 **/791 WeightOverLimit: AugmentedError<ApiType>;792 /**793 * Generic error794 **/795 [key: string]: AugmentedError<ApiType>;796 };797 } // AugmentedErrors798} // declare moduletests/src/interfaces/augment-api-events.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-events.ts
+++ b/tests/src/interfaces/augment-api-events.ts
@@ -15,6 +15,13 @@
declare module '@polkadot/api-base/types/events' {
interface AugmentedEvents<ApiType extends ApiTypes> {
+ appPromotion: {
+ StakingRecalculation: AugmentedEvent<ApiType, [AccountId32, u128, u128]>;
+ /**
+ * Generic event
+ **/
+ [key: string]: AugmentedEvent<ApiType>;
+ };
balances: {
/**
* A balance was set by root.
@@ -355,13 +362,6 @@
* \[ destination, result \]
**/
VersionChangeNotified: AugmentedEvent<ApiType, [XcmV1MultiLocation, u32]>;
- /**
- * Generic event
- **/
- [key: string]: AugmentedEvent<ApiType>;
- };
- promotion: {
- StakingRecalculation: AugmentedEvent<ApiType, [AccountId32, u128, u128]>;
/**
* Generic event
**/
tests/src/interfaces/augment-api-query.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-query.ts
+++ b/tests/src/interfaces/augment-api-query.ts
@@ -17,6 +17,35 @@
declare module '@polkadot/api-base/types/storage' {
interface AugmentedQueries<ApiType extends ApiTypes> {
+ appPromotion: {
+ admin: AugmentedQuery<ApiType, () => Observable<Option<AccountId32>>, []> & QueryableStorageEntry<ApiType, []>;
+ /**
+ * Stores hash a record for which the last revenue recalculation was performed.
+ * If `None`, then recalculation has not yet been performed or calculations have been completed for all stakers.
+ **/
+ nextCalculatedRecord: AugmentedQuery<ApiType, () => Observable<Option<ITuple<[AccountId32, u32]>>>, []> & QueryableStorageEntry<ApiType, []>;
+ /**
+ * Amount of tokens pending unstake per user per block.
+ **/
+ pendingUnstake: AugmentedQuery<ApiType, (arg: u32 | AnyNumber | Uint8Array) => Observable<Vec<ITuple<[AccountId32, u128]>>>, [u32]> & QueryableStorageEntry<ApiType, [u32]>;
+ /**
+ * Amount of tokens staked by account in the blocknumber.
+ **/
+ staked: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<ITuple<[u128, u32]>>, [AccountId32, u32]> & QueryableStorageEntry<ApiType, [AccountId32, u32]>;
+ /**
+ * Amount of stakes for an Account
+ **/
+ stakesPerAccount: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<u8>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
+ /**
+ * A block when app-promotion has started .I think this is redundant, because we only need `NextInterestBlock`.
+ **/
+ startBlock: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
+ totalStaked: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
+ /**
+ * Generic query
+ **/
+ [key: string]: QueryableStorageEntry<ApiType>;
+ };
balances: {
/**
* The Balances pallet example of storing the balance of an account.
@@ -505,39 +534,6 @@
* in the trie.
**/
validationData: AugmentedQuery<ApiType, () => Observable<Option<PolkadotPrimitivesV2PersistedValidationData>>, []> & QueryableStorageEntry<ApiType, []>;
- /**
- * Generic query
- **/
- [key: string]: QueryableStorageEntry<ApiType>;
- };
- promotion: {
- admin: AugmentedQuery<ApiType, () => Observable<Option<AccountId32>>, []> & QueryableStorageEntry<ApiType, []>;
- /**
- * Stores hash a record for which the last revenue recalculation was performed.
- * If `None`, then recalculation has not yet been performed or calculations have been completed for all stakers.
- **/
- nextCalculatedRecord: AugmentedQuery<ApiType, () => Observable<Option<ITuple<[AccountId32, u32]>>>, []> & QueryableStorageEntry<ApiType, []>;
- /**
- * Next target block when interest is recalculated
- **/
- nextInterestBlock: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
- /**
- * Amount of tokens pending unstake per user per block.
- **/
- pendingUnstake: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<u128>, [AccountId32, u32]> & QueryableStorageEntry<ApiType, [AccountId32, u32]>;
- /**
- * Amount of tokens staked by account in the blocknumber.
- **/
- staked: AugmentedQuery<ApiType, (arg1: AccountId32 | string | Uint8Array, arg2: u32 | AnyNumber | Uint8Array) => Observable<ITuple<[u128, u32]>>, [AccountId32, u32]> & QueryableStorageEntry<ApiType, [AccountId32, u32]>;
- /**
- * Amount of stakes for an Account
- **/
- stakesPerAccount: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<u8>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
- /**
- * A block when app-promotion has started .I think this is redundant, because we only need `NextInterestBlock`.
- **/
- startBlock: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
- totalStaked: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
tests/src/interfaces/augment-api-tx.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-tx.ts
+++ b/tests/src/interfaces/augment-api-tx.ts
@@ -17,6 +17,20 @@
declare module '@polkadot/api-base/types/submittable' {
interface AugmentedSubmittables<ApiType extends ApiTypes> {
+ appPromotion: {
+ payoutStakers: AugmentedSubmittable<(stakersNumber: Option<u8> | null | Uint8Array | u8 | AnyNumber) => SubmittableExtrinsic<ApiType>, [Option<u8>]>;
+ setAdminAddress: AugmentedSubmittable<(admin: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletEvmAccountBasicCrossAccountIdRepr]>;
+ sponsorCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
+ sponsorConract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160]>;
+ stake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128]>;
+ stopSponsoringCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
+ stopSponsoringContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160]>;
+ unstake: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
+ /**
+ * Generic tx
+ **/
+ [key: string]: SubmittableExtrinsicFunction<ApiType>;
+ };
balances: {
/**
* Exactly as `transfer`, except the origin must be root and the source account may be
@@ -370,22 +384,6 @@
* fees.
**/
teleportAssets: AugmentedSubmittable<(dest: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, beneficiary: XcmVersionedMultiLocation | { V0: any } | { V1: any } | string | Uint8Array, assets: XcmVersionedMultiAssets | { V0: any } | { V1: any } | string | Uint8Array, feeAssetItem: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmVersionedMultiLocation, XcmVersionedMultiLocation, XcmVersionedMultiAssets, u32]>;
- /**
- * Generic tx
- **/
- [key: string]: SubmittableExtrinsicFunction<ApiType>;
- };
- promotion: {
- payoutStakers: AugmentedSubmittable<(stakersNumber: Option<u8> | null | Uint8Array | u8 | AnyNumber) => SubmittableExtrinsic<ApiType>, [Option<u8>]>;
- setAdminAddress: AugmentedSubmittable<(admin: PalletEvmAccountBasicCrossAccountIdRepr | { Substrate: any } | { Ethereum: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [PalletEvmAccountBasicCrossAccountIdRepr]>;
- sponsorCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
- sponsorConract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160]>;
- stake: AugmentedSubmittable<(amount: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128]>;
- startAppPromotion: AugmentedSubmittable<(promotionStartRelayBlock: Option<u32> | null | Uint8Array | u32 | AnyNumber) => SubmittableExtrinsic<ApiType>, [Option<u32>]>;
- stopAppPromotion: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
- stopSponsoringCollection: AugmentedSubmittable<(collectionId: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
- stopSponsoringContract: AugmentedSubmittable<(contractId: H160 | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160]>;
- unstake: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
/**
* Generic tx
**/
tests/src/interfaces/default/types.tsdiffbeforeafterboth--- a/tests/src/interfaces/default/types.ts
+++ b/tests/src/interfaces/default/types.ts
@@ -812,11 +812,6 @@
readonly asSetAdminAddress: {
readonly admin: PalletEvmAccountBasicCrossAccountIdRepr;
} & Struct;
- readonly isStartAppPromotion: boolean;
- readonly asStartAppPromotion: {
- readonly promotionStartRelayBlock: Option<u32>;
- } & Struct;
- readonly isStopAppPromotion: boolean;
readonly isStake: boolean;
readonly asStake: {
readonly amount: u128;
@@ -842,7 +837,7 @@
readonly asPayoutStakers: {
readonly stakersNumber: Option<u8>;
} & Struct;
- readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'StopAppPromotion' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorConract' | 'StopSponsoringContract' | 'PayoutStakers';
+ readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorConract' | 'StopSponsoringContract' | 'PayoutStakers';
}
/** @name PalletAppPromotionError */
@@ -850,8 +845,9 @@
readonly isAdminNotSet: boolean;
readonly isNoPermission: boolean;
readonly isNotSufficientFounds: boolean;
+ readonly isPendingForBlockOverflow: boolean;
readonly isInvalidArgument: boolean;
- readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'InvalidArgument';
+ readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'PendingForBlockOverflow' | 'InvalidArgument';
}
/** @name PalletAppPromotionEvent */
tests/src/interfaces/lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/lookup.ts
+++ b/tests/src/interfaces/lookup.ts
@@ -2460,10 +2460,6 @@
set_admin_address: {
admin: 'PalletEvmAccountBasicCrossAccountIdRepr',
},
- start_app_promotion: {
- promotionStartRelayBlock: 'Option<u32>',
- },
- stop_app_promotion: 'Null',
stake: {
amount: 'u128',
},
@@ -3103,19 +3099,19 @@
_enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart']
},
/**
- * Lookup412: pallet_app_promotion::pallet::Error<T>
+ * Lookup415: pallet_app_promotion::pallet::Error<T>
**/
PalletAppPromotionError: {
- _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFounds', 'InvalidArgument']
+ _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFounds', 'PendingForBlockOverflow', 'InvalidArgument']
},
/**
- * Lookup415: pallet_evm::pallet::Error<T>
+ * Lookup418: pallet_evm::pallet::Error<T>
**/
PalletEvmError: {
_enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce']
},
/**
- * Lookup418: fp_rpc::TransactionStatus
+ * Lookup421: fp_rpc::TransactionStatus
**/
FpRpcTransactionStatus: {
transactionHash: 'H256',
@@ -3127,11 +3123,11 @@
logsBloom: 'EthbloomBloom'
},
/**
- * Lookup420: ethbloom::Bloom
+ * Lookup423: ethbloom::Bloom
**/
EthbloomBloom: '[u8;256]',
/**
- * Lookup422: ethereum::receipt::ReceiptV3
+ * Lookup425: ethereum::receipt::ReceiptV3
**/
EthereumReceiptReceiptV3: {
_enum: {
@@ -3141,7 +3137,7 @@
}
},
/**
- * Lookup423: ethereum::receipt::EIP658ReceiptData
+ * Lookup426: ethereum::receipt::EIP658ReceiptData
**/
EthereumReceiptEip658ReceiptData: {
statusCode: 'u8',
@@ -3150,7 +3146,7 @@
logs: 'Vec<EthereumLog>'
},
/**
- * Lookup424: ethereum::block::Block<ethereum::transaction::TransactionV2>
+ * Lookup427: ethereum::block::Block<ethereum::transaction::TransactionV2>
**/
EthereumBlock: {
header: 'EthereumHeader',
@@ -3158,7 +3154,7 @@
ommers: 'Vec<EthereumHeader>'
},
/**
- * Lookup425: ethereum::header::Header
+ * Lookup428: ethereum::header::Header
**/
EthereumHeader: {
parentHash: 'H256',
@@ -3178,23 +3174,23 @@
nonce: 'EthereumTypesHashH64'
},
/**
- * Lookup426: ethereum_types::hash::H64
+ * Lookup429: ethereum_types::hash::H64
**/
EthereumTypesHashH64: '[u8;8]',
/**
- * Lookup431: pallet_ethereum::pallet::Error<T>
+ * Lookup434: pallet_ethereum::pallet::Error<T>
**/
PalletEthereumError: {
_enum: ['InvalidSignature', 'PreLogExists']
},
/**
- * Lookup432: pallet_evm_coder_substrate::pallet::Error<T>
+ * Lookup435: pallet_evm_coder_substrate::pallet::Error<T>
**/
PalletEvmCoderSubstrateError: {
_enum: ['OutOfGas', 'OutOfFund']
},
/**
- * Lookup433: up_data_structs::SponsorshipState<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
+ * Lookup436: up_data_structs::SponsorshipState<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>
**/
UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: {
_enum: {
@@ -3204,25 +3200,25 @@
}
},
/**
- * Lookup434: pallet_evm_contract_helpers::SponsoringModeT
+ * Lookup437: pallet_evm_contract_helpers::SponsoringModeT
**/
PalletEvmContractHelpersSponsoringModeT: {
_enum: ['Disabled', 'Allowlisted', 'Generous']
},
/**
- * Lookup436: pallet_evm_contract_helpers::pallet::Error<T>
+ * Lookup439: pallet_evm_contract_helpers::pallet::Error<T>
**/
PalletEvmContractHelpersError: {
_enum: ['NoPermission', 'NoPendingSponsor']
},
/**
- * Lookup437: pallet_evm_migration::pallet::Error<T>
+ * Lookup440: pallet_evm_migration::pallet::Error<T>
**/
PalletEvmMigrationError: {
_enum: ['AccountNotEmpty', 'AccountIsNotMigrating']
},
/**
- * Lookup439: sp_runtime::MultiSignature
+ * Lookup442: sp_runtime::MultiSignature
**/
SpRuntimeMultiSignature: {
_enum: {
@@ -3232,43 +3228,43 @@
}
},
/**
- * Lookup440: sp_core::ed25519::Signature
+ * Lookup443: sp_core::ed25519::Signature
**/
SpCoreEd25519Signature: '[u8;64]',
/**
- * Lookup442: sp_core::sr25519::Signature
+ * Lookup445: sp_core::sr25519::Signature
**/
SpCoreSr25519Signature: '[u8;64]',
/**
- * Lookup443: sp_core::ecdsa::Signature
+ * Lookup446: sp_core::ecdsa::Signature
**/
SpCoreEcdsaSignature: '[u8;65]',
/**
- * Lookup446: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
+ * Lookup449: frame_system::extensions::check_spec_version::CheckSpecVersion<T>
**/
FrameSystemExtensionsCheckSpecVersion: 'Null',
/**
- * Lookup447: frame_system::extensions::check_genesis::CheckGenesis<T>
+ * Lookup450: frame_system::extensions::check_genesis::CheckGenesis<T>
**/
FrameSystemExtensionsCheckGenesis: 'Null',
/**
- * Lookup450: frame_system::extensions::check_nonce::CheckNonce<T>
+ * Lookup453: frame_system::extensions::check_nonce::CheckNonce<T>
**/
FrameSystemExtensionsCheckNonce: 'Compact<u32>',
/**
- * Lookup451: frame_system::extensions::check_weight::CheckWeight<T>
+ * Lookup454: frame_system::extensions::check_weight::CheckWeight<T>
**/
FrameSystemExtensionsCheckWeight: 'Null',
/**
- * Lookup452: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
+ * Lookup455: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>
**/
PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact<u128>',
/**
- * Lookup453: opal_runtime::Runtime
+ * Lookup456: opal_runtime::Runtime
**/
OpalRuntimeRuntime: 'Null',
/**
- * Lookup454: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>
+ * Lookup457: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>
**/
PalletEthereumFakeTransactionFinalizer: 'Null'
};
tests/src/interfaces/types-lookup.tsdiffbeforeafterboth--- a/tests/src/interfaces/types-lookup.ts
+++ b/tests/src/interfaces/types-lookup.ts
@@ -2665,11 +2665,6 @@
readonly asSetAdminAddress: {
readonly admin: PalletEvmAccountBasicCrossAccountIdRepr;
} & Struct;
- readonly isStartAppPromotion: boolean;
- readonly asStartAppPromotion: {
- readonly promotionStartRelayBlock: Option<u32>;
- } & Struct;
- readonly isStopAppPromotion: boolean;
readonly isStake: boolean;
readonly asStake: {
readonly amount: u128;
@@ -2695,7 +2690,7 @@
readonly asPayoutStakers: {
readonly stakersNumber: Option<u8>;
} & Struct;
- readonly type: 'SetAdminAddress' | 'StartAppPromotion' | 'StopAppPromotion' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorConract' | 'StopSponsoringContract' | 'PayoutStakers';
+ readonly type: 'SetAdminAddress' | 'Stake' | 'Unstake' | 'SponsorCollection' | 'StopSponsoringCollection' | 'SponsorConract' | 'StopSponsoringContract' | 'PayoutStakers';
}
/** @name PalletEvmCall (306) */
@@ -3291,16 +3286,17 @@
readonly type: 'PermissionError' | 'NoAvailableBaseId' | 'NoAvailablePartId' | 'BaseDoesntExist' | 'NeedsDefaultThemeFirst' | 'PartDoesntExist' | 'NoEquippableOnFixedPart';
}
- /** @name PalletAppPromotionError (412) */
+ /** @name PalletAppPromotionError (415) */
interface PalletAppPromotionError extends Enum {
readonly isAdminNotSet: boolean;
readonly isNoPermission: boolean;
readonly isNotSufficientFounds: boolean;
+ readonly isPendingForBlockOverflow: boolean;
readonly isInvalidArgument: boolean;
- readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'InvalidArgument';
+ readonly type: 'AdminNotSet' | 'NoPermission' | 'NotSufficientFounds' | 'PendingForBlockOverflow' | 'InvalidArgument';
}
- /** @name PalletEvmError (415) */
+ /** @name PalletEvmError (418) */
interface PalletEvmError extends Enum {
readonly isBalanceLow: boolean;
readonly isFeeOverflow: boolean;
@@ -3311,7 +3307,7 @@
readonly type: 'BalanceLow' | 'FeeOverflow' | 'PaymentOverflow' | 'WithdrawFailed' | 'GasPriceTooLow' | 'InvalidNonce';
}
- /** @name FpRpcTransactionStatus (418) */
+ /** @name FpRpcTransactionStatus (421) */
interface FpRpcTransactionStatus extends Struct {
readonly transactionHash: H256;
readonly transactionIndex: u32;
@@ -3322,10 +3318,10 @@
readonly logsBloom: EthbloomBloom;
}
- /** @name EthbloomBloom (420) */
+ /** @name EthbloomBloom (423) */
interface EthbloomBloom extends U8aFixed {}
- /** @name EthereumReceiptReceiptV3 (422) */
+ /** @name EthereumReceiptReceiptV3 (425) */
interface EthereumReceiptReceiptV3 extends Enum {
readonly isLegacy: boolean;
readonly asLegacy: EthereumReceiptEip658ReceiptData;
@@ -3336,7 +3332,7 @@
readonly type: 'Legacy' | 'Eip2930' | 'Eip1559';
}
- /** @name EthereumReceiptEip658ReceiptData (423) */
+ /** @name EthereumReceiptEip658ReceiptData (426) */
interface EthereumReceiptEip658ReceiptData extends Struct {
readonly statusCode: u8;
readonly usedGas: U256;
@@ -3344,14 +3340,14 @@
readonly logs: Vec<EthereumLog>;
}
- /** @name EthereumBlock (424) */
+ /** @name EthereumBlock (427) */
interface EthereumBlock extends Struct {
readonly header: EthereumHeader;
readonly transactions: Vec<EthereumTransactionTransactionV2>;
readonly ommers: Vec<EthereumHeader>;
}
- /** @name EthereumHeader (425) */
+ /** @name EthereumHeader (428) */
interface EthereumHeader extends Struct {
readonly parentHash: H256;
readonly ommersHash: H256;
@@ -3370,24 +3366,24 @@
readonly nonce: EthereumTypesHashH64;
}
- /** @name EthereumTypesHashH64 (426) */
+ /** @name EthereumTypesHashH64 (429) */
interface EthereumTypesHashH64 extends U8aFixed {}
- /** @name PalletEthereumError (431) */
+ /** @name PalletEthereumError (434) */
interface PalletEthereumError extends Enum {
readonly isInvalidSignature: boolean;
readonly isPreLogExists: boolean;
readonly type: 'InvalidSignature' | 'PreLogExists';
}
- /** @name PalletEvmCoderSubstrateError (432) */
+ /** @name PalletEvmCoderSubstrateError (435) */
interface PalletEvmCoderSubstrateError extends Enum {
readonly isOutOfGas: boolean;
readonly isOutOfFund: boolean;
readonly type: 'OutOfGas' | 'OutOfFund';
}
- /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (433) */
+ /** @name UpDataStructsSponsorshipStateBasicCrossAccountIdRepr (436) */
interface UpDataStructsSponsorshipStateBasicCrossAccountIdRepr extends Enum {
readonly isDisabled: boolean;
readonly isUnconfirmed: boolean;
@@ -3397,7 +3393,7 @@
readonly type: 'Disabled' | 'Unconfirmed' | 'Confirmed';
}
- /** @name PalletEvmContractHelpersSponsoringModeT (434) */
+ /** @name PalletEvmContractHelpersSponsoringModeT (437) */
interface PalletEvmContractHelpersSponsoringModeT extends Enum {
readonly isDisabled: boolean;
readonly isAllowlisted: boolean;
@@ -3405,21 +3401,21 @@
readonly type: 'Disabled' | 'Allowlisted' | 'Generous';
}
- /** @name PalletEvmContractHelpersError (436) */
+ /** @name PalletEvmContractHelpersError (439) */
interface PalletEvmContractHelpersError extends Enum {
readonly isNoPermission: boolean;
readonly isNoPendingSponsor: boolean;
readonly type: 'NoPermission' | 'NoPendingSponsor';
}
- /** @name PalletEvmMigrationError (437) */
+ /** @name PalletEvmMigrationError (440) */
interface PalletEvmMigrationError extends Enum {
readonly isAccountNotEmpty: boolean;
readonly isAccountIsNotMigrating: boolean;
readonly type: 'AccountNotEmpty' | 'AccountIsNotMigrating';
}
- /** @name SpRuntimeMultiSignature (439) */
+ /** @name SpRuntimeMultiSignature (442) */
interface SpRuntimeMultiSignature extends Enum {
readonly isEd25519: boolean;
readonly asEd25519: SpCoreEd25519Signature;
@@ -3430,34 +3426,34 @@
readonly type: 'Ed25519' | 'Sr25519' | 'Ecdsa';
}
- /** @name SpCoreEd25519Signature (440) */
+ /** @name SpCoreEd25519Signature (443) */
interface SpCoreEd25519Signature extends U8aFixed {}
- /** @name SpCoreSr25519Signature (442) */
+ /** @name SpCoreSr25519Signature (445) */
interface SpCoreSr25519Signature extends U8aFixed {}
- /** @name SpCoreEcdsaSignature (443) */
+ /** @name SpCoreEcdsaSignature (446) */
interface SpCoreEcdsaSignature extends U8aFixed {}
- /** @name FrameSystemExtensionsCheckSpecVersion (446) */
+ /** @name FrameSystemExtensionsCheckSpecVersion (449) */
type FrameSystemExtensionsCheckSpecVersion = Null;
- /** @name FrameSystemExtensionsCheckGenesis (447) */
+ /** @name FrameSystemExtensionsCheckGenesis (450) */
type FrameSystemExtensionsCheckGenesis = Null;
- /** @name FrameSystemExtensionsCheckNonce (450) */
+ /** @name FrameSystemExtensionsCheckNonce (453) */
interface FrameSystemExtensionsCheckNonce extends Compact<u32> {}
- /** @name FrameSystemExtensionsCheckWeight (451) */
+ /** @name FrameSystemExtensionsCheckWeight (454) */
type FrameSystemExtensionsCheckWeight = Null;
- /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (452) */
+ /** @name PalletTemplateTransactionPaymentChargeTransactionPayment (455) */
interface PalletTemplateTransactionPaymentChargeTransactionPayment extends Compact<u128> {}
- /** @name OpalRuntimeRuntime (453) */
+ /** @name OpalRuntimeRuntime (456) */
type OpalRuntimeRuntime = Null;
- /** @name PalletEthereumFakeTransactionFinalizer (454) */
+ /** @name PalletEthereumFakeTransactionFinalizer (457) */
type PalletEthereumFakeTransactionFinalizer = Null;
} // declare module
tests/src/util/helpers.tsdiffbeforeafterboth--- a/tests/src/util/helpers.ts
+++ b/tests/src/util/helpers.ts
@@ -48,7 +48,7 @@
Fungible = 'fungible',
NFT = 'nonfungible',
Scheduler = 'scheduler',
- AppPromotion = 'promotion',
+ AppPromotion = 'apppromotion',
}
export async function isUnique(): Promise<boolean> {
tests/src/util/playgrounds/unique.tsdiffbeforeafterboth--- a/tests/src/util/playgrounds/unique.ts
+++ b/tests/src/util/playgrounds/unique.ts
@@ -2008,7 +2008,7 @@
if(typeof label === 'undefined') label = `${signer.address} amount: ${amountToStake}`;
const stakeResult = await this.helper.executeExtrinsic(
signer,
- 'api.tx.promotion.stake', [amountToStake],
+ 'api.tx.appPromotion.stake', [amountToStake],
true, `stake failed for ${label}`,
);
// TODO extract info from stakeResult
@@ -2026,7 +2026,7 @@
if(typeof label === 'undefined') label = `${signer.address}`;
const unstakeResult = await this.helper.executeExtrinsic(
signer,
- 'api.tx.promotion.unstake', [],
+ 'api.tx.appPromotion.unstake', [],
true, `unstake failed for ${label}`,
);
// TODO extract info from unstakeResult