difftreelog
test upgrade evm.call arguments
in: master
7 files changed
tests/src/eth/payable.test.tsdiffbeforeafterboth--- a/tests/src/eth/payable.test.ts
+++ b/tests/src/eth/payable.test.ts
@@ -34,6 +34,8 @@
GAS_ARGS.gas,
await web3.eth.getGasPrice(),
null,
+ null,
+ [],
);
const events = await submitTransactionAsync(alice, tx);
const result = getGenericResult(events);
tests/src/eth/util/helpers.tsdiffbeforeafterboth1//2// This file is subject to the terms and conditions defined in3// file 'LICENSE', which is part of this source code package.4//56// eslint-disable-next-line @typescript-eslint/triple-slash-reference7/// <reference path="helpers.d.ts" />89import {ApiPromise} from '@polkadot/api';10import {addressToEvm, evmToAddress} from '@polkadot/util-crypto';11import Web3 from 'web3';12import usingApi, {submitTransactionAsync} from '../../substrate/substrate-api';13import {IKeyringPair} from '@polkadot/types/types';14import {expect} from 'chai';15import {getGenericResult, UNIQUE} from '../../util/helpers';16import * as solc from 'solc';17import config from '../../config';18import privateKey from '../../substrate/privateKey';19import contractHelpersAbi from './contractHelpersAbi.json';20import getBalance from '../../substrate/get-balance';2122export const GAS_ARGS = {gas: 2500000};2324let web3Connected = false;25export async function usingWeb3<T>(cb: (web3: Web3) => Promise<T> | T): Promise<T> {26 if (web3Connected) throw new Error('do not nest usingWeb3 calls');27 web3Connected = true;2829 const provider = new Web3.providers.WebsocketProvider(config.substrateUrl);30 const web3 = new Web3(provider);3132 try {33 return await cb(web3);34 } finally {35 // provider.disconnect(3000, 'normal disconnect');36 provider.connection.close();37 web3Connected = false;38 }39}4041export function collectionIdToAddress(address: number): string {42 if (address >= 0xffffffff || address < 0) throw new Error('id overflow');43 const buf = Buffer.from([0x17, 0xc4, 0xe6, 0x45, 0x3c, 0xc4, 0x9a, 0xaa, 0xae, 0xac, 0xa8, 0x94, 0xe6, 0xd9, 0x68, 0x3e,44 address >> 24,45 (address >> 16) & 0xff,46 (address >> 8) & 0xff,47 address & 0xff,48 ]);49 return Web3.utils.toChecksumAddress('0x' + buf.toString('hex'));50}5152export function createEthAccount(web3: Web3) {53 const account = web3.eth.accounts.create();54 web3.eth.accounts.wallet.add(account.privateKey);55 return account.address;56}5758export async function createEthAccountWithBalance(api: ApiPromise, web3: Web3) {59 const alice = privateKey('//Alice');60 const account = createEthAccount(web3);61 await transferBalanceToEth(api, alice, account);6263 return account;64}6566export async function transferBalanceToEth(api: ApiPromise, source: IKeyringPair, target: string, amount = 1000n * UNIQUE) {67 const tx = api.tx.balances.transfer(evmToAddress(target), amount);68 const events = await submitTransactionAsync(source, tx);69 const result = getGenericResult(events);70 expect(result.success).to.be.true;71}7273export async function itWeb3(name: string, cb: (apis: { web3: Web3, api: ApiPromise }) => any, opts: { only?: boolean, skip?: boolean } = {}) {74 let i: any = it;75 if (opts.only) i = i.only;76 else if (opts.skip) i = i.skip;77 i(name, async () => {78 await usingApi(async api => {79 await usingWeb3(async web3 => {80 await cb({api, web3});81 });82 });83 });84}85itWeb3.only = (name: string, cb: (apis: { web3: Web3, api: ApiPromise }) => any) => itWeb3(name, cb, {only: true});86itWeb3.skip = (name: string, cb: (apis: { web3: Web3, api: ApiPromise }) => any) => itWeb3(name, cb, {skip: true});8788export async function generateSubstrateEthPair(web3: Web3) {89 const account = web3.eth.accounts.create();90 evmToAddress(account.address);91}9293type NormalizedEvent = {94 address: string,95 event: string,96 args: { [key: string]: string }97};9899export function normalizeEvents(events: any): NormalizedEvent[] {100 const output = [];101 for (const key of Object.keys(events)) {102 if (key.match(/^[0-9]+$/)) {103 output.push(events[key]);104 } else if (Array.isArray(events[key])) {105 output.push(...events[key]);106 } else {107 output.push(events[key]);108 }109 }110 output.sort((a, b) => a.logIndex - b.logIndex);111 return output.map(({address, event, returnValues}) => {112 const args: { [key: string]: string } = {};113 for (const key of Object.keys(returnValues)) {114 if (!key.match(/^[0-9]+$/)) {115 args[key] = returnValues[key];116 }117 }118 return {119 address,120 event,121 args,122 };123 });124}125126export async function recordEvents(contract: any, action: () => Promise<void>): Promise<NormalizedEvent[]> {127 const out: any = [];128 contract.events.allEvents((_: any, event: any) => {129 out.push(event);130 });131 await action();132 return normalizeEvents(out);133}134135export function subToEthLowercase(eth: string): string {136 const bytes = addressToEvm(eth);137 return '0x' + Buffer.from(bytes).toString('hex');138}139140export function subToEth(eth: string): string {141 return Web3.utils.toChecksumAddress(subToEthLowercase(eth));142}143144export function compileContract(name: string, src: string) {145 const out = JSON.parse(solc.compile(JSON.stringify({146 language: 'Solidity',147 sources: {148 [`${name}.sol`]: {149 content: `150 // SPDX-License-Identifier: UNLICENSED151 pragma solidity ^0.8.6;152153 ${src}154 `,155 },156 },157 settings: {158 outputSelection: {159 '*': {160 '*': ['*'],161 },162 },163 },164 }))).contracts[`${name}.sol`][name];165166 return {167 abi: out.abi,168 object: '0x' + out.evm.bytecode.object,169 };170}171172export async function deployFlipper(web3: Web3, deployer: string) {173 const compiled = compileContract('Flipper', `174 contract Flipper {175 bool value = false;176 function flip() public {177 value = !value;178 }179 function getValue() public view returns (bool) {180 return value;181 }182 }183 `);184 const flipperContract = new web3.eth.Contract(compiled.abi, undefined, {185 data: compiled.object,186 from: deployer,187 ...GAS_ARGS,188 });189 const flipper = await flipperContract.deploy({data: compiled.object}).send({from: deployer});190191 return flipper;192}193194export async function deployCollector(web3: Web3, deployer: string) {195 const compiled = compileContract('Collector', `196 contract Collector {197 uint256 collected;198 fallback() external payable {199 giveMoney();200 }201 function giveMoney() public payable {202 collected += msg.value;203 }204 function getCollected() public view returns (uint256) {205 return collected;206 }207 function getUnaccounted() public view returns (uint256) {208 return address(this).balance - collected;209 }210211 function withdraw(address payable target) public {212 target.transfer(collected);213 collected = 0;214 }215 }216 `);217 const collectorContract = new web3.eth.Contract(compiled.abi, undefined, {218 data: compiled.object,219 from: deployer,220 ...GAS_ARGS,221 });222 const collector = await collectorContract.deploy({data: compiled.object}).send({from: deployer});223224 return collector;225}226227export function contractHelpers(web3: Web3, caller: string) {228 return new web3.eth.Contract(contractHelpersAbi as any, '0x842899ECF380553E8a4de75bF534cdf6fBF64049', {from: caller, ...GAS_ARGS});229}230231/**232 * Execute ethereum method call using substrate account233 * @param to target contract234 * @param mkTx - closure, receiving `contract.methods`, and returning method call,235 * to be used as following (assuming `to` = erc20 contract):236 * `m => m.transfer(to, amount)`237 *238 * # Example239 * ```ts240 * executeEthTxOnSub(api, alice, erc20Contract, m => m.transfer(target, amount));241 * ```242 */243export async function executeEthTxOnSub(web3: Web3, api: ApiPromise, from: IKeyringPair, to: any, mkTx: (methods: any) => any, {value = 0}: {value?: bigint | number} = { }) {244 const tx = api.tx.evm.call(245 subToEth(from.address),246 to.options.address,247 mkTx(to.methods).encodeABI(),248 value,249 GAS_ARGS.gas,250 await web3.eth.getGasPrice(),251 null,252 );253 const events = await submitTransactionAsync(from, tx);254 expect(events.some(({event: {section, method}}) => section == 'evm' && method == 'Executed')).to.be.true;255}256257export async function ethBalanceViaSub(api: ApiPromise, address: string): Promise<bigint> {258 return (await getBalance(api, [evmToAddress(address)]))[0];259}260261/**262 * Measure how much gas given closure consumes263 *264 * @param user which user balance will be checked265 */266export async function recordEthFee(api: ApiPromise, user: string, call: () => Promise<any>): Promise<bigint> {267 const before = await ethBalanceViaSub(api, user);268269 await call();270271 const after = await ethBalanceViaSub(api, user);272273 // Can't use .to.be.less, because chai doesn't supports bigint274 expect(after < before).to.be.true;275276 return before - after;277}1//2// This file is subject to the terms and conditions defined in3// file 'LICENSE', which is part of this source code package.4//56// eslint-disable-next-line @typescript-eslint/triple-slash-reference7/// <reference path="helpers.d.ts" />89import {ApiPromise} from '@polkadot/api';10import {addressToEvm, evmToAddress} from '@polkadot/util-crypto';11import Web3 from 'web3';12import usingApi, {submitTransactionAsync} from '../../substrate/substrate-api';13import {IKeyringPair} from '@polkadot/types/types';14import {expect} from 'chai';15import {getGenericResult, UNIQUE} from '../../util/helpers';16import * as solc from 'solc';17import config from '../../config';18import privateKey from '../../substrate/privateKey';19import contractHelpersAbi from './contractHelpersAbi.json';20import getBalance from '../../substrate/get-balance';2122export const GAS_ARGS = {gas: 2500000};2324let web3Connected = false;25export async function usingWeb3<T>(cb: (web3: Web3) => Promise<T> | T): Promise<T> {26 if (web3Connected) throw new Error('do not nest usingWeb3 calls');27 web3Connected = true;2829 const provider = new Web3.providers.WebsocketProvider(config.substrateUrl);30 const web3 = new Web3(provider);3132 try {33 return await cb(web3);34 } finally {35 // provider.disconnect(3000, 'normal disconnect');36 provider.connection.close();37 web3Connected = false;38 }39}4041export function collectionIdToAddress(address: number): string {42 if (address >= 0xffffffff || address < 0) throw new Error('id overflow');43 const buf = Buffer.from([0x17, 0xc4, 0xe6, 0x45, 0x3c, 0xc4, 0x9a, 0xaa, 0xae, 0xac, 0xa8, 0x94, 0xe6, 0xd9, 0x68, 0x3e,44 address >> 24,45 (address >> 16) & 0xff,46 (address >> 8) & 0xff,47 address & 0xff,48 ]);49 return Web3.utils.toChecksumAddress('0x' + buf.toString('hex'));50}5152export function createEthAccount(web3: Web3) {53 const account = web3.eth.accounts.create();54 web3.eth.accounts.wallet.add(account.privateKey);55 return account.address;56}5758export async function createEthAccountWithBalance(api: ApiPromise, web3: Web3) {59 const alice = privateKey('//Alice');60 const account = createEthAccount(web3);61 await transferBalanceToEth(api, alice, account);6263 return account;64}6566export async function transferBalanceToEth(api: ApiPromise, source: IKeyringPair, target: string, amount = 1000n * UNIQUE) {67 const tx = api.tx.balances.transfer(evmToAddress(target), amount);68 const events = await submitTransactionAsync(source, tx);69 const result = getGenericResult(events);70 expect(result.success).to.be.true;71}7273export async function itWeb3(name: string, cb: (apis: { web3: Web3, api: ApiPromise }) => any, opts: { only?: boolean, skip?: boolean } = {}) {74 let i: any = it;75 if (opts.only) i = i.only;76 else if (opts.skip) i = i.skip;77 i(name, async () => {78 await usingApi(async api => {79 await usingWeb3(async web3 => {80 await cb({api, web3});81 });82 });83 });84}85itWeb3.only = (name: string, cb: (apis: { web3: Web3, api: ApiPromise }) => any) => itWeb3(name, cb, {only: true});86itWeb3.skip = (name: string, cb: (apis: { web3: Web3, api: ApiPromise }) => any) => itWeb3(name, cb, {skip: true});8788export async function generateSubstrateEthPair(web3: Web3) {89 const account = web3.eth.accounts.create();90 evmToAddress(account.address);91}9293type NormalizedEvent = {94 address: string,95 event: string,96 args: { [key: string]: string }97};9899export function normalizeEvents(events: any): NormalizedEvent[] {100 const output = [];101 for (const key of Object.keys(events)) {102 if (key.match(/^[0-9]+$/)) {103 output.push(events[key]);104 } else if (Array.isArray(events[key])) {105 output.push(...events[key]);106 } else {107 output.push(events[key]);108 }109 }110 output.sort((a, b) => a.logIndex - b.logIndex);111 return output.map(({address, event, returnValues}) => {112 const args: { [key: string]: string } = {};113 for (const key of Object.keys(returnValues)) {114 if (!key.match(/^[0-9]+$/)) {115 args[key] = returnValues[key];116 }117 }118 return {119 address,120 event,121 args,122 };123 });124}125126export async function recordEvents(contract: any, action: () => Promise<void>): Promise<NormalizedEvent[]> {127 const out: any = [];128 contract.events.allEvents((_: any, event: any) => {129 out.push(event);130 });131 await action();132 return normalizeEvents(out);133}134135export function subToEthLowercase(eth: string): string {136 const bytes = addressToEvm(eth);137 return '0x' + Buffer.from(bytes).toString('hex');138}139140export function subToEth(eth: string): string {141 return Web3.utils.toChecksumAddress(subToEthLowercase(eth));142}143144export function compileContract(name: string, src: string) {145 const out = JSON.parse(solc.compile(JSON.stringify({146 language: 'Solidity',147 sources: {148 [`${name}.sol`]: {149 content: `150 // SPDX-License-Identifier: UNLICENSED151 pragma solidity ^0.8.6;152153 ${src}154 `,155 },156 },157 settings: {158 outputSelection: {159 '*': {160 '*': ['*'],161 },162 },163 },164 }))).contracts[`${name}.sol`][name];165166 return {167 abi: out.abi,168 object: '0x' + out.evm.bytecode.object,169 };170}171172export async function deployFlipper(web3: Web3, deployer: string) {173 const compiled = compileContract('Flipper', `174 contract Flipper {175 bool value = false;176 function flip() public {177 value = !value;178 }179 function getValue() public view returns (bool) {180 return value;181 }182 }183 `);184 const flipperContract = new web3.eth.Contract(compiled.abi, undefined, {185 data: compiled.object,186 from: deployer,187 ...GAS_ARGS,188 });189 const flipper = await flipperContract.deploy({data: compiled.object}).send({from: deployer});190191 return flipper;192}193194export async function deployCollector(web3: Web3, deployer: string) {195 const compiled = compileContract('Collector', `196 contract Collector {197 uint256 collected;198 fallback() external payable {199 giveMoney();200 }201 function giveMoney() public payable {202 collected += msg.value;203 }204 function getCollected() public view returns (uint256) {205 return collected;206 }207 function getUnaccounted() public view returns (uint256) {208 return address(this).balance - collected;209 }210211 function withdraw(address payable target) public {212 target.transfer(collected);213 collected = 0;214 }215 }216 `);217 const collectorContract = new web3.eth.Contract(compiled.abi, undefined, {218 data: compiled.object,219 from: deployer,220 ...GAS_ARGS,221 });222 const collector = await collectorContract.deploy({data: compiled.object}).send({from: deployer});223224 return collector;225}226227export function contractHelpers(web3: Web3, caller: string) {228 return new web3.eth.Contract(contractHelpersAbi as any, '0x842899ECF380553E8a4de75bF534cdf6fBF64049', {from: caller, ...GAS_ARGS});229}230231/**232 * Execute ethereum method call using substrate account233 * @param to target contract234 * @param mkTx - closure, receiving `contract.methods`, and returning method call,235 * to be used as following (assuming `to` = erc20 contract):236 * `m => m.transfer(to, amount)`237 *238 * # Example239 * ```ts240 * executeEthTxOnSub(api, alice, erc20Contract, m => m.transfer(target, amount));241 * ```242 */243export async function executeEthTxOnSub(web3: Web3, api: ApiPromise, from: IKeyringPair, to: any, mkTx: (methods: any) => any, {value = 0}: {value?: bigint | number} = { }) {244 const tx = api.tx.evm.call(245 subToEth(from.address),246 to.options.address,247 mkTx(to.methods).encodeABI(),248 value,249 GAS_ARGS.gas,250 await web3.eth.getGasPrice(),251 null,252 null,253 [],254 );255 const events = await submitTransactionAsync(from, tx);256 expect(events.some(({event: {section, method}}) => section == 'evm' && method == 'Executed')).to.be.true;257}258259export async function ethBalanceViaSub(api: ApiPromise, address: string): Promise<bigint> {260 return (await getBalance(api, [evmToAddress(address)]))[0];261}262263/**264 * Measure how much gas given closure consumes265 *266 * @param user which user balance will be checked267 */268export async function recordEthFee(api: ApiPromise, user: string, call: () => Promise<any>): Promise<bigint> {269 const before = await ethBalanceViaSub(api, user);270271 await call();272273 const after = await ethBalanceViaSub(api, user);274275 // Can't use .to.be.less, because chai doesn't supports bigint276 expect(after < before).to.be.true;277278 return before - after;279}tests/src/interfaces/augment-api-consts.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-consts.ts
+++ b/tests/src/interfaces/augment-api-consts.ts
@@ -2,7 +2,7 @@
/* eslint-disable */
import type { ApiTypes } from '@polkadot/api/types';
-import type { Vec, u128, u16, u32, u64, u8 } from '@polkadot/types';
+import type { Option, Vec, u128, u16, u32, u64, u8 } from '@polkadot/types';
import type { Permill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportPalletId, FrameSupportWeightsRuntimeDbWeight, FrameSupportWeightsWeightToFeeCoefficient, FrameSystemLimitsBlockLength, FrameSystemLimitsBlockWeights, SpVersionRuntimeVersion } from '@polkadot/types/lookup';
import type { Codec } from '@polkadot/types/types';
@@ -36,6 +36,9 @@
[key: string]: Codec;
};
inflation: {
+ /**
+ * Number of blocks that pass between treasury balance updates due to inflation
+ **/
inflationBlockInterval: u32 & AugmentedConst<ApiType>;
/**
* Generic const
@@ -146,6 +149,10 @@
**/
proposalBond: Permill & AugmentedConst<ApiType>;
/**
+ * Maximum amount of funds that should be placed in a deposit for making a proposal.
+ **/
+ proposalBondMaximum: Option<u128> & AugmentedConst<ApiType>;
+ /**
* Minimum amount of funds that should be placed in a deposit for making a proposal.
**/
proposalBondMinimum: u128 & AugmentedConst<ApiType>;
tests/src/interfaces/augment-api-errors.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-errors.ts
+++ b/tests/src/interfaces/augment-api-errors.ts
@@ -61,9 +61,9 @@
**/
CantApproveMoreThanOwned: AugmentedError<ApiType>;
/**
- * Exceeded max admin amount
+ * Exceeded max admin count
**/
- CollectionAdminAmountExceeded: AugmentedError<ApiType>;
+ CollectionAdminCountExceeded: AugmentedError<ApiType>;
/**
* Collection description can not be longer than 255 char.
**/
@@ -227,7 +227,7 @@
/**
* Tried to set data for fungible item
**/
- FungibleItemsHaveData: AugmentedError<ApiType>;
+ FungibleItemsDontHaveData: AugmentedError<ApiType>;
/**
* Not default id passed as TokenId argument
**/
@@ -381,6 +381,10 @@
};
system: {
/**
+ * The origin filter prevent the call to be dispatched.
+ **/
+ CallFiltered: AugmentedError<ApiType>;
+ /**
* Failed to extract the runtime version from the new runtime.
*
* Either calling `Core_version` or decoding `RuntimeVersion` failed.
@@ -485,6 +489,10 @@
};
xcmpQueue: {
/**
+ * Bad overweight index.
+ **/
+ BadOverweightIndex: AugmentedError<ApiType>;
+ /**
* Bad XCM data.
**/
BadXcm: AugmentedError<ApiType>;
@@ -497,6 +505,10 @@
**/
FailedToSend: AugmentedError<ApiType>;
/**
+ * Provided weight is possibly not enough to execute the message.
+ **/
+ WeightOverLimit: AugmentedError<ApiType>;
+ /**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
tests/src/interfaces/augment-api-events.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-events.ts
+++ b/tests/src/interfaces/augment-api-events.ts
@@ -2,7 +2,7 @@
/* eslint-disable */
import type { EthereumLog, EvmCoreErrorExitReason } from './ethereum';
-import type { PalletCommonAccountBasicCrossAccountIdRepr } from './unique';
+import type { PalletCommonAccountBasicCrossAccountIdRepr, UpDataStructsAccessMode } from './unique';
import type { ApiTypes } from '@polkadot/api/types';
import type { Null, Option, Result, U256, U8aFixed, u128, u32, u64, u8 } from '@polkadot/types';
import type { AccountId32, H160, H256 } from '@polkadot/types/interfaces/runtime';
@@ -12,48 +12,45 @@
export interface AugmentedEvents<ApiType> {
balances: {
/**
- * A balance was set by root. \[who, free, reserved\]
+ * A balance was set by root.
**/
BalanceSet: AugmentedEvent<ApiType, [AccountId32, u128, u128]>;
/**
- * Some amount was deposited into the account (e.g. for transaction fees). \[who,
- * deposit\]
+ * Some amount was deposited (e.g. for transaction fees).
**/
Deposit: AugmentedEvent<ApiType, [AccountId32, u128]>;
/**
* An account was removed whose balance was non-zero but below ExistentialDeposit,
- * resulting in an outright loss. \[account, balance\]
+ * resulting in an outright loss.
**/
DustLost: AugmentedEvent<ApiType, [AccountId32, u128]>;
/**
- * An account was created with some free balance. \[account, free_balance\]
+ * An account was created with some free balance.
**/
Endowed: AugmentedEvent<ApiType, [AccountId32, u128]>;
/**
- * Some balance was reserved (moved from free to reserved). \[who, value\]
+ * Some balance was reserved (moved from free to reserved).
**/
Reserved: AugmentedEvent<ApiType, [AccountId32, u128]>;
/**
* Some balance was moved from the reserve of the first account to the second account.
* Final argument indicates the destination balance type.
- * \[from, to, balance, destination_status\]
**/
ReserveRepatriated: AugmentedEvent<ApiType, [AccountId32, AccountId32, u128, FrameSupportTokensMiscBalanceStatus]>;
/**
- * Some amount was removed from the account (e.g. for misbehavior). \[who,
- * amount_slashed\]
+ * Some amount was removed from the account (e.g. for misbehavior).
**/
Slashed: AugmentedEvent<ApiType, [AccountId32, u128]>;
/**
- * Transfer succeeded. \[from, to, value\]
+ * Transfer succeeded.
**/
Transfer: AugmentedEvent<ApiType, [AccountId32, AccountId32, u128]>;
/**
- * Some balance was unreserved (moved from reserved to free). \[who, value\]
+ * Some balance was unreserved (moved from reserved to free).
**/
Unreserved: AugmentedEvent<ApiType, [AccountId32, u128]>;
/**
- * Some amount was withdrawn from the account (e.g. for transaction fees). \[who, value\]
+ * Some amount was withdrawn from the account (e.g. for transaction fees).
**/
Withdraw: AugmentedEvent<ApiType, [AccountId32, u128]>;
/**
@@ -87,6 +84,14 @@
**/
CollectionCreated: AugmentedEvent<ApiType, [u32, u8, AccountId32]>;
/**
+ * New collection was destroyed
+ *
+ * # Arguments
+ *
+ * * collection_id: Globally unique identifier of collection.
+ **/
+ CollectionDestroyed: AugmentedEvent<ApiType, [u32]>;
+ /**
* New item was created.
*
* # Arguments
@@ -289,7 +294,7 @@
InvalidResponder: AugmentedEvent<ApiType, [XcmV1MultiLocation, u64, Option<XcmV1MultiLocation>]>;
/**
* Expected query response has been received but the expected origin location placed in
- * storate by this runtime previously cannot be decoded. The query remains registered.
+ * storage by this runtime previously cannot be decoded. The query remains registered.
*
* This is unexpected (since a location placed in storage in a previously executing
* runtime should be readable prior to query timeout) and dangerous since the possibly
@@ -390,9 +395,9 @@
};
sudo: {
/**
- * The \[sudoer\] just switched identity; the old key is supplied.
+ * The \[sudoer\] just switched identity; the old key is supplied if one existed.
**/
- KeyChanged: AugmentedEvent<ApiType, [AccountId32]>;
+ KeyChanged: AugmentedEvent<ApiType, [Option<AccountId32>]>;
/**
* A sudo just took place. \[result\]
**/
@@ -412,23 +417,23 @@
**/
CodeUpdated: AugmentedEvent<ApiType, []>;
/**
- * An extrinsic failed. \[error, info\]
+ * An extrinsic failed.
**/
ExtrinsicFailed: AugmentedEvent<ApiType, [SpRuntimeDispatchError, FrameSupportWeightsDispatchInfo]>;
/**
- * An extrinsic completed successfully. \[info\]
+ * An extrinsic completed successfully.
**/
ExtrinsicSuccess: AugmentedEvent<ApiType, [FrameSupportWeightsDispatchInfo]>;
/**
- * An \[account\] was reaped.
+ * An account was reaped.
**/
KilledAccount: AugmentedEvent<ApiType, [AccountId32]>;
/**
- * A new \[account\] was created.
+ * A new account was created.
**/
NewAccount: AugmentedEvent<ApiType, [AccountId32]>;
/**
- * On on-chain remark happened. \[origin, remark_hash\]
+ * On on-chain remark happened.
**/
Remarked: AugmentedEvent<ApiType, [AccountId32, H256]>;
/**
@@ -438,32 +443,31 @@
};
treasury: {
/**
- * Some funds have been allocated. \[proposal_index, award, beneficiary\]
+ * Some funds have been allocated.
**/
Awarded: AugmentedEvent<ApiType, [u32, u128, AccountId32]>;
/**
- * Some of our funds have been burnt. \[burn\]
+ * Some of our funds have been burnt.
**/
Burnt: AugmentedEvent<ApiType, [u128]>;
/**
- * Some funds have been deposited. \[deposit\]
+ * Some funds have been deposited.
**/
Deposit: AugmentedEvent<ApiType, [u128]>;
/**
- * New proposal. \[proposal_index\]
+ * New proposal.
**/
Proposed: AugmentedEvent<ApiType, [u32]>;
/**
- * A proposal was rejected; funds were slashed. \[proposal_index, slashed\]
+ * A proposal was rejected; funds were slashed.
**/
Rejected: AugmentedEvent<ApiType, [u32, u128]>;
/**
* Spending has finished; this is the amount that rolls over until next spend.
- * \[budget_remaining\]
**/
Rollover: AugmentedEvent<ApiType, [u128]>;
/**
- * We have ended a spend period and will now allocate funds. \[budget_remaining\]
+ * We have ended a spend period and will now allocate funds.
**/
Spending: AugmentedEvent<ApiType, [u128]>;
/**
@@ -471,17 +475,159 @@
**/
[key: string]: AugmentedEvent<ApiType>;
};
+ unique: {
+ /**
+ * Address was add to allow list
+ *
+ * # Arguments
+ *
+ * * collection_id: Globally unique collection identifier.
+ *
+ * * user: Address.
+ **/
+ AllowListAddressAdded: AugmentedEvent<ApiType, [u32, PalletCommonAccountBasicCrossAccountIdRepr]>;
+ /**
+ * Address was remove from allow list
+ *
+ * # Arguments
+ *
+ * * collection_id: Globally unique collection identifier.
+ *
+ * * user: Address.
+ **/
+ AllowListAddressRemoved: AugmentedEvent<ApiType, [u32, PalletCommonAccountBasicCrossAccountIdRepr]>;
+ /**
+ * Collection admin was added
+ *
+ * # Arguments
+ *
+ * * collection_id: Globally unique collection identifier.
+ *
+ * * admin: Admin address.
+ **/
+ CollectionAdminAdded: AugmentedEvent<ApiType, [u32, PalletCommonAccountBasicCrossAccountIdRepr]>;
+ /**
+ * Collection admin was removed
+ *
+ * # Arguments
+ *
+ * * collection_id: Globally unique collection identifier.
+ *
+ * * admin: Admin address.
+ **/
+ CollectionAdminRemoved: AugmentedEvent<ApiType, [u32, PalletCommonAccountBasicCrossAccountIdRepr]>;
+ /**
+ * Collection limits was set
+ *
+ * # Arguments
+ *
+ * * collection_id: Globally unique collection identifier.
+ **/
+ CollectionLimitSet: AugmentedEvent<ApiType, [u32]>;
+ /**
+ * Collection owned was change
+ *
+ * # Arguments
+ *
+ * * collection_id: Globally unique collection identifier.
+ *
+ * * owner: New owner address.
+ **/
+ CollectionOwnedChanged: AugmentedEvent<ApiType, [u32, AccountId32]>;
+ /**
+ * Collection sponsor was removed
+ *
+ * # Arguments
+ *
+ * * collection_id: Globally unique collection identifier.
+ **/
+ CollectionSponsorRemoved: AugmentedEvent<ApiType, [u32]>;
+ /**
+ * Collection sponsor was set
+ *
+ * # Arguments
+ *
+ * * collection_id: Globally unique collection identifier.
+ *
+ * * owner: New sponsor address.
+ **/
+ CollectionSponsorSet: AugmentedEvent<ApiType, [u32, AccountId32]>;
+ /**
+ * const on chain schema was set
+ *
+ * # Arguments
+ *
+ * * collection_id: Globally unique collection identifier.
+ **/
+ ConstOnChainSchemaSet: AugmentedEvent<ApiType, [u32]>;
+ /**
+ * Mint permission was set
+ *
+ * # Arguments
+ *
+ * * collection_id: Globally unique collection identifier.
+ **/
+ MintPermissionSet: AugmentedEvent<ApiType, [u32]>;
+ /**
+ * Offchain schema was set
+ *
+ * # Arguments
+ *
+ * * collection_id: Globally unique collection identifier.
+ **/
+ OffchainSchemaSet: AugmentedEvent<ApiType, [u32]>;
+ /**
+ * Public access mode was set
+ *
+ * # Arguments
+ *
+ * * collection_id: Globally unique collection identifier.
+ *
+ * * mode: New access state.
+ **/
+ PublicAccessModeSet: AugmentedEvent<ApiType, [u32, UpDataStructsAccessMode]>;
+ /**
+ * Schema version was set
+ *
+ * # Arguments
+ *
+ * * collection_id: Globally unique collection identifier.
+ **/
+ SchemaVersionSet: AugmentedEvent<ApiType, [u32]>;
+ /**
+ * New sponsor was confirm
+ *
+ * # Arguments
+ *
+ * * collection_id: Globally unique collection identifier.
+ *
+ * * sponsor: New sponsor address.
+ **/
+ SponsorshipConfirmed: AugmentedEvent<ApiType, [u32, AccountId32]>;
+ /**
+ * Variable on chain schema was set
+ *
+ * # Arguments
+ *
+ * * collection_id: Globally unique collection identifier.
+ **/
+ VariableOnChainSchemaSet: AugmentedEvent<ApiType, [u32]>;
+ /**
+ * Generic event
+ **/
+ [key: string]: AugmentedEvent<ApiType>;
+ };
vesting: {
/**
- * Claimed vesting. \[who, locked_amount\]
+ * Claimed vesting.
**/
Claimed: AugmentedEvent<ApiType, [AccountId32, u128]>;
/**
- * Added new vesting schedule. \[from, to, vesting_schedule\]
+ * Added new vesting schedule.
**/
VestingScheduleAdded: AugmentedEvent<ApiType, [AccountId32, AccountId32, OrmlVestingVestingSchedule]>;
/**
- * Updated vesting schedules. \[who\]
+ * Updated vesting schedules.
**/
VestingSchedulesUpdated: AugmentedEvent<ApiType, [AccountId32]>;
/**
@@ -503,6 +649,14 @@
**/
Fail: AugmentedEvent<ApiType, [Option<H256>, XcmV2TraitsError]>;
/**
+ * An XCM exceeded the individual message weight budget.
+ **/
+ OverweightEnqueued: AugmentedEvent<ApiType, [u32, u32, u64, u64]>;
+ /**
+ * An XCM from the overweight queue was executed with the given actual weight used.
+ **/
+ OverweightServiced: AugmentedEvent<ApiType, [u64, u64]>;
+ /**
* Some XCM was executed ok.
**/
Success: AugmentedEvent<ApiType, [Option<H256>]>;
tests/src/interfaces/augment-api-query.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-query.ts
+++ b/tests/src/interfaces/augment-api-query.ts
@@ -1,8 +1,8 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
-import type { EthereumBlock, EthereumReceipt, EthereumTransactionLegacyTransaction, FpRpcTransactionStatus } from './ethereum';
-import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueInboundStatus, CumulusPalletXcmpQueueOutboundStatus, CumulusPalletXcmpQueueQueueConfigData, PolkadotParachainPrimitivesXcmpMessageFormat, PolkadotPrimitivesV1AbridgedHostConfiguration, PolkadotPrimitivesV1PersistedValidationData } from './polkadot';
+import type { EthereumBlock, FpRpcTransactionStatus } from './ethereum';
+import type { CumulusPalletDmpQueueConfigData, CumulusPalletDmpQueuePageIndexData, CumulusPalletParachainSystemRelayStateSnapshotMessagingStateSnapshot, CumulusPalletXcmpQueueQueueConfigData, PolkadotPrimitivesV1AbridgedHostConfiguration, PolkadotPrimitivesV1PersistedValidationData } from './polkadot';
import type { PalletCommonAccountBasicCrossAccountIdRepr, PalletNonfungibleItemData, PalletRefungibleItemData, UpDataStructsCollection, UpDataStructsCollectionStats } from './unique';
import type { ApiTypes } from '@polkadot/api/types';
import type { BTreeMap, Bytes, Option, U256, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types';
@@ -105,7 +105,7 @@
/**
* The current Ethereum receipts.
**/
- currentReceipts: AugmentedQuery<ApiType, () => Observable<Option<Vec<EthereumReceipt>>>, []> & QueryableStorageEntry<ApiType, []>;
+ currentReceipts: AugmentedQuery<ApiType, () => Observable<Option<Vec<EthereumReceiptReceiptV3>>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The current transaction statuses.
**/
@@ -113,7 +113,7 @@
/**
* Current building block's transactions and receipts.
**/
- pending: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[EthereumTransactionLegacyTransaction, FpRpcTransactionStatus, EthereumReceipt]>>>, []> & QueryableStorageEntry<ApiType, []>;
+ pending: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[EthereumTransactionTransactionV2, FpRpcTransactionStatus, EthereumReceiptReceiptV3]>>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
@@ -163,10 +163,22 @@
};
inflation: {
/**
- * Current block inflation
+ * Current inflation for `InflationBlockInterval` number of blocks
**/
blockInflation: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
/**
+ * Next target (relay) block when inflation will be applied
+ **/
+ nextInflationBlock: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
+ /**
+ * Next target (relay) block when inflation is recalculated
+ **/
+ nextRecalculationBlock: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
+ /**
+ * Relay block when inflation has started
+ **/
+ startBlock: AugmentedQuery<ApiType, () => Observable<u32>, []> & QueryableStorageEntry<ApiType, []>;
+ /**
* starting year total issuance
**/
startingYearTotalIssuance: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
@@ -208,6 +220,12 @@
**/
authorizedUpgrade: AugmentedQuery<ApiType, () => Observable<Option<H256>>, []> & QueryableStorageEntry<ApiType, []>;
/**
+ * A custom head data that should be returned as result of `validate_block`.
+ *
+ * See [`Pallet::set_custom_validation_head_data`] for more information.
+ **/
+ customValidationHeadData: AugmentedQuery<ApiType, () => Observable<Option<Bytes>>, []> & QueryableStorageEntry<ApiType, []>;
+ /**
* Were the validation data set to notify the relay chain?
**/
didSetValidationCode: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
@@ -353,7 +371,7 @@
/**
* The `AccountId` of the sudo key.
**/
- key: AugmentedQuery<ApiType, () => Observable<AccountId32>, []> & QueryableStorageEntry<ApiType, []>;
+ key: AugmentedQuery<ApiType, () => Observable<Option<AccountId32>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Generic query
**/
@@ -540,7 +558,7 @@
/**
* Status of the inbound XCMP channels.
**/
- inboundXcmpStatus: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[u32, CumulusPalletXcmpQueueInboundStatus, Vec<ITuple<[u32, PolkadotParachainPrimitivesXcmpMessageFormat]>>]>>>, []> & QueryableStorageEntry<ApiType, []>;
+ inboundXcmpStatus: AugmentedQuery<ApiType, () => Observable<Vec<CumulusPalletXcmpQueueInboundChannelDetails>>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The messages outbound in a given XCMP channel.
**/
@@ -553,7 +571,19 @@
* case of the need to send a high-priority signal message this block.
* The bool is true if there is a signal message waiting to be sent.
**/
- outboundXcmpStatus: AugmentedQuery<ApiType, () => Observable<Vec<ITuple<[u32, CumulusPalletXcmpQueueOutboundStatus, bool, u16, u16]>>>, []> & QueryableStorageEntry<ApiType, []>;
+ outboundXcmpStatus: AugmentedQuery<ApiType, () => Observable<Vec<CumulusPalletXcmpQueueOutboundChannelDetails>>, []> & QueryableStorageEntry<ApiType, []>;
+ /**
+ * The messages that exceeded max individual message weight budget.
+ *
+ * These message stay in this storage map until they are manually dispatched via
+ * `service_overweight`.
+ **/
+ overweight: AugmentedQuery<ApiType, (arg: u64 | AnyNumber | Uint8Array) => Observable<Option<ITuple<[u32, u32, Bytes]>>>, [u64]> & QueryableStorageEntry<ApiType, [u64]>;
+ /**
+ * The number of overweight messages ever recorded in `Overweight`. Also doubles as the next
+ * available free overweight index.
+ **/
+ overweightCount: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>;
/**
* The configuration which controls the dynamics of the outbound queue.
**/
tests/src/interfaces/augment-api-tx.tsdiffbeforeafterboth--- a/tests/src/interfaces/augment-api-tx.ts
+++ b/tests/src/interfaces/augment-api-tx.ts
@@ -1,14 +1,13 @@
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
-import type { EthereumTransactionLegacyTransaction } from './ethereum';
import type { CumulusPrimitivesParachainInherentParachainInherentData } from './polkadot';
import type { PalletCommonAccountBasicCrossAccountIdRepr, UpDataStructsAccessMode, UpDataStructsCollectionLimits, UpDataStructsCollectionMode, UpDataStructsCreateItemData, UpDataStructsMetaUpdatePermission, UpDataStructsSchemaVersion } from './unique';
import type { ApiTypes, SubmittableExtrinsic } from '@polkadot/api/types';
import type { Bytes, Compact, Option, U256, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types';
import type { Extrinsic } from '@polkadot/types/interfaces/extrinsics';
import type { AccountId32, Call, H160, H256, MultiAddress, Perbill } from '@polkadot/types/interfaces/runtime';
-import type { SpCoreChangesTrieChangesTrieConfiguration, XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
+import type { XcmV1MultiLocation, XcmV2WeightLimit, XcmVersionedMultiAssets, XcmVersionedMultiLocation, XcmVersionedXcm } from '@polkadot/types/lookup';
import type { AnyNumber, ITuple } from '@polkadot/types/types';
declare module '@polkadot/api/types/submittable' {
@@ -33,28 +32,17 @@
* Set the balances of a given account.
*
* This will alter `FreeBalance` and `ReservedBalance` in storage. it will
- * also decrease the total issuance of the system (`TotalIssuance`).
+ * also alter the total issuance of the system (`TotalIssuance`) appropriately.
* If the new free or reserved balance is below the existential deposit,
* it will reset the account nonce (`frame_system::AccountNonce`).
*
* The dispatch origin for this call is `root`.
- *
- * # <weight>
- * - Independent of the arguments.
- * - Contains a limited number of reads and writes.
- * ---------------------
- * - Base Weight:
- * - Creating: 27.56 µs
- * - Killing: 35.11 µs
- * - DB Weight: 1 Read, 1 Write to `who`
- * # </weight>
**/
setBalance: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, newFree: Compact<u128> | AnyNumber | Uint8Array, newReserved: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, Compact<u128>, Compact<u128>]>;
/**
* Transfer some liquid free balance to another account.
*
* `transfer` will set the `FreeBalance` of the sender and receiver.
- * It will decrease the total issuance of the system by the `TransferFee`.
* If the sender's account is below the existential deposit as a result
* of the transfer, the account will be reaped.
*
@@ -75,8 +63,6 @@
* - `transfer_keep_alive` works the same way as `transfer`, but has an additional check
* that the transfer will not kill the origin account.
* ---------------------------------
- * - Base Weight: 73.64 µs, worst case scenario (account created, account removed)
- * - DB Weight: 1 Read and 1 Write to destination account
* - Origin account is already in memory, so no DB operations for them.
* # </weight>
**/
@@ -108,11 +94,6 @@
* 99% of the time you want [`transfer`] instead.
*
* [`transfer`]: struct.Pallet.html#method.transfer
- * # <weight>
- * - Cheaper than transfer because account cannot be killed.
- * - Base Weight: 51.4 µs
- * - DB Weight: 1 Read and 1 Write to dest (sender is in overlay already)
- * #</weight>
**/
transferKeepAlive: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, value: Compact<u128> | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, Compact<u128>]>;
/**
@@ -157,7 +138,7 @@
/**
* Transact an Ethereum transaction.
**/
- transact: AugmentedSubmittable<(transaction: EthereumTransactionLegacyTransaction | { nonce?: any; gasPrice?: any; gasLimit?: any; action?: any; value?: any; input?: any; signature?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [EthereumTransactionLegacyTransaction]>;
+ transact: AugmentedSubmittable<(transaction: EthereumTransactionTransactionV2 | { Legacy: any } | { EIP2930: any } | { EIP1559: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [EthereumTransactionTransactionV2]>;
/**
* Generic tx
**/
@@ -167,16 +148,16 @@
/**
* Issue an EVM call operation. This is similar to a message call transaction in Ethereum.
**/
- call: AugmentedSubmittable<(source: H160 | string | Uint8Array, target: H160 | string | Uint8Array, input: Bytes | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, gasPrice: U256 | AnyNumber | Uint8Array, nonce: Option<U256> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160, H160, Bytes, U256, u64, U256, Option<U256>]>;
+ call: AugmentedSubmittable<(source: H160 | string | Uint8Array, target: H160 | string | Uint8Array, input: Bytes | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option<U256> | null | object | string | Uint8Array, nonce: Option<U256> | null | object | string | Uint8Array, accessList: Vec<ITuple<[H160, Vec<H256>]>> | ([H160 | string | Uint8Array, Vec<H256> | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic<ApiType>, [H160, H160, Bytes, U256, u64, U256, Option<U256>, Option<U256>, Vec<ITuple<[H160, Vec<H256>]>>]>;
/**
* Issue an EVM create operation. This is similar to a contract creation transaction in
* Ethereum.
**/
- create: AugmentedSubmittable<(source: H160 | string | Uint8Array, init: Bytes | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, gasPrice: U256 | AnyNumber | Uint8Array, nonce: Option<U256> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160, Bytes, U256, u64, U256, Option<U256>]>;
+ create: AugmentedSubmittable<(source: H160 | string | Uint8Array, init: Bytes | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option<U256> | null | object | string | Uint8Array, nonce: Option<U256> | null | object | string | Uint8Array, accessList: Vec<ITuple<[H160, Vec<H256>]>> | ([H160 | string | Uint8Array, Vec<H256> | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic<ApiType>, [H160, Bytes, U256, u64, U256, Option<U256>, Option<U256>, Vec<ITuple<[H160, Vec<H256>]>>]>;
/**
* Issue an EVM create2 operation.
**/
- create2: AugmentedSubmittable<(source: H160 | string | Uint8Array, init: Bytes | string | Uint8Array, salt: H256 | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, gasPrice: U256 | AnyNumber | Uint8Array, nonce: Option<U256> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [H160, Bytes, H256, U256, u64, U256, Option<U256>]>;
+ create2: AugmentedSubmittable<(source: H160 | string | Uint8Array, init: Bytes | string | Uint8Array, salt: H256 | string | Uint8Array, value: U256 | AnyNumber | Uint8Array, gasLimit: u64 | AnyNumber | Uint8Array, maxFeePerGas: U256 | AnyNumber | Uint8Array, maxPriorityFeePerGas: Option<U256> | null | object | string | Uint8Array, nonce: Option<U256> | null | object | string | Uint8Array, accessList: Vec<ITuple<[H160, Vec<H256>]>> | ([H160 | string | Uint8Array, Vec<H256> | (H256 | string | Uint8Array)[]])[]) => SubmittableExtrinsic<ApiType>, [H160, Bytes, H256, U256, u64, U256, Option<U256>, Option<U256>, Vec<ITuple<[H160, Vec<H256>]>>]>;
/**
* Withdraw balance from EVM into currency/balances pallet.
**/
@@ -197,6 +178,20 @@
};
inflation: {
/**
+ * This method sets the inflation start date. Can be only called once.
+ * Inflation start block can be backdated and will catch up. The method will create Treasury
+ * account if it does not exist and perform the first inflation deposit.
+ *
+ * # Permissions
+ *
+ * * Root
+ *
+ * # Arguments
+ *
+ * * inflation_start_relay_block: The relay chain block at which inflation should start
+ **/
+ startInflation: AugmentedSubmittable<(inflationStartRelayBlock: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
+ /**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
@@ -300,8 +295,8 @@
* an `AccountId32` value.
* - `assets`: The assets to be withdrawn. The first item should be the currency used to to pay the fee on the
* `dest` side. May not be empty.
- * - `dest_weight`: Equal to the total weight on `dest` of the XCM message
- * `Teleport { assets, effects: [ BuyExecution{..}, DepositAsset{..} ] }`.
+ * - `fee_asset_item`: The index into `assets` of the item which should be used to pay
+ * fees.
* - `weight_limit`: The remote-side weight limit, if any, for the XCM fee purchase.
**/
limitedTeleportAssets: 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, weightLimit: XcmV2WeightLimit | { Unlimited: any } | { Limited: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [XcmVersionedMultiLocation, XcmVersionedMultiLocation, XcmVersionedMultiAssets, u32, XcmV2WeightLimit]>;
@@ -339,8 +334,8 @@
* an `AccountId32` value.
* - `assets`: The assets to be withdrawn. The first item should be the currency used to to pay the fee on the
* `dest` side. May not be empty.
- * - `dest_weight`: Equal to the total weight on `dest` of the XCM message
- * `Teleport { assets, effects: [ BuyExecution{..}, DepositAsset{..} ] }`.
+ * - `fee_asset_item`: The index into `assets` of the item which should be used to pay
+ * 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]>;
/**
@@ -374,7 +369,7 @@
* - Weight of derivative `call` execution + 10,000.
* # </weight>
**/
- sudo: AugmentedSubmittable<(call: Call) => SubmittableExtrinsic<ApiType>, [Call]>;
+ sudo: AugmentedSubmittable<(call: Call | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call]>;
/**
* Authenticates the sudo key and dispatches a function call with `Signed` origin from
* a given account.
@@ -388,7 +383,7 @@
* - Weight of derivative `call` execution + 10,000.
* # </weight>
**/
- sudoAs: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, ) => SubmittableExtrinsic<ApiType>, [MultiAddress, Call]>;
+ sudoAs: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, call: Call | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, Call]>;
/**
* Authenticates the sudo key and dispatches a function call with `Root` origin.
* This function does not check the weight of the call, and instead allows the
@@ -401,7 +396,7 @@
* - The weight of this call is defined by the caller.
* # </weight>
**/
- sudoUncheckedWeight: AugmentedSubmittable<(call: Call, weight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, u64]>;
+ sudoUncheckedWeight: AugmentedSubmittable<(call: Call | string | Uint8Array, weight: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Call, u64]>;
/**
* Generic tx
**/
@@ -417,24 +412,10 @@
*
* **NOTE:** We rely on the Root origin to provide us the number of subkeys under
* the prefix we are removing to accurately calculate the weight of this function.
- *
- * # <weight>
- * - `O(P)` where `P` amount of keys with prefix `prefix`
- * - `P` storage deletions.
- * - Base Weight: 0.834 * P µs
- * - Writes: Number of subkeys + 1
- * # </weight>
**/
killPrefix: AugmentedSubmittable<(prefix: Bytes | string | Uint8Array, subkeys: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes, u32]>;
/**
* Kill some items from storage.
- *
- * # <weight>
- * - `O(IK)` where `I` length of `keys` and `K` length of one key
- * - `I` storage deletions.
- * - Base Weight: .378 * i µs
- * - Writes: Number of items
- * # </weight>
**/
killStorage: AugmentedSubmittable<(keys: Vec<Bytes> | (Bytes | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [Vec<Bytes>]>;
/**
@@ -455,19 +436,6 @@
**/
remarkWithEvent: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
- * Set the new changes trie configuration.
- *
- * # <weight>
- * - `O(1)`
- * - 1 storage write or delete (codec `O(1)`).
- * - 1 call to `deposit_log`: Uses `append` API, so O(1)
- * - Base Weight: 7.218 µs
- * - DB Weight:
- * - Writes: Changes Trie, System Digest
- * # </weight>
- **/
- setChangesTrieConfig: AugmentedSubmittable<(changesTrieConfig: Option<SpCoreChangesTrieChangesTrieConfiguration> | null | object | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Option<SpCoreChangesTrieChangesTrieConfiguration>]>;
- /**
* Set the new runtime code.
*
* # <weight>
@@ -496,25 +464,10 @@
setCodeWithoutChecks: AugmentedSubmittable<(code: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
* Set the number of pages in the WebAssembly environment's heap.
- *
- * # <weight>
- * - `O(1)`
- * - 1 storage write.
- * - Base Weight: 1.405 µs
- * - 1 write to HEAP_PAGES
- * - 1 digest item
- * # </weight>
**/
setHeapPages: AugmentedSubmittable<(pages: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u64]>;
/**
* Set some items of storage.
- *
- * # <weight>
- * - `O(I)` where `I` length of `items`
- * - `I` storage writes (`O(1)`).
- * - Base Weight: 0.568 * i µs
- * - Writes: Number of items
- * # </weight>
**/
setStorage: AugmentedSubmittable<(items: Vec<ITuple<[Bytes, Bytes]>> | ([Bytes | string | Uint8Array, Bytes | string | Uint8Array])[]) => SubmittableExtrinsic<ApiType>, [Vec<ITuple<[Bytes, Bytes]>>]>;
/**
@@ -1026,6 +979,22 @@
};
xcmpQueue: {
/**
+ * Services a single overweight XCM.
+ *
+ * - `origin`: Must pass `ExecuteOverweightOrigin`.
+ * - `index`: The index of the overweight XCM to service
+ * - `weight_limit`: The amount of weight that XCM execution may take.
+ *
+ * Errors:
+ * - `BadOverweightIndex`: XCM under `index` is not found in the `Overweight` storage map.
+ * - `BadXcm`: XCM under `index` cannot be properly decoded into a valid XCM format.
+ * - `WeightOverLimit`: XCM execution may use greater `weight_limit`.
+ *
+ * Events:
+ * - `OverweightServiced`: On success.
+ **/
+ serviceOverweight: AugmentedSubmittable<(index: u64 | AnyNumber | Uint8Array, weightLimit: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u64, u64]>;
+ /**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;