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.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-errors.ts
+++ b/tests/src/interfaces/augment-api-errors.ts
@@ -11,6 +11,29 @@
declare module '@polkadot/api-base/types/errors' {
interface AugmentedErrors<ApiType extends ApiTypes> {
+ appPromotion: {
+ /**
+ * Error due to action requiring admin to be set
+ **/
+ AdminNotSet: AugmentedError<ApiType>;
+ /**
+ * An error related to the fact that an invalid argument was passed to perform an action
+ **/
+ InvalidArgument: AugmentedError<ApiType>;
+ /**
+ * No permission to perform an action
+ **/
+ NoPermission: AugmentedError<ApiType>;
+ /**
+ * Insufficient funds to perform an action
+ **/
+ NotSufficientFounds: AugmentedError<ApiType>;
+ PendingForBlockOverflow: AugmentedError<ApiType>;
+ /**
+ * Generic error
+ **/
+ [key: string]: AugmentedError<ApiType>;
+ };
balances: {
/**
* Beneficiary account must pre-exist
@@ -430,28 +453,6 @@
* The message's weight could not be determined.
**/
UnweighableMessage: AugmentedError<ApiType>;
- /**
- * Generic error
- **/
- [key: string]: AugmentedError<ApiType>;
- };
- promotion: {
- /**
- * Error due to action requiring admin to be set
- **/
- AdminNotSet: AugmentedError<ApiType>;
- /**
- * An error related to the fact that an invalid argument was passed to perform an action
- **/
- InvalidArgument: AugmentedError<ApiType>;
- /**
- * No permission to perform an action
- **/
- NoPermission: AugmentedError<ApiType>;
- /**
- * Insufficient funds to perform an action
- **/
- NotSufficientFounds: AugmentedError<ApiType>;
/**
* Generic error
**/
tests/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.tsdiffbeforeafterboth2460 set_admin_address: {2460 set_admin_address: {2461 admin: 'PalletEvmAccountBasicCrossAccountIdRepr',2461 admin: 'PalletEvmAccountBasicCrossAccountIdRepr',2462 },2462 },2463 start_app_promotion: {2464 promotionStartRelayBlock: 'Option<u32>',2465 },2466 stop_app_promotion: 'Null',2467 stake: {2463 stake: {2468 amount: 'u128',2464 amount: 'u128',2469 },2465 },3102 PalletRmrkEquipError: {3098 PalletRmrkEquipError: {3103 _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart']3099 _enum: ['PermissionError', 'NoAvailableBaseId', 'NoAvailablePartId', 'BaseDoesntExist', 'NeedsDefaultThemeFirst', 'PartDoesntExist', 'NoEquippableOnFixedPart']3104 },3100 },3105 /**3101 /**3106 * Lookup412: pallet_app_promotion::pallet::Error<T>3102 * Lookup415: pallet_app_promotion::pallet::Error<T>3107 **/3103 **/3108 PalletAppPromotionError: {3104 PalletAppPromotionError: {3109 _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFounds', 'InvalidArgument']3105 _enum: ['AdminNotSet', 'NoPermission', 'NotSufficientFounds', 'PendingForBlockOverflow', 'InvalidArgument']3110 },3106 },3111 /**3107 /**3112 * Lookup415: pallet_evm::pallet::Error<T>3108 * Lookup418: pallet_evm::pallet::Error<T>3113 **/3109 **/3114 PalletEvmError: {3110 PalletEvmError: {3115 _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce']3111 _enum: ['BalanceLow', 'FeeOverflow', 'PaymentOverflow', 'WithdrawFailed', 'GasPriceTooLow', 'InvalidNonce']3116 },3112 },3117 /**3113 /**3118 * Lookup418: fp_rpc::TransactionStatus3114 * Lookup421: fp_rpc::TransactionStatus3119 **/3115 **/3120 FpRpcTransactionStatus: {3116 FpRpcTransactionStatus: {3121 transactionHash: 'H256',3117 transactionHash: 'H256',3122 transactionIndex: 'u32',3118 transactionIndex: 'u32',3126 logs: 'Vec<EthereumLog>',3122 logs: 'Vec<EthereumLog>',3127 logsBloom: 'EthbloomBloom'3123 logsBloom: 'EthbloomBloom'3128 },3124 },3129 /**3125 /**3130 * Lookup420: ethbloom::Bloom3126 * Lookup423: ethbloom::Bloom3131 **/3127 **/3132 EthbloomBloom: '[u8;256]',3128 EthbloomBloom: '[u8;256]',3133 /**3129 /**3134 * Lookup422: ethereum::receipt::ReceiptV33130 * Lookup425: ethereum::receipt::ReceiptV33135 **/3131 **/3136 EthereumReceiptReceiptV3: {3132 EthereumReceiptReceiptV3: {3137 _enum: {3133 _enum: {3138 Legacy: 'EthereumReceiptEip658ReceiptData',3134 Legacy: 'EthereumReceiptEip658ReceiptData',3139 EIP2930: 'EthereumReceiptEip658ReceiptData',3135 EIP2930: 'EthereumReceiptEip658ReceiptData',3140 EIP1559: 'EthereumReceiptEip658ReceiptData'3136 EIP1559: 'EthereumReceiptEip658ReceiptData'3141 }3137 }3142 },3138 },3143 /**3139 /**3144 * Lookup423: ethereum::receipt::EIP658ReceiptData3140 * Lookup426: ethereum::receipt::EIP658ReceiptData3145 **/3141 **/3146 EthereumReceiptEip658ReceiptData: {3142 EthereumReceiptEip658ReceiptData: {3147 statusCode: 'u8',3143 statusCode: 'u8',3148 usedGas: 'U256',3144 usedGas: 'U256',3149 logsBloom: 'EthbloomBloom',3145 logsBloom: 'EthbloomBloom',3150 logs: 'Vec<EthereumLog>'3146 logs: 'Vec<EthereumLog>'3151 },3147 },3152 /**3148 /**3153 * Lookup424: ethereum::block::Block<ethereum::transaction::TransactionV2>3149 * Lookup427: ethereum::block::Block<ethereum::transaction::TransactionV2>3154 **/3150 **/3155 EthereumBlock: {3151 EthereumBlock: {3156 header: 'EthereumHeader',3152 header: 'EthereumHeader',3157 transactions: 'Vec<EthereumTransactionTransactionV2>',3153 transactions: 'Vec<EthereumTransactionTransactionV2>',3158 ommers: 'Vec<EthereumHeader>'3154 ommers: 'Vec<EthereumHeader>'3159 },3155 },3160 /**3156 /**3161 * Lookup425: ethereum::header::Header3157 * Lookup428: ethereum::header::Header3162 **/3158 **/3163 EthereumHeader: {3159 EthereumHeader: {3164 parentHash: 'H256',3160 parentHash: 'H256',3165 ommersHash: 'H256',3161 ommersHash: 'H256',3177 mixHash: 'H256',3173 mixHash: 'H256',3178 nonce: 'EthereumTypesHashH64'3174 nonce: 'EthereumTypesHashH64'3179 },3175 },3180 /**3176 /**3181 * Lookup426: ethereum_types::hash::H643177 * Lookup429: ethereum_types::hash::H643182 **/3178 **/3183 EthereumTypesHashH64: '[u8;8]',3179 EthereumTypesHashH64: '[u8;8]',3184 /**3180 /**3185 * Lookup431: pallet_ethereum::pallet::Error<T>3181 * Lookup434: pallet_ethereum::pallet::Error<T>3186 **/3182 **/3187 PalletEthereumError: {3183 PalletEthereumError: {3188 _enum: ['InvalidSignature', 'PreLogExists']3184 _enum: ['InvalidSignature', 'PreLogExists']3189 },3185 },3190 /**3186 /**3191 * Lookup432: pallet_evm_coder_substrate::pallet::Error<T>3187 * Lookup435: pallet_evm_coder_substrate::pallet::Error<T>3192 **/3188 **/3193 PalletEvmCoderSubstrateError: {3189 PalletEvmCoderSubstrateError: {3194 _enum: ['OutOfGas', 'OutOfFund']3190 _enum: ['OutOfGas', 'OutOfFund']3195 },3191 },3196 /**3192 /**3197 * Lookup433: up_data_structs::SponsorshipState<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>3193 * Lookup436: up_data_structs::SponsorshipState<pallet_evm::account::BasicCrossAccountIdRepr<sp_core::crypto::AccountId32>>3198 **/3194 **/3199 UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: {3195 UpDataStructsSponsorshipStateBasicCrossAccountIdRepr: {3200 _enum: {3196 _enum: {3201 Disabled: 'Null',3197 Disabled: 'Null',3202 Unconfirmed: 'PalletEvmAccountBasicCrossAccountIdRepr',3198 Unconfirmed: 'PalletEvmAccountBasicCrossAccountIdRepr',3203 Confirmed: 'PalletEvmAccountBasicCrossAccountIdRepr'3199 Confirmed: 'PalletEvmAccountBasicCrossAccountIdRepr'3204 }3200 }3205 },3201 },3206 /**3202 /**3207 * Lookup434: pallet_evm_contract_helpers::SponsoringModeT3203 * Lookup437: pallet_evm_contract_helpers::SponsoringModeT3208 **/3204 **/3209 PalletEvmContractHelpersSponsoringModeT: {3205 PalletEvmContractHelpersSponsoringModeT: {3210 _enum: ['Disabled', 'Allowlisted', 'Generous']3206 _enum: ['Disabled', 'Allowlisted', 'Generous']3211 },3207 },3212 /**3208 /**3213 * Lookup436: pallet_evm_contract_helpers::pallet::Error<T>3209 * Lookup439: pallet_evm_contract_helpers::pallet::Error<T>3214 **/3210 **/3215 PalletEvmContractHelpersError: {3211 PalletEvmContractHelpersError: {3216 _enum: ['NoPermission', 'NoPendingSponsor']3212 _enum: ['NoPermission', 'NoPendingSponsor']3217 },3213 },3218 /**3214 /**3219 * Lookup437: pallet_evm_migration::pallet::Error<T>3215 * Lookup440: pallet_evm_migration::pallet::Error<T>3220 **/3216 **/3221 PalletEvmMigrationError: {3217 PalletEvmMigrationError: {3222 _enum: ['AccountNotEmpty', 'AccountIsNotMigrating']3218 _enum: ['AccountNotEmpty', 'AccountIsNotMigrating']3223 },3219 },3224 /**3220 /**3225 * Lookup439: sp_runtime::MultiSignature3221 * Lookup442: sp_runtime::MultiSignature3226 **/3222 **/3227 SpRuntimeMultiSignature: {3223 SpRuntimeMultiSignature: {3228 _enum: {3224 _enum: {3229 Ed25519: 'SpCoreEd25519Signature',3225 Ed25519: 'SpCoreEd25519Signature',3230 Sr25519: 'SpCoreSr25519Signature',3226 Sr25519: 'SpCoreSr25519Signature',3231 Ecdsa: 'SpCoreEcdsaSignature'3227 Ecdsa: 'SpCoreEcdsaSignature'3232 }3228 }3233 },3229 },3234 /**3230 /**3235 * Lookup440: sp_core::ed25519::Signature3231 * Lookup443: sp_core::ed25519::Signature3236 **/3232 **/3237 SpCoreEd25519Signature: '[u8;64]',3233 SpCoreEd25519Signature: '[u8;64]',3238 /**3234 /**3239 * Lookup442: sp_core::sr25519::Signature3235 * Lookup445: sp_core::sr25519::Signature3240 **/3236 **/3241 SpCoreSr25519Signature: '[u8;64]',3237 SpCoreSr25519Signature: '[u8;64]',3242 /**3238 /**3243 * Lookup443: sp_core::ecdsa::Signature3239 * Lookup446: sp_core::ecdsa::Signature3244 **/3240 **/3245 SpCoreEcdsaSignature: '[u8;65]',3241 SpCoreEcdsaSignature: '[u8;65]',3246 /**3242 /**3247 * Lookup446: frame_system::extensions::check_spec_version::CheckSpecVersion<T>3243 * Lookup449: frame_system::extensions::check_spec_version::CheckSpecVersion<T>3248 **/3244 **/3249 FrameSystemExtensionsCheckSpecVersion: 'Null',3245 FrameSystemExtensionsCheckSpecVersion: 'Null',3250 /**3246 /**3251 * Lookup447: frame_system::extensions::check_genesis::CheckGenesis<T>3247 * Lookup450: frame_system::extensions::check_genesis::CheckGenesis<T>3252 **/3248 **/3253 FrameSystemExtensionsCheckGenesis: 'Null',3249 FrameSystemExtensionsCheckGenesis: 'Null',3254 /**3250 /**3255 * Lookup450: frame_system::extensions::check_nonce::CheckNonce<T>3251 * Lookup453: frame_system::extensions::check_nonce::CheckNonce<T>3256 **/3252 **/3257 FrameSystemExtensionsCheckNonce: 'Compact<u32>',3253 FrameSystemExtensionsCheckNonce: 'Compact<u32>',3258 /**3254 /**3259 * Lookup451: frame_system::extensions::check_weight::CheckWeight<T>3255 * Lookup454: frame_system::extensions::check_weight::CheckWeight<T>3260 **/3256 **/3261 FrameSystemExtensionsCheckWeight: 'Null',3257 FrameSystemExtensionsCheckWeight: 'Null',3262 /**3258 /**3263 * Lookup452: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>3259 * Lookup455: pallet_template_transaction_payment::ChargeTransactionPayment<opal_runtime::Runtime>3264 **/3260 **/3265 PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact<u128>',3261 PalletTemplateTransactionPaymentChargeTransactionPayment: 'Compact<u128>',3266 /**3262 /**3267 * Lookup453: opal_runtime::Runtime3263 * Lookup456: opal_runtime::Runtime3268 **/3264 **/3269 OpalRuntimeRuntime: 'Null',3265 OpalRuntimeRuntime: 'Null',3270 /**3266 /**3271 * Lookup454: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>3267 * Lookup457: pallet_ethereum::FakeTransactionFinalizer<opal_runtime::Runtime>3272 **/3268 **/3273 PalletEthereumFakeTransactionFinalizer: 'Null'3269 PalletEthereumFakeTransactionFinalizer: 'Null'3274};3270};32753271tests/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