Additional runtime call definitions (#4998)
* Additional runtime call definitions * Additional * Additional * Expand * mmr (+ grandpa fixes)
This commit is contained in:
@@ -34,8 +34,21 @@ const V1_V2_SHARED: Record<string, DefinitionCall> = {
|
||||
description: 'Returns information regarding the next epoch (which was already previously announced).',
|
||||
params: [],
|
||||
type: 'Epoch'
|
||||
},
|
||||
submit_report_equivocation_unsigned_extrinsic: {
|
||||
description: 'Submits an unsigned extrinsic to report an equivocation.',
|
||||
params: [
|
||||
{
|
||||
name: 'equivocationProof',
|
||||
type: 'BabeEquivocationProof'
|
||||
},
|
||||
{
|
||||
name: 'keyOwnerProof',
|
||||
type: 'OpaqueKeyOwnershipProof'
|
||||
}
|
||||
],
|
||||
type: 'Option<Null>'
|
||||
}
|
||||
// TODO Add submit_report_equivocation_unsigned_extrinsic
|
||||
};
|
||||
|
||||
export const runtime: DefinitionsCall = {
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// order important in structs... :)
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { runtime } from './runtime';
|
||||
|
||||
export default {
|
||||
rpc: {},
|
||||
runtime,
|
||||
types: {
|
||||
BenchmarkConfig: {
|
||||
pallet: 'Bytes',
|
||||
benchmark: 'Bytes',
|
||||
selectedComponents: 'Vec<(BenchmarkParameter, u32)>',
|
||||
verify: 'bool',
|
||||
internalRepeats: 'u32'
|
||||
},
|
||||
BenchmarkList: {
|
||||
pallet: 'Bytes',
|
||||
instance: 'Bytes',
|
||||
benchmarks: 'Vec<BenchmarkMetadata>'
|
||||
},
|
||||
BenchmarkMetadata: {
|
||||
name: 'Bytes',
|
||||
components: 'Vec<(BenchmarkParameter, u32, u32)>'
|
||||
},
|
||||
BenchmarkParameter: {
|
||||
_enum: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
|
||||
}
|
||||
}
|
||||
} as Definitions;
|
||||
@@ -0,0 +1,4 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
export * from './types';
|
||||
@@ -0,0 +1,34 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsCall } from '../../types';
|
||||
|
||||
export const runtime: DefinitionsCall = {
|
||||
Benchmark: [
|
||||
{
|
||||
methods: {
|
||||
benchmark_metadata: {
|
||||
description: 'Get the benchmark metadata available for this runtime.',
|
||||
params: [
|
||||
{
|
||||
name: 'extra',
|
||||
type: 'bool'
|
||||
}
|
||||
],
|
||||
type: '(Vec<BenchmarkList>, Vec<StorageInfo>)'
|
||||
},
|
||||
dispatch_benchmark: {
|
||||
description: 'Dispatch the given benchmark.',
|
||||
params: [
|
||||
{
|
||||
name: 'config',
|
||||
type: 'BenchmarkConfig'
|
||||
}
|
||||
],
|
||||
type: 'Result<Vec<BenchmarkBatch>, Text>'
|
||||
}
|
||||
},
|
||||
version: 1
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -0,0 +1,60 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
import type { Bytes, Enum, Struct, Vec, bool, u32 } from '@polkadot/types-codec';
|
||||
import type { ITuple } from '@polkadot/types-codec/types';
|
||||
|
||||
/** @name BenchmarkConfig */
|
||||
export interface BenchmarkConfig extends Struct {
|
||||
readonly pallet: Bytes;
|
||||
readonly benchmark: Bytes;
|
||||
readonly selectedComponents: Vec<ITuple<[BenchmarkParameter, u32]>>;
|
||||
readonly verify: bool;
|
||||
readonly internalRepeats: u32;
|
||||
}
|
||||
|
||||
/** @name BenchmarkList */
|
||||
export interface BenchmarkList extends Struct {
|
||||
readonly pallet: Bytes;
|
||||
readonly instance: Bytes;
|
||||
readonly benchmarks: Vec<BenchmarkMetadata>;
|
||||
}
|
||||
|
||||
/** @name BenchmarkMetadata */
|
||||
export interface BenchmarkMetadata extends Struct {
|
||||
readonly name: Bytes;
|
||||
readonly components: Vec<ITuple<[BenchmarkParameter, u32, u32]>>;
|
||||
}
|
||||
|
||||
/** @name BenchmarkParameter */
|
||||
export interface BenchmarkParameter extends Enum {
|
||||
readonly isA: boolean;
|
||||
readonly isB: boolean;
|
||||
readonly isC: boolean;
|
||||
readonly isD: boolean;
|
||||
readonly isE: boolean;
|
||||
readonly isF: boolean;
|
||||
readonly isG: boolean;
|
||||
readonly isH: boolean;
|
||||
readonly isI: boolean;
|
||||
readonly isJ: boolean;
|
||||
readonly isK: boolean;
|
||||
readonly isL: boolean;
|
||||
readonly isM: boolean;
|
||||
readonly isN: boolean;
|
||||
readonly isO: boolean;
|
||||
readonly isP: boolean;
|
||||
readonly isQ: boolean;
|
||||
readonly isR: boolean;
|
||||
readonly isS: boolean;
|
||||
readonly isT: boolean;
|
||||
readonly isU: boolean;
|
||||
readonly isV: boolean;
|
||||
readonly isW: boolean;
|
||||
readonly isX: boolean;
|
||||
readonly isY: boolean;
|
||||
readonly isZ: boolean;
|
||||
readonly type: 'A' | 'B' | 'C' | 'D' | 'E' | 'F' | 'G' | 'H' | 'I' | 'J' | 'K' | 'L' | 'M' | 'N' | 'O' | 'P' | 'Q' | 'R' | 'S' | 'T' | 'U' | 'V' | 'W' | 'X' | 'Y' | 'Z';
|
||||
}
|
||||
|
||||
export type PHANTOM_BENCHMARK = 'benchmark';
|
||||
@@ -0,0 +1,25 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// order important in structs... :)
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { runtime } from './runtime';
|
||||
|
||||
export default {
|
||||
rpc: {},
|
||||
runtime,
|
||||
types: {
|
||||
CheckInherentsResult: {
|
||||
okay: 'bool',
|
||||
fatalError: 'bool',
|
||||
errors: 'InherentData'
|
||||
},
|
||||
InherentData: {
|
||||
data: 'BTreeMap<InherentIdentifier, Bytes>'
|
||||
},
|
||||
InherentIdentifier: '[u8; 8]'
|
||||
}
|
||||
} as Definitions;
|
||||
@@ -0,0 +1,4 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
export * from './types';
|
||||
@@ -0,0 +1,53 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsCall } from '../../types';
|
||||
|
||||
export const runtime: DefinitionsCall = {
|
||||
BlockBuilder: [
|
||||
{
|
||||
methods: {
|
||||
apply_extrinsic: {
|
||||
description: 'Apply the given extrinsic.',
|
||||
params: [
|
||||
{
|
||||
name: 'extrinsic',
|
||||
type: 'Extrinsic'
|
||||
}
|
||||
],
|
||||
type: 'ApplyExtrinsicResult'
|
||||
},
|
||||
check_inherents: {
|
||||
description: 'Check that the inherents are valid.',
|
||||
params: [
|
||||
{
|
||||
name: 'block',
|
||||
type: 'Block'
|
||||
},
|
||||
{
|
||||
name: 'data',
|
||||
type: 'InherentData'
|
||||
}
|
||||
],
|
||||
type: 'CheckInherentsResult'
|
||||
},
|
||||
finalize_block: {
|
||||
description: 'Finish the current block.',
|
||||
params: [],
|
||||
type: 'Header'
|
||||
},
|
||||
inherent_extrinsics: {
|
||||
description: 'Generate inherent extrinsics.',
|
||||
params: [
|
||||
{
|
||||
name: 'inherent',
|
||||
type: 'InherentData'
|
||||
}
|
||||
],
|
||||
type: 'Vec<Extrinsic>'
|
||||
}
|
||||
},
|
||||
version: 6
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
import type { BTreeMap, Bytes, Struct, U8aFixed, bool } from '@polkadot/types-codec';
|
||||
|
||||
/** @name CheckInherentsResult */
|
||||
export interface CheckInherentsResult extends Struct {
|
||||
readonly okay: bool;
|
||||
readonly fatalError: bool;
|
||||
readonly errors: InherentData;
|
||||
}
|
||||
|
||||
/** @name InherentData */
|
||||
export interface InherentData extends Struct {
|
||||
readonly data: BTreeMap<InherentIdentifier, Bytes>;
|
||||
}
|
||||
|
||||
/** @name InherentIdentifier */
|
||||
export interface InherentIdentifier extends U8aFixed {}
|
||||
|
||||
export type PHANTOM_BLOCKBUILDER = 'blockbuilder';
|
||||
@@ -10,6 +10,8 @@ export { default as aura } from './aura/definitions';
|
||||
export { default as babe } from './babe/definitions';
|
||||
export { default as balances } from './balances/definitions';
|
||||
export { default as beefy } from './beefy/definitions';
|
||||
export { default as benchmark } from './benchmark/definitions';
|
||||
export { default as blockbuilder } from './blockbuilder/definitions';
|
||||
export { default as collective } from './collective/definitions';
|
||||
export { default as consensus } from './consensus/definitions';
|
||||
export { default as contracts } from './contracts/definitions';
|
||||
@@ -39,6 +41,7 @@ export { default as syncstate } from './syncstate/definitions';
|
||||
export { default as system } from './system/definitions';
|
||||
export { default as treasury } from './treasury/definitions';
|
||||
export { default as txpayment } from './txpayment/definitions';
|
||||
export { default as txqueue } from './txqueue/definitions';
|
||||
export { default as uniques } from './uniques/definitions';
|
||||
export { default as utility } from './utility/definitions';
|
||||
export { default as vesting } from './vesting/definitions';
|
||||
|
||||
@@ -11,6 +11,7 @@ import type { DefinitionsTypes } from '../../types';
|
||||
import { objectSpread } from '@polkadot/util';
|
||||
|
||||
import { rpc } from './rpc';
|
||||
import { runtime } from './runtime';
|
||||
|
||||
const V0: DefinitionsTypes = {
|
||||
BlockV0: {
|
||||
@@ -335,4 +336,4 @@ const types: DefinitionsTypes = objectSpread({}, V0, V1, V2, {
|
||||
}
|
||||
});
|
||||
|
||||
export default { rpc, types };
|
||||
export default { rpc, runtime, types };
|
||||
|
||||
@@ -0,0 +1,175 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsCall } from '../../types';
|
||||
|
||||
export const runtime: DefinitionsCall = {
|
||||
ConvertTransactionRuntimeApi: [
|
||||
{
|
||||
methods: {
|
||||
convert_transaction: {
|
||||
description: 'Converts an Ethereum-style transaction to Extrinsic',
|
||||
params: [
|
||||
{
|
||||
name: 'transaction',
|
||||
type: 'TransactionV2'
|
||||
}
|
||||
],
|
||||
type: 'Extrinsic'
|
||||
}
|
||||
},
|
||||
version: 2
|
||||
}
|
||||
],
|
||||
EthereumRuntimeRPCApi: [
|
||||
{
|
||||
methods: {
|
||||
account_basic: {
|
||||
description: 'Returns pallet_evm::Accounts by address.',
|
||||
params: [
|
||||
{
|
||||
name: 'address',
|
||||
type: 'H160'
|
||||
}
|
||||
],
|
||||
type: 'EvmAccount'
|
||||
},
|
||||
account_code_at: {
|
||||
description: 'For a given account address, returns pallet_evm::AccountCodes.',
|
||||
params: [
|
||||
{
|
||||
name: 'address',
|
||||
type: 'H160'
|
||||
}
|
||||
],
|
||||
type: 'Bytes'
|
||||
},
|
||||
author: {
|
||||
description: 'Returns the converted FindAuthor::find_author authority id.',
|
||||
params: [],
|
||||
type: 'H160'
|
||||
},
|
||||
call: {
|
||||
description: 'Returns a frame_ethereum::call response. If `estimate` is true,',
|
||||
params: [
|
||||
{
|
||||
name: 'from',
|
||||
type: 'H160'
|
||||
},
|
||||
{
|
||||
name: 'to',
|
||||
type: 'H160'
|
||||
},
|
||||
{
|
||||
name: 'data',
|
||||
type: 'Vec<u8>'
|
||||
},
|
||||
{
|
||||
name: 'value',
|
||||
type: 'U256'
|
||||
},
|
||||
{
|
||||
name: 'gasLimit',
|
||||
type: 'U256'
|
||||
},
|
||||
{
|
||||
name: 'maxFeePerGas',
|
||||
type: 'Option<U256>'
|
||||
},
|
||||
{
|
||||
name: 'maxPriorityFeePerGas',
|
||||
type: 'Option<U256>'
|
||||
},
|
||||
{
|
||||
name: 'nonce',
|
||||
type: 'Option<U256>'
|
||||
},
|
||||
{
|
||||
name: 'estimate',
|
||||
type: 'bool'
|
||||
},
|
||||
{
|
||||
name: 'accessList',
|
||||
type: 'Option<Vec<(H160, Vec<H256>)>>'
|
||||
}
|
||||
],
|
||||
type: 'Result<EvmCallInfo, DispatchError>'
|
||||
},
|
||||
chain_id: {
|
||||
description: 'Returns runtime defined pallet_evm::ChainId.',
|
||||
params: [],
|
||||
type: 'u64'
|
||||
},
|
||||
create: {
|
||||
description: 'Returns a frame_ethereum::call response. If `estimate` is true,',
|
||||
params: [
|
||||
{
|
||||
name: 'from',
|
||||
type: 'H160'
|
||||
},
|
||||
{
|
||||
name: 'data',
|
||||
type: 'Vec<u8>'
|
||||
},
|
||||
{
|
||||
name: 'value',
|
||||
type: 'U256'
|
||||
},
|
||||
{
|
||||
name: 'gasLimit',
|
||||
type: 'U256'
|
||||
},
|
||||
{
|
||||
name: 'maxFeePerGas',
|
||||
type: 'Option<U256>'
|
||||
},
|
||||
{
|
||||
name: 'maxPriorityFeePerGas',
|
||||
type: 'Option<U256>'
|
||||
},
|
||||
{
|
||||
name: 'nonce',
|
||||
type: 'Option<U256>'
|
||||
},
|
||||
{
|
||||
name: 'estimate',
|
||||
type: 'bool'
|
||||
},
|
||||
{
|
||||
name: 'accessList',
|
||||
type: 'Option<Vec<(H160, Vec<H256>)>>'
|
||||
}
|
||||
],
|
||||
type: 'Result<EvmCreateInfo, DispatchError>'
|
||||
},
|
||||
current_block: {
|
||||
description: 'Return the current block.',
|
||||
params: [],
|
||||
type: 'BlockV2'
|
||||
},
|
||||
gas_price: {
|
||||
description: 'Returns FixedGasPrice::min_gas_price',
|
||||
params: [],
|
||||
type: 'u256'
|
||||
},
|
||||
storage_at: {
|
||||
description: 'For a given account address and index, returns pallet_evm::AccountStorages.',
|
||||
params: [
|
||||
{
|
||||
name: 'address',
|
||||
type: 'H160'
|
||||
},
|
||||
{
|
||||
name: 'index',
|
||||
type: 'u256'
|
||||
}
|
||||
],
|
||||
type: 'H256'
|
||||
}
|
||||
},
|
||||
version: 4
|
||||
// TODO This is _very_ incomplete, missing everything from this point onwards is missing -
|
||||
// https://github.com/paritytech/frontier/blob/87e60b9b67ab31f4ea7285c949997337bb76ffd0/primitives/rpc/src/lib.rs#L131
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -13,6 +13,18 @@ export default {
|
||||
nonce: 'u256',
|
||||
balance: 'u256'
|
||||
},
|
||||
EvmCallInfo: {
|
||||
exitReason: 'ExitReason',
|
||||
value: 'Bytes',
|
||||
usedGas: 'U256',
|
||||
logs: 'Vec<EvmLog>'
|
||||
},
|
||||
EvmCreateInfo: {
|
||||
exitReason: 'ExitReason',
|
||||
value: 'H160',
|
||||
usedGas: 'U256',
|
||||
logs: 'Vec<EvmLog>'
|
||||
},
|
||||
EvmLog: {
|
||||
address: 'H160',
|
||||
topics: 'Vec<H256>',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
import type { Bytes, Enum, Struct, Text, Vec, u256 } from '@polkadot/types-codec';
|
||||
import type { Bytes, Enum, Struct, Text, U256, Vec, u256 } from '@polkadot/types-codec';
|
||||
import type { H160, H256 } from '@polkadot/types/interfaces/runtime';
|
||||
|
||||
/** @name EvmAccount */
|
||||
@@ -10,6 +10,22 @@ export interface EvmAccount extends Struct {
|
||||
readonly balance: u256;
|
||||
}
|
||||
|
||||
/** @name EvmCallInfo */
|
||||
export interface EvmCallInfo extends Struct {
|
||||
readonly exitReason: ExitReason;
|
||||
readonly value: Bytes;
|
||||
readonly usedGas: U256;
|
||||
readonly logs: Vec<EvmLog>;
|
||||
}
|
||||
|
||||
/** @name EvmCreateInfo */
|
||||
export interface EvmCreateInfo extends Struct {
|
||||
readonly exitReason: ExitReason;
|
||||
readonly value: H160;
|
||||
readonly usedGas: U256;
|
||||
readonly logs: Vec<EvmLog>;
|
||||
}
|
||||
|
||||
/** @name EvmLog */
|
||||
export interface EvmLog extends Struct {
|
||||
readonly address: H160;
|
||||
|
||||
@@ -12,12 +12,39 @@ export const runtime: DefinitionsCall = {
|
||||
params: [],
|
||||
type: 'SetId'
|
||||
},
|
||||
generate_key_ownership_proof: {
|
||||
description: 'Generates a proof of key ownership for the given authority in the given set.',
|
||||
params: [
|
||||
{
|
||||
name: 'setId',
|
||||
type: 'SetId'
|
||||
},
|
||||
{
|
||||
name: 'authorityId',
|
||||
type: 'AuthorityId'
|
||||
}
|
||||
],
|
||||
type: 'Option<OpaqueKeyOwnershipProof>'
|
||||
},
|
||||
grandpa_authorities: {
|
||||
description: 'Get the current GRANDPA authorities and weights. This should not change except for when changes are scheduled and the corresponding delay has passed.',
|
||||
params: [],
|
||||
type: 'AuthorityList'
|
||||
},
|
||||
submit_report_equivocation_unsigned_extrinsic: {
|
||||
description: 'Submits an unsigned extrinsic to report an equivocation.',
|
||||
params: [
|
||||
{
|
||||
name: 'equivocationProof',
|
||||
type: 'GrandpaEquivocationProof'
|
||||
},
|
||||
{
|
||||
name: 'keyOwnerProof',
|
||||
type: 'OpaqueKeyOwnershipProof'
|
||||
}
|
||||
],
|
||||
type: 'Option<Null>'
|
||||
}
|
||||
// TODO submit_report_equivocation_unsigned_extrinsic, generate_key_ownership_proof
|
||||
},
|
||||
version: 3
|
||||
}
|
||||
|
||||
@@ -7,19 +7,37 @@
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { rpc } from './rpc';
|
||||
import { runtime } from './runtime';
|
||||
|
||||
export default {
|
||||
rpc,
|
||||
runtime,
|
||||
types: {
|
||||
MmrBatchProof: {
|
||||
leafIndices: 'Vec<MmrLeafIndex>',
|
||||
leafCount: 'MmrNodeIndex',
|
||||
items: 'Vec<Hash>'
|
||||
},
|
||||
MmrEncodableOpaqueLeaf: 'Bytes',
|
||||
MmrError: {
|
||||
_enum: ['Push', 'GetRoot', 'Commit', 'GenerateProof', 'Verify', 'LeafNotFound', ' PalletNotIncluded', 'InvalidLeafIndex']
|
||||
},
|
||||
MmrLeafBatchProof: {
|
||||
blockHash: 'BlockHash',
|
||||
leaves: 'Bytes',
|
||||
proof: 'Bytes'
|
||||
},
|
||||
MmrLeafIndex: 'u64',
|
||||
MmrLeafProof: {
|
||||
blockHash: 'BlockHash',
|
||||
leaf: 'Bytes',
|
||||
proof: 'Bytes'
|
||||
},
|
||||
MmrNodeIndex: 'u64',
|
||||
MmrProof: {
|
||||
leafIndex: 'MmrLeafIndex',
|
||||
leafCount: 'MmrNodeIndex',
|
||||
items: 'Vec<Hash>'
|
||||
}
|
||||
}
|
||||
} as Definitions;
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsCall } from '../../types';
|
||||
|
||||
export const runtime: DefinitionsCall = {
|
||||
MmrApi: [
|
||||
{
|
||||
methods: {
|
||||
generate_batch_proof: {
|
||||
description: 'Generate MMR proof for a series of leaves under given indices.',
|
||||
params: [
|
||||
{
|
||||
name: 'leafIndices',
|
||||
type: 'Vec<MmrLeafIndex>'
|
||||
}
|
||||
],
|
||||
type: 'Result<(Vec<MmrEncodableOpaqueLeaf>, MmrBatchProof), MmrError>'
|
||||
},
|
||||
generate_proof: {
|
||||
description: 'Generate MMR proof for a leaf under given index.',
|
||||
params: [
|
||||
{
|
||||
name: 'leafIndex',
|
||||
type: 'MmrLeafIndex'
|
||||
}
|
||||
],
|
||||
type: 'Result<(MmrEncodableOpaqueLeaf, MmrProof), MmrError>'
|
||||
},
|
||||
mmr_root: {
|
||||
description: 'Return the on-chain MMR root hash.',
|
||||
params: [],
|
||||
type: 'Result<Hash, MmrError>'
|
||||
},
|
||||
verify_batch_proof: {
|
||||
description: 'Verify MMR proof against on-chain MMR for a batch of leaves.',
|
||||
params: [
|
||||
{
|
||||
name: 'leaves',
|
||||
type: 'Vec<MmrEncodableOpaqueLeaf>'
|
||||
},
|
||||
{
|
||||
name: 'proof',
|
||||
type: 'MmrBatchProof'
|
||||
}
|
||||
],
|
||||
type: 'Result<(), MmrError>'
|
||||
},
|
||||
verify_batch_proof_stateless: {
|
||||
description: 'Verify MMR proof against given root hash or a batch of leaves.',
|
||||
params: [
|
||||
{
|
||||
name: 'root',
|
||||
type: 'Hash'
|
||||
},
|
||||
{
|
||||
name: 'leaves',
|
||||
type: 'Vec<MmrEncodableOpaqueLeaf>'
|
||||
},
|
||||
{
|
||||
name: 'proof',
|
||||
type: 'MmrBatchProof'
|
||||
}
|
||||
],
|
||||
type: 'Result<(), MmrError>'
|
||||
},
|
||||
verify_proof: {
|
||||
description: 'Verify MMR proof against on-chain MMR.',
|
||||
params: [
|
||||
{
|
||||
name: 'leaf',
|
||||
type: 'MmrEncodableOpaqueLeaf'
|
||||
},
|
||||
{
|
||||
name: 'proof',
|
||||
type: 'MmrProof'
|
||||
}
|
||||
],
|
||||
type: 'Result<(), MmrError>'
|
||||
},
|
||||
verify_proof_stateless: {
|
||||
description: 'Verify MMR proof against given root hash.',
|
||||
params: [
|
||||
{
|
||||
name: 'root',
|
||||
type: 'Hash'
|
||||
},
|
||||
{
|
||||
name: 'leaf',
|
||||
type: 'MmrEncodableOpaqueLeaf'
|
||||
},
|
||||
{
|
||||
name: 'proof',
|
||||
type: 'MmrProof'
|
||||
}
|
||||
],
|
||||
type: 'Result<(), MmrError>'
|
||||
}
|
||||
},
|
||||
version: 1
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -1,8 +1,32 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
import type { Bytes, Struct } from '@polkadot/types-codec';
|
||||
import type { Bytes, Enum, Struct, Vec, u64 } from '@polkadot/types-codec';
|
||||
import type { BlockHash } from '@polkadot/types/interfaces/chain';
|
||||
import type { Hash } from '@polkadot/types/interfaces/runtime';
|
||||
|
||||
/** @name MmrBatchProof */
|
||||
export interface MmrBatchProof extends Struct {
|
||||
readonly leafIndices: Vec<MmrLeafIndex>;
|
||||
readonly leafCount: MmrNodeIndex;
|
||||
readonly items: Vec<Hash>;
|
||||
}
|
||||
|
||||
/** @name MmrEncodableOpaqueLeaf */
|
||||
export interface MmrEncodableOpaqueLeaf extends Bytes {}
|
||||
|
||||
/** @name MmrError */
|
||||
export interface MmrError extends Enum {
|
||||
readonly isPush: boolean;
|
||||
readonly isGetRoot: boolean;
|
||||
readonly isCommit: boolean;
|
||||
readonly isGenerateProof: boolean;
|
||||
readonly isVerify: boolean;
|
||||
readonly isLeafNotFound: boolean;
|
||||
readonly isPalletNotIncluded: boolean;
|
||||
readonly isInvalidLeafIndex: boolean;
|
||||
readonly type: 'Push' | 'GetRoot' | 'Commit' | 'GenerateProof' | 'Verify' | 'LeafNotFound' | 'PalletNotIncluded' | 'InvalidLeafIndex';
|
||||
}
|
||||
|
||||
/** @name MmrLeafBatchProof */
|
||||
export interface MmrLeafBatchProof extends Struct {
|
||||
@@ -11,6 +35,9 @@ export interface MmrLeafBatchProof extends Struct {
|
||||
readonly proof: Bytes;
|
||||
}
|
||||
|
||||
/** @name MmrLeafIndex */
|
||||
export interface MmrLeafIndex extends u64 {}
|
||||
|
||||
/** @name MmrLeafProof */
|
||||
export interface MmrLeafProof extends Struct {
|
||||
readonly blockHash: BlockHash;
|
||||
@@ -18,4 +45,14 @@ export interface MmrLeafProof extends Struct {
|
||||
readonly proof: Bytes;
|
||||
}
|
||||
|
||||
/** @name MmrNodeIndex */
|
||||
export interface MmrNodeIndex extends u64 {}
|
||||
|
||||
/** @name MmrProof */
|
||||
export interface MmrProof extends Struct {
|
||||
readonly leafIndex: MmrLeafIndex;
|
||||
readonly leafCount: MmrNodeIndex;
|
||||
readonly items: Vec<Hash>;
|
||||
}
|
||||
|
||||
export type PHANTOM_MMR = 'mmr';
|
||||
|
||||
@@ -7,9 +7,11 @@
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { rpc } from './rpc';
|
||||
import { runtime } from './runtime';
|
||||
|
||||
export default {
|
||||
rpc,
|
||||
runtime,
|
||||
types: {
|
||||
StorageKind: {
|
||||
_enum: {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsCall } from '../../types';
|
||||
|
||||
export const runtime: DefinitionsCall = {
|
||||
OffchainWorkerApi: [
|
||||
{
|
||||
methods: {
|
||||
offchain_worker: {
|
||||
description: 'Starts the off-chain task for given block header.',
|
||||
params: [
|
||||
{
|
||||
name: 'header',
|
||||
type: 'Header'
|
||||
}
|
||||
],
|
||||
type: 'Null'
|
||||
}
|
||||
},
|
||||
version: 2
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -12,7 +12,7 @@ export const runtime: DefinitionsCall = {
|
||||
params: [
|
||||
{
|
||||
name: 'uxt',
|
||||
type: 'Bytes'
|
||||
type: 'Extrinsic'
|
||||
},
|
||||
{
|
||||
name: 'len',
|
||||
@@ -26,7 +26,7 @@ export const runtime: DefinitionsCall = {
|
||||
params: [
|
||||
{
|
||||
name: 'uxt',
|
||||
type: 'Bytes'
|
||||
type: 'Extrinsic'
|
||||
},
|
||||
{
|
||||
name: 'len',
|
||||
|
||||
@@ -183,10 +183,19 @@ export default {
|
||||
Slot: 'u64',
|
||||
SlotDuration: 'u64',
|
||||
StorageData: 'Bytes',
|
||||
StorageInfo: {
|
||||
palletName: 'Bytes',
|
||||
storage_name: 'Bytes',
|
||||
prefix: 'Bytes',
|
||||
maxValues: 'Option<u32>',
|
||||
maxSize: 'Option<u32>'
|
||||
},
|
||||
StorageProof: {
|
||||
trieNodes: 'Vec<Bytes>'
|
||||
},
|
||||
TransactionPriority: 'u64',
|
||||
TransactionLongevity: 'u64',
|
||||
TransactionTag: 'Bytes',
|
||||
TransactionInfo: {
|
||||
_alias: {
|
||||
dataSize: 'size'
|
||||
|
||||
@@ -7,6 +7,26 @@ export const runtime: DefinitionsCall = {
|
||||
Core: [
|
||||
{
|
||||
methods: {
|
||||
execute_block: {
|
||||
description: 'Execute the given block.',
|
||||
params: [
|
||||
{
|
||||
name: 'block',
|
||||
type: 'Block'
|
||||
}
|
||||
],
|
||||
type: 'Null'
|
||||
},
|
||||
initialize_block: {
|
||||
description: 'Initialize a block with the given header.',
|
||||
params: [
|
||||
{
|
||||
name: 'header',
|
||||
type: 'Header'
|
||||
}
|
||||
],
|
||||
type: 'Null'
|
||||
},
|
||||
version: {
|
||||
description: 'Returns the version of the runtime.',
|
||||
params: [],
|
||||
@@ -14,7 +34,28 @@ export const runtime: DefinitionsCall = {
|
||||
}
|
||||
},
|
||||
version: 4
|
||||
// TODO Add execute_block & initialize_block
|
||||
}
|
||||
],
|
||||
TryRuntime: [
|
||||
{
|
||||
methods: {
|
||||
execute_block_no_check: {
|
||||
description: "Execute the given block, but don't check that its state root matches that of yours.",
|
||||
params: [
|
||||
{
|
||||
name: 'block',
|
||||
type: 'Block'
|
||||
}
|
||||
],
|
||||
type: 'Weight'
|
||||
},
|
||||
on_runtime_upgrade: {
|
||||
description: 'dry-run runtime upgrades, returning the total weight consumed.',
|
||||
params: [],
|
||||
type: '(Weight, Weight)'
|
||||
}
|
||||
},
|
||||
version: 1
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
@@ -339,6 +339,15 @@ export interface SlotDuration extends u64 {}
|
||||
/** @name StorageData */
|
||||
export interface StorageData extends Bytes {}
|
||||
|
||||
/** @name StorageInfo */
|
||||
export interface StorageInfo extends Struct {
|
||||
readonly palletName: Bytes;
|
||||
readonly storage_name: Bytes;
|
||||
readonly prefix: Bytes;
|
||||
readonly maxValues: Option<u32>;
|
||||
readonly maxSize: Option<u32>;
|
||||
}
|
||||
|
||||
/** @name StorageProof */
|
||||
export interface StorageProof extends Struct {
|
||||
readonly trieNodes: Vec<Bytes>;
|
||||
@@ -352,6 +361,9 @@ export interface TransactionInfo extends Struct {
|
||||
readonly blockChunks: u32;
|
||||
}
|
||||
|
||||
/** @name TransactionLongevity */
|
||||
export interface TransactionLongevity extends u64 {}
|
||||
|
||||
/** @name TransactionPriority */
|
||||
export interface TransactionPriority extends u64 {}
|
||||
|
||||
@@ -361,6 +373,9 @@ export interface TransactionStorageProof extends Struct {
|
||||
readonly proof: Vec<Bytes>;
|
||||
}
|
||||
|
||||
/** @name TransactionTag */
|
||||
export interface TransactionTag extends Bytes {}
|
||||
|
||||
/** @name U32F32 */
|
||||
export interface U32F32 extends UInt {}
|
||||
|
||||
|
||||
@@ -141,7 +141,8 @@ export default {
|
||||
ExhaustsResources: 'Null',
|
||||
Custom: 'u8',
|
||||
BadMandatory: 'Null',
|
||||
MandatoryDispatch: 'Null'
|
||||
MandatoryDispatch: 'Null',
|
||||
BadSigner: 'Null'
|
||||
}
|
||||
},
|
||||
Key: 'Bytes',
|
||||
|
||||
@@ -238,7 +238,8 @@ export interface InvalidTransaction extends Enum {
|
||||
readonly asCustom: u8;
|
||||
readonly isBadMandatory: boolean;
|
||||
readonly isMandatoryDispatch: boolean;
|
||||
readonly type: 'Call' | 'Payment' | 'Future' | 'Stale' | 'BadProof' | 'AncientBirthBlock' | 'ExhaustsResources' | 'Custom' | 'BadMandatory' | 'MandatoryDispatch';
|
||||
readonly isBadSigner: boolean;
|
||||
readonly type: 'Call' | 'Payment' | 'Future' | 'Stale' | 'BadProof' | 'AncientBirthBlock' | 'ExhaustsResources' | 'Custom' | 'BadMandatory' | 'MandatoryDispatch' | 'BadSigner';
|
||||
}
|
||||
|
||||
/** @name Key */
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
// order important in structs... :)
|
||||
/* eslint-disable sort-keys */
|
||||
|
||||
import type { Definitions } from '../../types';
|
||||
|
||||
import { runtime } from './runtime';
|
||||
|
||||
export default {
|
||||
rpc: {},
|
||||
runtime,
|
||||
types: {
|
||||
TransactionSource: {
|
||||
_enum: ['InBlock', 'Local', 'External']
|
||||
},
|
||||
TransactionValidity: 'Result<ValidTransaction, TransactionValidityError>',
|
||||
ValidTransaction: {
|
||||
priority: 'TransactionPriority',
|
||||
requires: 'Vec<TransactionTag>',
|
||||
provides: 'Vec<TransactionTag>',
|
||||
longevity: 'TransactionLongevity',
|
||||
propagate: 'bool'
|
||||
}
|
||||
}
|
||||
} as Definitions;
|
||||
@@ -0,0 +1,4 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
export * from './types';
|
||||
@@ -0,0 +1,32 @@
|
||||
// Copyright 2017-2022 @polkadot/types authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import type { DefinitionsCall } from '../../types';
|
||||
|
||||
export const runtime: DefinitionsCall = {
|
||||
TaggedTransactionQueue: [
|
||||
{
|
||||
methods: {
|
||||
validate_transaction: {
|
||||
description: 'Validate the transaction.',
|
||||
params: [
|
||||
{
|
||||
name: 'source',
|
||||
type: 'TransactionSource'
|
||||
},
|
||||
{
|
||||
name: 'tx',
|
||||
type: 'Extrinsic'
|
||||
},
|
||||
{
|
||||
name: 'blockHash',
|
||||
type: 'BlockHash'
|
||||
}
|
||||
],
|
||||
type: 'TransactionValidity'
|
||||
}
|
||||
},
|
||||
version: 3
|
||||
}
|
||||
]
|
||||
};
|
||||
@@ -0,0 +1,37 @@
|
||||
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
|
||||
/* eslint-disable */
|
||||
|
||||
import type { Enum, Result, Struct, Vec, bool } from '@polkadot/types-codec';
|
||||
import type { TransactionLongevity, TransactionPriority, TransactionTag } from '@polkadot/types/interfaces/runtime';
|
||||
import type { TransactionValidityError } from '@polkadot/types/interfaces/system';
|
||||
|
||||
/** @name TransactionSource */
|
||||
export interface TransactionSource extends Enum {
|
||||
readonly isInBlock: boolean;
|
||||
readonly isLocal: boolean;
|
||||
readonly isExternal: boolean;
|
||||
readonly type: 'InBlock' | 'Local' | 'External';
|
||||
}
|
||||
|
||||
/** @name TransactionValidity */
|
||||
export interface TransactionValidity extends Result<ValidTransaction, TransactionValidityError> {
|
||||
readonly isErr: boolean;
|
||||
readonly asErr: TransactionValidityError;
|
||||
/** @deprecated Use isErr */
|
||||
readonly isError: boolean;
|
||||
/** @deprecated Use asErr */
|
||||
readonly asError: TransactionValidityError;
|
||||
readonly isOk: boolean;
|
||||
readonly asOk: ValidTransaction;
|
||||
}
|
||||
|
||||
/** @name ValidTransaction */
|
||||
export interface ValidTransaction extends Struct {
|
||||
readonly priority: TransactionPriority;
|
||||
readonly requires: Vec<TransactionTag>;
|
||||
readonly provides: Vec<TransactionTag>;
|
||||
readonly longevity: TransactionLongevity;
|
||||
readonly propagate: bool;
|
||||
}
|
||||
|
||||
export type PHANTOM_TXQUEUE = 'txqueue';
|
||||
@@ -9,6 +9,8 @@ export * from './authorship/types';
|
||||
export * from './babe/types';
|
||||
export * from './balances/types';
|
||||
export * from './beefy/types';
|
||||
export * from './benchmark/types';
|
||||
export * from './blockbuilder/types';
|
||||
export * from './bridges/types';
|
||||
export * from './chain/types';
|
||||
export * from './childstate/types';
|
||||
@@ -54,6 +56,7 @@ export * from './syncstate/types';
|
||||
export * from './system/types';
|
||||
export * from './treasury/types';
|
||||
export * from './txpayment/types';
|
||||
export * from './txqueue/types';
|
||||
export * from './uniques/types';
|
||||
export * from './utility/types';
|
||||
export * from './vesting/types';
|
||||
|
||||
@@ -61,10 +61,12 @@ export interface DefinitionRpcSub extends DefinitionRpc {
|
||||
|
||||
export type DefinitionsRpc = Record<string, DefinitionRpc | DefinitionRpcSub>;
|
||||
|
||||
export type DefinitionsCall = Record<string, {
|
||||
export interface DefinitionsCallEntry {
|
||||
methods: Record<string, DefinitionCall>;
|
||||
version: number;
|
||||
}[]>;
|
||||
}
|
||||
|
||||
export type DefinitionsCall = Record<string, DefinitionsCallEntry[]>;
|
||||
|
||||
export interface DefinitionCallNamed extends DefinitionCall {
|
||||
method: string;
|
||||
|
||||
Reference in New Issue
Block a user