Drop Metadata V0-V8 (#2634)

* Drop MetadatV0

* Apply suggestions from code review

* Restore asV1

* Remove V0 comment

* Handle DoNotConstruct in enum

* No imports from DoNotConstruct

* Merge & re-generate

* Attempt empty construction

* Drop Metadata from 0-4

* CHANGELOG

* assert(5)

* BE vs LE

* Metadataall to no-construction

* Empty U8a create

* Remove old comment

* Santize handling

* Update CHANGELOG.md

* Drop support for Metadata < 9

* Remove old pre-9 definitions

* Update CHANGELOG.md

* CHANGELOG

* Remove v8-era tests

* v8 tests
This commit is contained in:
Jaco Greeff
2020-09-25 16:32:48 +02:00
committed by GitHub
parent dff7243aad
commit 5ce3524ccd
56 changed files with 179 additions and 35167 deletions
+3 -1
View File
@@ -2,11 +2,13 @@
## 1.35.0-beta.x
- **Important** Metadata versions before v9 is not supported anymore. v4 was the first version to go with the Substrate 1.0 while Kusama itself starts at v9 as the earliest version. This means that Substrate 1.x chains that have not had any upgrades are not supported in this version of the API anymore.
- **Breaking change** The `RefCount` type (used by `query.system.accounts`) has been changed to a `u32`. On older chains supply the `RefCount: 'RefCountTo259'` override
- **Breaking change** Support for the old-style linked-map retrievals have been dropped, only `.keys()/.entries()` are available now for map iteration. Al known live chains have been upgraded to versions that don't have linked lists.
- **Breaking change** Support for the old-style linked-map retrievals via `query.<module>.map()` have been dropped, only the existing `.keys()/.entries()` are available for map iteration.
Changes:
- Drop support for Substrate 1.0 metadata versions 0-4
- Adjust `RefCount` type as per substrate 2.0
- Add bounty type definitions from treasury
- Add support for `grandpa_proveFinality` RPC
+1 -4
View File
@@ -11,7 +11,7 @@ import { Observable, Subscription, of } from 'rxjs';
import { map, switchMap } from 'rxjs/operators';
import { Metadata, Text, TypeRegistry } from '@polkadot/types';
import { LATEST_EXTRINSIC_VERSION } from '@polkadot/types/extrinsic/Extrinsic';
import { getMetadataTypes, getSpecAlias, getSpecTypes, getUpgradeVersion } from '@polkadot/types-known';
import { getSpecAlias, getSpecTypes, getUpgradeVersion } from '@polkadot/types-known';
import { BN_ZERO, assert, logger, u8aEq, u8aToU8a } from '@polkadot/util';
import { cryptoWaitReady } from '@polkadot/util-crypto';
@@ -264,9 +264,6 @@ export default abstract class Init<ApiType extends ApiTypes> extends Decorate<Ap
}
private async _initFromMeta (metadata: Metadata): Promise<boolean> {
// inject types based on metadata, if applicable
this.registerTypes(getMetadataTypes(this.registry, metadata.version));
const metaExtrinsic = metadata.asLatest.extrinsic;
// only inject if we are not a clone (global init)
@@ -2,150 +2,13 @@
// SPDX-License-Identifier: Apache-2.0
import { Text, TypeRegistry } from '@polkadot/types';
import { StorageEntry } from '@polkadot/types/primitive/StorageKey';
import { assert, stringToU8a, u8aConcat, u8aToHex } from '@polkadot/util';
import { u8aToHex } from '@polkadot/util';
import createFunction from './createFunction';
describe('createFunction', (): void => {
const registry = new TypeRegistry();
it('should create timestamp.now correctly', (): void => {
expect(
createFunction(registry, {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
meta: { type: {} } as any,
method: 'Now',
prefix: 'Timestamp',
section: 'timestamp'
}, { metaVersion: 8 })()
).toEqual(
Uint8Array.from([64, 14, 73, 68, 207, 217, 141, 111, 76, 195, 116, 209, 111, 90, 78, 63, 156]) // Length-prefixed
);
});
it('allows overrides on key (keeping name)', (): void => {
expect(
createFunction(
registry,
{
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
meta: { type: {} } as any,
method: 'authorityCount',
prefix: 'Substrate',
section: 'substrate'
},
{
key: ':auth:len',
metaVersion: 8,
skipHashing: true
}
).method
).toEqual('authorityCount');
});
it('allows overrides on key (unhashed)', (): void => {
const key = ':auth:len';
expect(
createFunction(
registry,
{
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
meta: { type: {} } as any,
method: 'authorityCount',
prefix: 'Substrate',
section: 'substrate'
},
{
key,
metaVersion: 8,
skipHashing: true
}
)()
).toEqual(
u8aConcat(
Uint8Array.from([key.length << 2]),
stringToU8a(':auth:len')
)
);
});
describe('the created double map function', (): void => {
let storageFn: StorageEntry;
beforeAll((): void => {
storageFn = createFunction(registry, {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
meta: {
name: 'metaName',
type: {
asDoubleMap: {
hasher: registry.createType('StorageHasher', 'Blake2_256'),
key1: new Text(registry, 'AccountId'),
key2: new Text(registry, 'AccountId'),
key2Hasher: registry.createType('StorageHasher', 'Twox128'),
value: new Text(registry, 'Balance')
},
isDoubleMap: true
}
} as any,
method: 'FreeBalance',
prefix: 'GenericAsset',
section: 'genericAsset'
}, { metaVersion: 8 });
});
it('should return correct key', (): void => {
const result = storageFn(['5DXUeE5N5LtkW97F2PzqYPyqNkxqSWESdGSPTX6AvkUAhwKP', '5DXUeE5N5LtkW97F2PzqYPyqNkxqSWESdGSPTX6AvkUAhwKP']);
expect(u8aToHex(result)).toEqual('0xc000fa40e72d7173e69ee54b980345ea01cb81e64258502e0247af4303dee91ec0aec2ecd3a60ab080cff7b52a8f6d543b');
});
it('needs two arguments', (): void => {
expect(
(): Uint8Array => storageFn(['5DXUeE5N5LtkW97F2PzqYPyqNkxqSWESdGSPTX6AvkUAhwKP'])
).toThrow(/requires two arguments/);
});
it('accepts an optional parameter for key construction', (): void => {
const iterKey = storageFn.iterKey;
assert(iterKey, 'storageFn.iterKey is undefined');
const result = iterKey('5DXUeE5N5LtkW97F2PzqYPyqNkxqSWESdGSPTX6AvkUAhwKP');
expect(u8aToHex(result)).toEqual('0x223416315e3dddca3b5a47fd0ac8e4916482b9ade7bc6657aaca787ba1add3b4c4303117deb55aad9858c8a873273280f78d172b398d5e77e43a2db5e42163e9');
expect(u8aToHex(iterKey())).toEqual('0x223416315e3dddca3b5a47fd0ac8e4916482b9ade7bc6657aaca787ba1add3b4');
});
});
it('allows creates double map function with a Null type key', (): void => {
const storageFn = createFunction(registry, {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
meta: {
type: {
asDoubleMap: {
hasher: registry.createType('StorageHasher', 'Blake2_256'),
key1: new Text(registry, 'Null'),
key2: new Text(registry, 'Hash'),
key2Hasher: registry.createType('StorageHasher', 'Blake2_256'),
value: new Text(registry, 'Vec<(BlockNumber,EventIndex)>')
},
isDoubleMap: true
}
} as any,
method: 'EventTopics',
prefix: 'System',
section: 'system'
}, { metaVersion: 8 });
// the value of the Null type key does not effect the result
expect(u8aToHex(storageFn(['any', [1, 2, 3]]))).toEqual(u8aToHex(storageFn([[1, 2, 3], [1, 2, 3]])));
// the value of the not Null type key does effect the result
expect(u8aToHex(storageFn(['any', [1, 2, 3]]))).not.toEqual(u8aToHex(storageFn(['any', [1, 2, 3, 4]])));
});
it('allows creating of known DoubleMap keys (with Bytes)', (): void => {
const storageFn = createFunction(registry, {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
@@ -8,7 +8,7 @@ import BN from 'bn.js';
import { Compact, Raw } from '@polkadot/types/codec';
import { createTypeUnsafe } from '@polkadot/types/create';
import StorageKey, { StorageEntry } from '@polkadot/types/primitive/StorageKey';
import { assert, compactStripLength, isNull, isUndefined, stringLowerFirst, stringToU8a, u8aConcat } from '@polkadot/util';
import { assert, compactStripLength, isNull, isUndefined, stringLowerFirst, u8aConcat } from '@polkadot/util';
import { xxhashAsU8a } from '@polkadot/util-crypto';
import getHasher, { HasherFunction } from './getHasher';
@@ -68,7 +68,7 @@ function createPrefixedKey ({ method, prefix }: CreateItemFn): Uint8Array {
// create a key for a DoubleMap type
/** @internal */
function createKeyDoubleMap (registry: Registry, itemFn: CreateItemFn, stringKey: string, args: [CreateArgType, CreateArgType], [hasher1, hasher2]: [HasherFunction, HasherFunction?], metaVersion: number): Uint8Array {
function createKeyDoubleMap (registry: Registry, itemFn: CreateItemFn, stringKey: string, args: [CreateArgType, CreateArgType], [hasher1, hasher2]: [HasherFunction, HasherFunction?]): Uint8Array {
const { meta: { name, type } } = itemFn;
// since we are passing an almost-unknown through, trust, but verify
@@ -83,23 +83,16 @@ function createKeyDoubleMap (registry: Registry, itemFn: CreateItemFn, stringKey
const val2 = createTypeUnsafe(registry, map.key2.toString(), [key2]).toU8a();
// as per createKey, always add the length prefix (underlying it is Bytes)
return Compact.addLengthPrefix(
metaVersion <= 8
? u8aConcat(
hasher1(u8aConcat(stringToU8a(stringKey), val1)),
hasher2(val2)
)
: u8aConcat(
createPrefixedKey(itemFn),
hasher1(val1),
hasher2(val2)
)
);
return Compact.addLengthPrefix(u8aConcat(
createPrefixedKey(itemFn),
hasher1(val1),
hasher2(val2)
));
}
// create a key for either a map or a plain value
/** @internal */
function createKey (registry: Registry, itemFn: CreateItemFn, stringKey: string, arg: CreateArgType, hasher: (value: Uint8Array) => Uint8Array, metaVersion: number): Uint8Array {
function createKey (registry: Registry, itemFn: CreateItemFn, stringKey: string, arg: CreateArgType, hasher: (value: Uint8Array) => Uint8Array): Uint8Array {
const { meta: { name, type } } = itemFn;
let param: Uint8Array = EMPTY_U8A;
@@ -112,11 +105,12 @@ function createKey (registry: Registry, itemFn: CreateItemFn, stringKey: string,
}
// StorageKey is a Bytes, so is length-prefixed
return Compact.addLengthPrefix(
metaVersion <= 8
? hasher(u8aConcat(stringToU8a(stringKey), param))
: u8aConcat(createPrefixedKey(itemFn), param.length ? hasher(param) : EMPTY_U8A)
);
return Compact.addLengthPrefix(u8aConcat(
createPrefixedKey(itemFn),
param.length
? hasher(param)
: EMPTY_U8A
));
}
// attach the metadata to expand to a StorageFunction
@@ -150,7 +144,7 @@ function extendHeadMeta (registry: Registry, { meta: { documentation, name, type
fallback: registry.createType('Bytes', createTypeUnsafe(registry, outputType).toHex()),
modifier: registry.createType('StorageEntryModifierLatest', 1), // required
name,
type: registry.createType('StorageEntryTypeLatest', registry.createType('PlainTypeLatest', type.isMap ? type.asMap.key : type.asDoubleMap.key1), 0)
type: registry.createType('StorageEntryTypeLatest', registry.createType('Type', type.isMap ? type.asMap.key : type.asDoubleMap.key1), 0)
});
const prefixKey = registry.createType('StorageKey', iterFn, { method, section });
@@ -195,8 +189,8 @@ export default function createFunction (registry: Registry, itemFn: CreateItemFn
// For doublemap queries the params is passed in as an tuple, [key1, key2]
const _storageFn = (arg?: CreateArgType | [CreateArgType?, CreateArgType?]): Uint8Array =>
type.isDoubleMap
? createKeyDoubleMap(registry, itemFn, stringKey, arg as [CreateArgType, CreateArgType], [hasher, key2Hasher], options.metaVersion)
: createKey(registry, itemFn, stringKey, arg as CreateArgType, options.skipHashing ? NULL_HASHER : hasher, options.metaVersion);
? createKeyDoubleMap(registry, itemFn, stringKey, arg as [CreateArgType, CreateArgType], [hasher, key2Hasher])
: createKey(registry, itemFn, stringKey, arg as CreateArgType, options.skipHashing ? NULL_HASHER : hasher);
const storageFn = expandWithMeta(itemFn, _storageFn as StorageEntry);
@@ -7,7 +7,6 @@ import { u8aToHex } from '@polkadot/util';
import Metadata from '../../../Metadata';
import rpcMetadata from '../../../Metadata/static';
import rpcMetadataV8 from '../../../Metadata/v8/static';
import Decorated from '../../Decorated';
const keyring = testingPairs({ type: 'ed25519' });
@@ -39,24 +38,4 @@ describe('fromMetadata', (): void => {
);
});
});
describe('V8', (): void => {
const registry = new TypeRegistry();
const metadata = new Metadata(registry, rpcMetadataV8);
registry.setMetadata(metadata);
const decorated = new Decorated(registry, metadata);
it('should return the correct length-prefixed storage key', (): void => {
expect(
u8aToHex(
decorated.query.balances.freeBalance(keyring.alice.address)
)
).toEqual(
// old storage key format
'0x807f864e18e3dd8b58386310d2fe0919eef27c6e558564b7f67f22d99d20f587bb'
);
});
});
});
@@ -1,32 +0,0 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TypeRegistry } from '@polkadot/types';
import { changesTrieConfig, childStorageKeyPrefix, code, extrinsicIndex, heapPages } from './substrate';
describe('substrate', (): void => {
const registry = new TypeRegistry();
it('changesTrieConfig should return the correct storage key', (): void => {
expect(changesTrieConfig(registry, 8)()).toEqual(Uint8Array.from([52, 58, 99, 104, 97, 110, 103, 101, 115, 95, 116, 114, 105, 101])); // Length-prefixed
});
it('childStorageKeyPrefix should return the correct storage key', (): void => {
expect(childStorageKeyPrefix(registry, 8)()).toEqual(Uint8Array.from([60, 58, 99, 104, 105, 108, 100, 95, 115, 116, 111, 114, 97, 103, 101, 58])); // Length-prefixed
});
it('code should return the correct storage key', (): void => {
expect(code(registry, 8)()).toEqual(Uint8Array.from([20, 58, 99, 111, 100, 101])); // Length-prefixed
});
it('extrinsicIndex should return the correct storage key', (): void => {
expect(extrinsicIndex(registry, 8)()).toEqual(
Uint8Array.from([64, 58, 101, 120, 116, 114, 105, 110, 115, 105, 99, 95, 105, 110, 100, 101, 120]) // Length-prefixed
);
});
it('heapPages should return the correct storage key', (): void => {
expect(heapPages(registry, 8)()).toEqual(Uint8Array.from([40, 58, 104, 101, 97, 112, 112, 97, 103, 101, 115])); // Length-prefixed
});
});
+18 -8
View File
@@ -3,19 +3,29 @@
import { Registry } from '@polkadot/types/types';
import { isHex, hexToU8a } from '@polkadot/util';
import { isString, u8aConcat, u8aToU8a } from '@polkadot/util';
import MetadataVersioned from './MetadataVersioned';
const VERSION_IDX = 4; // magic u32 preceding
// magic u32 preceding the version id
const VERSION_IDX = 4;
// first we try and parse using the versioned structure, if this does fail,
// we adjust with the magic number and a manual version and re-try. As soon as
// we remove support for V0, we will just do a new here
function decodeMetadata (registry: Registry, _value: Uint8Array | string = new Uint8Array()): MetadataVersioned {
const value = isHex(_value)
? hexToU8a(_value)
// magic + lowest supported version
const EMPTY_METADATA = u8aConcat(new Uint8Array([0x6d, 0x65, 0x74, 0x61, 9]));
const EMPTY_U8A = new Uint8Array();
function sanitizeInput (_value: Uint8Array | string = EMPTY_U8A): Uint8Array {
if (isString(_value)) {
return sanitizeInput(u8aToU8a(_value));
}
return _value.length === 0
? EMPTY_METADATA
: _value;
}
function decodeMetadata (registry: Registry, _value?: Uint8Array | string): MetadataVersioned {
const value = sanitizeInput(_value);
const version = value[VERSION_IDX];
try {
@@ -1,31 +1,22 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { MetadataAll, MetadataLatest, MetadataV0, MetadataV1, MetadataV2, MetadataV3, MetadataV4, MetadataV5, MetadataV6, MetadataV7, MetadataV8, MetadataV9, MetadataV10, MetadataV11 } from '@polkadot/types/interfaces/metadata';
import { MetadataAll, MetadataLatest, MetadataV9, MetadataV10, MetadataV11, MetadataV12 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
import Struct from '@polkadot/types/codec/Struct';
import { assert } from '@polkadot/util';
import MagicNumber from './MagicNumber';
import v0ToV1 from './v0/toV1';
import v1ToV2 from './v1/toV2';
import v2ToV3 from './v2/toV3';
import v3ToV4 from './v3/toV4';
import v4ToV5 from './v4/toV5';
import v5ToV6 from './v5/toV6';
import v6ToV7 from './v6/toV7';
import v7ToV8 from './v7/toV8';
import v8ToV9 from './v8/toV9';
import v9ToV10 from './v9/toV10';
import v10ToV11 from './v10/toV11';
import v11ToV12 from './v11/toV12';
import v12ToLatest from './v12/toLatest';
import { getUniqTypes, toCallsOnly } from './util';
type MetaMapped = MetadataV0 | MetadataV1 | MetadataV2 | MetadataV3 | MetadataV4 | MetadataV5 | MetadataV6 | MetadataV7 | MetadataV8 | MetadataV9 | MetadataV10 | MetadataV11;
type MetaVersions = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13;
type MetaAsX = 'asV0' | 'asV1' | 'asV2' | 'asV3' | 'asV4' | 'asV5' | 'asV6' | 'asV7' | 'asV8' | 'asV9' | 'asV10' | 'asV11' | 'asV12';
type MetaMapped = MetadataV9 | MetadataV10 | MetadataV11 | MetadataV12;
type MetaVersions = 9 | 10 | 11 | 12 | 13;
type MetaAsX = 'asV9' | 'asV10' | 'asV11' | 'asV12';
/**
* @name MetadataVersioned
@@ -74,75 +65,12 @@ export default class MetadataVersioned extends Struct {
}
/**
* @description Returns the wrapped metadata as a V0 object
*/
public get asV0 (): MetadataV0 {
this._assertVersion(0);
return this._metadata.asV0;
}
/**
* @description Returns the wrapped values as a V1 object
*/
public get asV1 (): MetadataV1 {
return this._getVersion(1, v0ToV1);
}
/**
* @description Returns the wrapped values as a V2 object
*/
public get asV2 (): MetadataV2 {
return this._getVersion(2, v1ToV2);
}
/**
* @description Returns the wrapped values as a V3 object
*/
public get asV3 (): MetadataV3 {
return this._getVersion(3, v2ToV3);
}
/**
* @description Returns the wrapped values as a V4 object
*/
public get asV4 (): MetadataV4 {
return this._getVersion(4, v3ToV4);
}
/**
* @description Returns the wrapped values as a V5 object
*/
public get asV5 (): MetadataV5 {
return this._getVersion(5, v4ToV5);
}
/**
* @description Returns the wrapped values as a V6 object
*/
public get asV6 (): MetadataV6 {
return this._getVersion(6, v5ToV6);
}
/**
* @description Returns the wrapped values as a V7 object
*/
public get asV7 (): MetadataV7 {
return this._getVersion(7, v6ToV7);
}
/**
* @description Returns the wrapped values as a V8 object
*/
public get asV8 (): MetadataV8 {
return this._getVersion(8, v7ToV8);
}
/**
* @description Returns the wrapped values as a V9 object
* @description Returns the wrapped metadata as a V1 object
*/
public get asV9 (): MetadataV9 {
return this._getVersion(9, v8ToV9);
this._assertVersion(9);
return this._metadata.asV9;
}
/**
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
-50
View File
@@ -1,50 +0,0 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { EventMetadataV1, FunctionMetadataV1, MetadataV0, MetadataV1, ModuleMetadataV1, RuntimeModuleMetadataV0, StorageFunctionMetadataV1 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
import { Option } from '@polkadot/types/codec';
import { Text } from '@polkadot/types/primitive';
import { stringUpperFirst } from '@polkadot/util';
/** @internal */
function toV1Calls (registry: Registry, { module: { call: { functions } } }: RuntimeModuleMetadataV0): Option<FunctionMetadataV1> {
return functions.length
? new Option(registry, 'Vec<FunctionMetadataV1>', functions)
: new Option(registry, 'Vec<FunctionMetadataV1>');
}
/** @internal */
function toV1Events (registry: Registry, metadataV0: MetadataV0, prefix: Text): Option<EventMetadataV1> {
const events = metadataV0.outerEvent.events.find((event): boolean => event[0].eq(prefix));
return events
? new Option(registry, 'Vec<EventMetadataV1>', events[1])
: new Option(registry, 'Vec<EventMetadataV1>');
}
/** @internal */
function toV1Storage (registry: Registry, { storage }: RuntimeModuleMetadataV0): Option<StorageFunctionMetadataV1> {
return new Option(registry, 'Vec<StorageFunctionMetadataV1>', storage.unwrapOr(undefined)?.functions);
}
/** @internal */
export default function toV1 (registry: Registry, metadataV0: MetadataV0): MetadataV1 {
return registry.createType('MetadataV1', {
modules: metadataV0.modules.map((mod): ModuleMetadataV1 => {
// The prefix of this module (capitalized)
const prefix = mod.storage.isSome
? mod.storage.unwrap().prefix.toString()
: stringUpperFirst(mod.prefix.toString()); // If this module doesn't have storage, we just assume the prefix is the name capitalized
return registry.createType('ModuleMetadataV1', {
calls: toV1Calls(registry, mod),
events: toV1Events(registry, metadataV0, mod.prefix),
name: mod.prefix, // Not capitalized
prefix, // Capitalized
storage: toV1Storage(registry, mod)
});
})
});
}
@@ -1,18 +0,0 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TypeRegistry } from '@polkadot/types';
import staticSubstrate from './static-substrate.json';
import rpcData from './static';
import { decodeLatestSubstrate, defaultValues, toLatest } from '../util/testUtil';
describe('MetadataV1', (): void => {
const registry = new TypeRegistry();
decodeLatestSubstrate(registry, 1, rpcData, staticSubstrate);
toLatest(registry, 1, rpcData, false);
defaultValues(registry, rpcData, false);
});
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
-10
View File
@@ -1,10 +0,0 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { MetadataV1, MetadataV2 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
/** @internal */
export default function toV2 (registry: Registry, metadataV1: MetadataV1): MetadataV2 {
return registry.createType('MetadataV2', metadataV1);
}
@@ -1,18 +0,0 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TypeRegistry } from '@polkadot/types';
import staticSubstrate from './static-substrate.json';
import rpcData from './static';
import { decodeLatestSubstrate, defaultValues, toLatest } from '../util/testUtil';
describe('MetadataV2', (): void => {
const registry = new TypeRegistry();
decodeLatestSubstrate(registry, 2, rpcData, staticSubstrate);
toLatest(registry, 2, rpcData, false);
defaultValues(registry, rpcData, false);
});
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
-10
View File
@@ -1,10 +0,0 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { MetadataV2, MetadataV3 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
/** @internal */
export default function toV3 (registry: Registry, metadataV2: MetadataV2): MetadataV3 {
return registry.createType('MetadataV3', metadataV2);
}
@@ -1,18 +0,0 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TypeRegistry } from '@polkadot/types';
import staticSubstrate from './static-substrate.json';
import rpcData from './static';
import { decodeLatestSubstrate, defaultValues, toLatest } from '../util/testUtil';
describe('MetadataV3', (): void => {
const registry = new TypeRegistry();
decodeLatestSubstrate(registry, 3, rpcData, staticSubstrate);
toLatest(registry, 3, rpcData, false);
defaultValues(registry, rpcData, false);
});
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
-61
View File
@@ -1,61 +0,0 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { MetadataV3, MetadataV4, ModuleMetadataV4, StorageFunctionMetadataV3, StorageFunctionMetadataV4 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
import { Option } from '@polkadot/types/codec';
/** @internal */
function toV4StorageFunction (registry: Registry, storageFn: StorageFunctionMetadataV3): StorageFunctionMetadataV4 {
const { documentation, fallback, modifier, name, type } = storageFn;
// Convert the old type to the new type: there is one new field
// called `hasher`, which we initialize to xxHash (the default in
// v3).
const [newType, index] = type.isPlain
? [type.asPlain, 0]
: type.isMap
? [registry.createType('MapTypeV4', {
hasher: registry.createType('StorageHasherV4', 'Twox128'),
key: type.asMap.key,
linked: type.asMap.linked,
value: type.asMap.value
}), 1]
: [registry.createType('DoubleMapTypeV4', {
hasher: registry.createType('StorageHasherV4', 'Twox128'),
key1: type.asDoubleMap.key1,
key2: type.asDoubleMap.key2,
key2Hasher: type.asDoubleMap.key2Hasher,
value: type.asDoubleMap.value
}), 2];
return registry.createType('StorageFunctionMetadataV4', {
documentation,
fallback,
modifier,
name,
type: registry.createType('StorageFunctionTypeV4', newType, index)
});
}
/** @internal */
export default function toV4 (registry: Registry, { modules }: MetadataV3): MetadataV4 {
return registry.createType('MetadataV4', {
modules: modules.map(({ calls, events, name, prefix, storage }): ModuleMetadataV4 =>
registry.createType('ModuleMetadataV4', {
calls,
events,
name,
prefix,
storage: storage.isSome
? new Option(
registry,
'Vec<StorageFunctionMetadataV4>',
storage.unwrap().map((v): StorageFunctionMetadataV4 => toV4StorageFunction(registry, v))
)
: undefined
})
)
});
}
@@ -1,18 +0,0 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TypeRegistry } from '@polkadot/types';
import staticSubstrate from './static-substrate.json';
import rpcData from './static';
import { decodeLatestSubstrate, defaultValues, toLatest } from '../util/testUtil';
describe('MetadataV4', (): void => {
const registry = new TypeRegistry();
decodeLatestSubstrate(registry, 4, rpcData, staticSubstrate);
toLatest(registry, 4, rpcData, false);
defaultValues(registry, rpcData, false);
});
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
-71
View File
@@ -1,71 +0,0 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { MetadataV4, MetadataV5, ModuleMetadataV5, StorageFunctionMetadataV4, StorageFunctionMetadataV5, StorageHasherV5 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
import { Option } from '@polkadot/types/codec';
import Text from '@polkadot/types/primitive/Text';
import { assert } from '@polkadot/util';
const hasherMap: Map<string, string> = new Map([
['blake2_128', 'Blake2_128'],
['blake2_256', 'Blake2_256'],
['twox_128', 'Twox128'],
['twox_256', 'Twox256'],
['twox_64_concat', 'Twox64Concat']
]);
/** @internal */
function toStorageHasher (registry: Registry, text: Text): StorageHasherV5 {
const mapped = hasherMap.get(text.toString());
assert(mapped, `Invalid Storage hasher: ${text.toString()}`);
return registry.createType('StorageHasherV5', mapped);
}
/** @internal */
function toV5StorageFunction (registry: Registry, storageFn: StorageFunctionMetadataV4): StorageFunctionMetadataV5 {
const { documentation, fallback, modifier, name, type } = storageFn;
const [newType, index] = type.isPlain
? [type.asPlain, 0]
: type.isMap
? [type.asMap, 1]
: [registry.createType('DoubleMapTypeV5', {
hasher: type.asDoubleMap.hasher,
key1: type.asDoubleMap.key1,
key2: type.asDoubleMap.key2,
key2Hasher: toStorageHasher(registry, type.asDoubleMap.key2Hasher),
value: type.asDoubleMap.value
}), 2];
return registry.createType('StorageFunctionMetadataV5', {
documentation,
fallback,
modifier,
name,
type: registry.createType('StorageFunctionTypeV5', newType, index)
});
}
/** @internal */
export default function toV5 (registry: Registry, { modules }: MetadataV4): MetadataV5 {
return registry.createType('MetadataV5', {
modules: modules.map(({ calls, events, name, prefix, storage }): ModuleMetadataV5 =>
registry.createType('ModuleMetadataV5', {
calls,
events,
name,
prefix,
storage: storage.isSome
? new Option(
registry,
'Vec<StorageFunctionMetadataV5>',
storage.unwrap().map((v): StorageFunctionMetadataV5 => toV5StorageFunction(registry, v))
)
: undefined
})
)
});
}
@@ -1,18 +0,0 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TypeRegistry } from '@polkadot/types';
import substrateJson from './static-substrate.json';
import substrateData from './static';
import { decodeLatestSubstrate, defaultValues, toLatest } from '../util/testUtil';
describe('MetadataV5 (substrate)', (): void => {
const registry = new TypeRegistry();
decodeLatestSubstrate(registry, 5, substrateData, substrateJson);
toLatest(registry, 5, substrateData, false);
defaultValues(registry, substrateData, false);
});
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
-21
View File
@@ -1,21 +0,0 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { MetadataV5, MetadataV6, ModuleMetadataV6 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
/** @internal */
export default function toV6 (registry: Registry, { modules }: MetadataV5): MetadataV6 {
return registry.createType('MetadataV6', {
modules: modules.map(({ calls, events, name, prefix, storage }): ModuleMetadataV6 =>
registry.createType('ModuleMetadataV6', {
calls,
constants: [],
events,
name,
prefix,
storage
})
)
});
}
@@ -1,18 +0,0 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TypeRegistry } from '@polkadot/types';
import substrateJson from './static-substrate.json';
import substrateData from './static';
import { decodeLatestSubstrate, defaultValues, toLatest } from '../util/testUtil';
describe('MetadataV6 (substrate)', (): void => {
const registry = new TypeRegistry();
decodeLatestSubstrate(registry, 6, substrateData, substrateJson);
toLatest(registry, 6, substrateData);
defaultValues(registry, substrateData);
});
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
-22
View File
@@ -1,22 +0,0 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { MetadataV6, MetadataV7, ModuleMetadataV7 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
/** @internal */
export default function toV7 (registry: Registry, { modules }: MetadataV6): MetadataV7 {
return registry.createType('MetadataV7', {
modules: modules.map(({ calls, constants, events, name, prefix, storage }): ModuleMetadataV7 =>
registry.createType('ModuleMetadataV7', {
calls,
constants,
events,
name,
storage: storage.isSome
? registry.createType('StorageMetadataV7', { items: storage.unwrap(), prefix })
: null
})
)
});
}
@@ -1,18 +0,0 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TypeRegistry } from '@polkadot/types';
import substrateJson from './static-substrate.json';
import substrateData from './static';
import { decodeLatestSubstrate, defaultValues, toLatest } from '../util/testUtil';
describe('MetadataV7 (substrate)', (): void => {
const registry = new TypeRegistry();
decodeLatestSubstrate(registry, 7, substrateData, substrateJson);
toLatest(registry, 7, substrateData);
defaultValues(registry, substrateData);
});
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
-21
View File
@@ -1,21 +0,0 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { MetadataV7, MetadataV8, ModuleMetadataV8 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
/** @internal */
export default function toV8 (registry: Registry, { modules }: MetadataV7): MetadataV8 {
return registry.createType('MetadataV8', {
modules: modules.map(({ calls, constants, events, name, storage }): ModuleMetadataV8 =>
registry.createType('ModuleMetadataV8', {
calls,
constants,
errors: [],
events,
name,
storage
})
)
});
}
@@ -1,18 +0,0 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { TypeRegistry } from '@polkadot/types';
import substrateJson from './static-substrate.json';
import substrateData from './static';
import { decodeLatestSubstrate, defaultValues, toLatest } from '../util/testUtil';
describe('MetadataV8 (substrate)', (): void => {
const registry = new TypeRegistry();
decodeLatestSubstrate(registry, 8, substrateData, substrateJson);
toLatest(registry, 8, substrateData);
defaultValues(registry, substrateData);
});
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
-10
View File
@@ -1,10 +0,0 @@
// Copyright 2017-2020 @polkadot/metadata authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { MetadataV8, MetadataV9 } from '@polkadot/types/interfaces/metadata';
import { Registry } from '@polkadot/types/types';
/** @internal */
export default function toV9 (registry: Registry, { modules }: MetadataV8): MetadataV9 {
return registry.createType('MetadataV9', { modules });
}
@@ -1,211 +0,0 @@
// Copyright 2017-2020 @polkadot/rpc-core authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { Balance } from '@polkadot/types/interfaces';
import { Codec } from '@polkadot/types/types';
import Metadata from '@polkadot/metadata/Decorated';
import rpcMetadataV3 from '@polkadot/metadata/Metadata/v3/static';
import rpcMetadataV4 from '@polkadot/metadata/Metadata/v4/static';
import rpcMetadataV5 from '@polkadot/metadata/Metadata/v5/static';
import rpcMetadataV6 from '@polkadot/metadata/Metadata/v6/static';
import rpcMetadataV7 from '@polkadot/metadata/Metadata/v7/static';
import rpcMetadataV8 from '@polkadot/metadata/Metadata/v8/static';
import { TypeRegistry } from '@polkadot/types';
import Rpc from '.';
const registry = new TypeRegistry();
const ADDR_ONE = '5DkQbYAExs3M2sZgT1Ec3mKfZnAQCL4Dt9beTCknkCUn5jzo';
const ADDR_TWO = '5C62W7ELLAAfix9LYrcx5smtcffbhvThkM5x7xfMeYXCtGwF';
const BALANCE_KEYS = [
/* v3-, using xxHash */ '0x4af2c53fce3ec33c6ccccf22e926f1a7',
/* v4+, using blake2_256 */ '0xec8f96437274a883afcac82d01a9defeb68209cd4f2c084632813692aa5e65ad'
];
const OPTION_BYTES_HEX = '0x210100000000000000000000000000000000000000000000000000000000000000000000000000000000011b4d03dd8c01f1049143cf9c4c817e4b167f1d1b83e5c6f0f10d89ba1e7bce';
function formattingTests (version: string, decorated: Metadata, encodedValues: [string, string, string]): void {
const [ENC_ONE, ENC_TWO, CONTRACT_KEY] = encodedValues;
describe(`formatting with Metadata ${version}`, (): void => {
let api: Rpc;
let provider: any;
beforeEach((): void => {
provider = {
send: jest.fn((method, [key]): Promise<any> =>
Promise.resolve(
BALANCE_KEYS.includes(key)
? '0x01020000000000000000000000000000'
: null
)
),
subscribe: jest.fn((type, method, params, cb): Promise<void> => {
if (params[0][0] === CONTRACT_KEY) {
// this emulates https://github.com/polkadot-js/api/issues/1051
cb(null, {
block: '0x2345',
changes: [
[CONTRACT_KEY, OPTION_BYTES_HEX]
]
});
} else if (params[0][0] === ENC_ONE || params[0][0] === ENC_TWO) {
// known values for the balanaces
cb(null, {
block: '0x1234',
changes: [
[ENC_ONE, '0x01020000000000000000000000000000'],
[ENC_TWO, '0x02010000000000000000000000000000']
]
});
} else {
// return empty values for all else
cb(null, {
block: '0x3456',
changes: [
[params[0][0], null]
]
});
}
return Promise.resolve();
})
};
api = new Rpc(registry, provider);
});
it('encodes key (with params), decoding response', (done): void => {
api.state
.getStorage<Balance>([decorated.query.balances.freeBalance, ADDR_ONE])
.subscribe((value): void => {
expect(
provider.send
).toHaveBeenCalledWith(
'state_getStorage',
[ENC_ONE]
);
expect(value.toNumber()).toEqual(513);
done();
});
});
it('returns the fallback result on not-found values', (done): void => {
api.state
.getStorage([decorated.query.system.account, ADDR_ONE])
.subscribe(([value]: any): void => {
expect(value.toHex()).toEqual('0x00000000');
done();
});
});
it('encodes multiple keys, decoding multiple results', (done): void => {
api.state.subscribeStorage<[Balance, Balance]>(
[
[decorated.query.balances.freeBalance, ADDR_ONE],
[decorated.query.balances.freeBalance, ADDR_TWO]
]
).subscribe((value): void => {
// console.error(value);
expect(
provider.subscribe
).toHaveBeenCalledWith(
'state_storage',
'state_subscribeStorage',
[[ENC_ONE, ENC_TWO]],
expect.anything()
);
expect(
value.map((balance): number =>
balance.toNumber()
)
).toEqual([0x0201, 0x0102]);
done();
});
});
it('handles the case where Option<Bytes> are retrieved', (done): void => {
const call = Number(version.slice(1)) <= 5
? decorated.query.contract.pristineCode
: decorated.query.contracts.pristineCode;
api.state
.subscribeStorage([[call, '0x00']])
// eslint-disable-next-line @typescript-eslint/no-unused-vars
.subscribe((value: Codec[]): void => {
expect(value).toHaveLength(1);
// console.error(value);
// expect(value.toHex()).toBe(OPTION_BYTES_HEX);
done();
});
});
it('handles fallbacks for linked heads (new metadata only)', (done): void => {
const iterKey = decorated.query.staking.validators && decorated.query.staking.validators.iterKey;
// skip for old
if (!iterKey) {
return done();
}
api.state
.subscribeStorage([iterKey()])
.subscribe((value: Codec[]): void => {
expect(value).toHaveLength(1);
// console.error('head fallback', value);
done();
});
});
it('handles fallbacks for linked maps (new metadata only)', (done): void => {
api.state
.subscribeStorage([[decorated.query.staking.validators, '0x00']])
.subscribe(([value]: Codec[]): void => {
expect(value).toBeDefined();
// console.error('linked fallback', value);
done();
});
});
});
}
formattingTests('v3', new Metadata(registry, rpcMetadataV3), [
'0x4af2c53fce3ec33c6ccccf22e926f1a7',
'0x3e62f7ed6e788e1337bce2a97b68a12a',
'0x777519cd81f845abdb40d253923d6098'
]);
formattingTests('v4', new Metadata(registry, rpcMetadataV4), [
'0xec8f96437274a883afcac82d01a9defeb68209cd4f2c084632813692aa5e65ad',
'0x1dbb0224910f42a14e7f1406b24c6fe8157296691b02a78756e01946038fffab',
'0xc7879f4faa637a90d782070a3cb6be99a9fb0316e19a0454ce93c4f0a34712f1'
]);
formattingTests('v5', new Metadata(registry, rpcMetadataV5), [
'0xec8f96437274a883afcac82d01a9defeb68209cd4f2c084632813692aa5e65ad',
'0x1dbb0224910f42a14e7f1406b24c6fe8157296691b02a78756e01946038fffab',
'0xc7879f4faa637a90d782070a3cb6be99a9fb0316e19a0454ce93c4f0a34712f1'
]);
formattingTests('v6', new Metadata(registry, rpcMetadataV6), [
'0xec8f96437274a883afcac82d01a9defeb68209cd4f2c084632813692aa5e65ad',
'0x1dbb0224910f42a14e7f1406b24c6fe8157296691b02a78756e01946038fffab',
'0xc7879f4faa637a90d782070a3cb6be99a9fb0316e19a0454ce93c4f0a34712f1'
]);
formattingTests('v7', new Metadata(registry, rpcMetadataV7), [
'0xec8f96437274a883afcac82d01a9defeb68209cd4f2c084632813692aa5e65ad',
'0x1dbb0224910f42a14e7f1406b24c6fe8157296691b02a78756e01946038fffab',
'0xc7879f4faa637a90d782070a3cb6be99a9fb0316e19a0454ce93c4f0a34712f1'
]);
formattingTests('v8', new Metadata(registry, rpcMetadataV8), [
'0xec8f96437274a883afcac82d01a9defeb68209cd4f2c084632813692aa5e65ad',
'0x1dbb0224910f42a14e7f1406b24c6fe8157296691b02a78756e01946038fffab',
'0xc7879f4faa637a90d782070a3cb6be99a9fb0316e19a0454ce93c4f0a34712f1'
]);
+7 -2
View File
@@ -51,10 +51,12 @@ function tsEnum (definitions: Record<string, ModuleTypes>, { name: enumName, sub
const keys = (sub as TypeDef[]).map(({ info, name = '', type }): string => {
const getter = stringUpperFirst(stringCamelCase(name.replace(' ', '_')));
const isComplexType = [TypeDefInfo.Tuple, TypeDefInfo.VecFixed].includes(info);
const asGetter = type === 'Null'
const asGetter = type === 'Null' || info === TypeDefInfo.DoNotConstruct
? ''
: createGetter(definitions, `as${getter}`, isComplexType ? formatType(definitions, type, imports) : type, imports);
const isGetter = createGetter(definitions, `is${getter}`, 'boolean', imports);
const isGetter = info === TypeDefInfo.DoNotConstruct
? ''
: createGetter(definitions, `is${getter}`, 'boolean', imports);
switch (info) {
case TypeDefInfo.Compact:
@@ -65,6 +67,9 @@ function tsEnum (definitions: Record<string, ModuleTypes>, { name: enumName, sub
case TypeDefInfo.VecFixed:
return `${isGetter}${asGetter}`;
case TypeDefInfo.DoNotConstruct:
return '';
default:
throw new Error(`Enum: ${enumName || 'undefined'}: Unhandled type ${TypeDefInfo[info]}`);
}
-8
View File
@@ -9,7 +9,6 @@ import { Text } from '@polkadot/types';
import { bnToBn, isUndefined } from '@polkadot/util';
import typesChain from './chain';
import typesMeta from './metadata';
import typesModules from './modules';
import typesSpec from './spec';
import upgrades from './upgrades';
@@ -29,13 +28,6 @@ function filterVersions (versions: OverrideVersionedType[] = [], specVersion: nu
}), {});
}
/**
* @description Based on the metadata version, return the registry types
*/
export function getMetadataTypes (_registry: Registry, specVersion: number): RegistryTypes {
return filterVersions(typesMeta, specVersion);
}
/**
* @description Get types for specific modules (metadata override)
*/
-25
View File
@@ -1,25 +0,0 @@
// Copyright 2017-2020 @polkadot/types-known authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { OverrideVersionedType } from '@polkadot/types/types';
// Type overrides based on metadata versions
const typesMeta: OverrideVersionedType[] = [
{
// NOTE this is for support of old, e.g. Alex, old metadata and BlockNumber/Index
// This is detected based on metadata version, since this is what we have up-front
// v3 = Alex
// v4 = v1.0 branch
minmax: [0, 4],
types: {
Address: 'GenericAddress',
BlockNumber: 'u64',
EventRecord: 'EventRecordTo76',
Index: 'u64',
StakingLedger: 'StakingLedgerTo223',
ValidatorPrefs: 'ValidatorPrefsTo145'
}
}
];
export default typesMeta;
-4
View File
@@ -11,10 +11,6 @@ const typesModules: Record<string, OverrideModuleType> = {
balances: {
Status: 'BalanceStatus'
},
contract: { // old metadata & naming
// v2 & v3
AccountInfo: 'ContractAccountInfo'
},
contracts: {
StorageKey: 'ContractStorageKey'
},
+5 -362
View File
@@ -25,7 +25,7 @@ import { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV
import { AuthorityIndex, AuthorityList, AuthorityWeight, EncodedFinalityProofs, GrandpaEquivocation, GrandpaEquivocationProof, GrandpaEquivocationValue, GrandpaPrevote, JustificationNotification, KeyOwnerProof, NextAuthority, PendingPause, PendingResume, Precommits, Prevotes, ReportedRoundStates, RoundState, SetId, StoredPendingChange, StoredState } from '@polkadot/types/interfaces/grandpa';
import { IdentityFields, IdentityInfo, IdentityInfoAdditional, IdentityJudgement, RegistrarIndex, RegistrarInfo, Registration, RegistrationJudgement } from '@polkadot/types/interfaces/identity';
import { AuthIndex, AuthoritySignature, Heartbeat, HeartbeatTo244, OpaqueMultiaddr, OpaqueNetworkState, OpaquePeerId } from '@polkadot/types/interfaces/imOnline';
import { CallMetadataV0, DoubleMapTypeLatest, DoubleMapTypeV10, DoubleMapTypeV11, DoubleMapTypeV12, DoubleMapTypeV3, DoubleMapTypeV4, DoubleMapTypeV5, DoubleMapTypeV6, DoubleMapTypeV7, DoubleMapTypeV8, DoubleMapTypeV9, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV8, ErrorMetadataV9, EventMetadataLatest, EventMetadataV0, EventMetadataV1, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV2, EventMetadataV3, EventMetadataV4, EventMetadataV5, EventMetadataV6, EventMetadataV7, EventMetadataV8, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV0, FunctionArgumentMetadataV1, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV2, FunctionArgumentMetadataV3, FunctionArgumentMetadataV4, FunctionArgumentMetadataV5, FunctionArgumentMetadataV6, FunctionArgumentMetadataV7, FunctionArgumentMetadataV8, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV0, FunctionMetadataV1, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV2, FunctionMetadataV3, FunctionMetadataV4, FunctionMetadataV5, FunctionMetadataV6, FunctionMetadataV7, FunctionMetadataV8, FunctionMetadataV9, MapTypeLatest, MapTypeV0, MapTypeV10, MapTypeV11, MapTypeV12, MapTypeV2, MapTypeV3, MapTypeV4, MapTypeV5, MapTypeV6, MapTypeV7, MapTypeV8, MapTypeV9, MetadataAll, MetadataLatest, MetadataV0, MetadataV1, MetadataV10, MetadataV11, MetadataV12, MetadataV2, MetadataV3, MetadataV4, MetadataV5, MetadataV6, MetadataV7, MetadataV8, MetadataV9, ModuleConstantMetadataLatest, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV6, ModuleConstantMetadataV7, ModuleConstantMetadataV8, ModuleConstantMetadataV9, ModuleMetadataLatest, ModuleMetadataV0, ModuleMetadataV1, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV2, ModuleMetadataV3, ModuleMetadataV4, ModuleMetadataV5, ModuleMetadataV6, ModuleMetadataV7, ModuleMetadataV8, ModuleMetadataV9, OuterDispatchCallV0, OuterDispatchMetadataV0, OuterEventEventMetadataEventsV0, OuterEventEventMetadataV0, OuterEventMetadataV0, PlainTypeLatest, PlainTypeV0, PlainTypeV10, PlainTypeV11, PlainTypeV12, PlainTypeV2, PlainTypeV3, PlainTypeV4, PlainTypeV5, PlainTypeV6, PlainTypeV7, PlainTypeV8, PlainTypeV9, RuntimeModuleMetadataV0, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV6, StorageEntryMetadataV7, StorageEntryMetadataV8, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV6, StorageEntryModifierV7, StorageEntryModifierV8, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV6, StorageEntryTypeV7, StorageEntryTypeV8, StorageEntryTypeV9, StorageFunctionMetadataV0, StorageFunctionMetadataV1, StorageFunctionMetadataV2, StorageFunctionMetadataV3, StorageFunctionMetadataV4, StorageFunctionMetadataV5, StorageFunctionModifierV0, StorageFunctionModifierV1, StorageFunctionModifierV2, StorageFunctionModifierV3, StorageFunctionModifierV4, StorageFunctionModifierV5, StorageFunctionTypeV0, StorageFunctionTypeV1, StorageFunctionTypeV2, StorageFunctionTypeV3, StorageFunctionTypeV4, StorageFunctionTypeV5, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV4, StorageHasherV5, StorageHasherV6, StorageHasherV7, StorageHasherV8, StorageHasherV9, StorageMetadataLatest, StorageMetadataV0, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV7, StorageMetadataV8, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata';
import { DoubleMapTypeLatest, DoubleMapTypeV10, DoubleMapTypeV11, DoubleMapTypeV12, DoubleMapTypeV9, ErrorMetadataV10, ErrorMetadataV11, ErrorMetadataV12, ErrorMetadataV9, EventMetadataLatest, EventMetadataV10, EventMetadataV11, EventMetadataV12, EventMetadataV9, ExtrinsicMetadataLatest, ExtrinsicMetadataV11, ExtrinsicMetadataV12, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV10, FunctionArgumentMetadataV11, FunctionArgumentMetadataV12, FunctionArgumentMetadataV9, FunctionMetadataLatest, FunctionMetadataV10, FunctionMetadataV11, FunctionMetadataV12, FunctionMetadataV9, MapTypeLatest, MapTypeV10, MapTypeV11, MapTypeV12, MapTypeV9, MetadataAll, MetadataLatest, MetadataV10, MetadataV11, MetadataV12, MetadataV9, ModuleConstantMetadataLatest, ModuleConstantMetadataV10, ModuleConstantMetadataV11, ModuleConstantMetadataV12, ModuleConstantMetadataV9, ModuleMetadataLatest, ModuleMetadataV10, ModuleMetadataV11, ModuleMetadataV12, ModuleMetadataV9, StorageEntryMetadataLatest, StorageEntryMetadataV10, StorageEntryMetadataV11, StorageEntryMetadataV12, StorageEntryMetadataV9, StorageEntryModifierLatest, StorageEntryModifierV10, StorageEntryModifierV11, StorageEntryModifierV12, StorageEntryModifierV9, StorageEntryTypeLatest, StorageEntryTypeV10, StorageEntryTypeV11, StorageEntryTypeV12, StorageEntryTypeV9, StorageHasher, StorageHasherV10, StorageHasherV11, StorageHasherV12, StorageHasherV9, StorageMetadataLatest, StorageMetadataV10, StorageMetadataV11, StorageMetadataV12, StorageMetadataV9 } from '@polkadot/types/interfaces/metadata';
import { StorageKind } from '@polkadot/types/interfaces/offchain';
import { DeferredOffenceOf, Kind, OffenceDetails, Offender, OpaqueTimeSlot, ReportIdOf, Reporter } from '@polkadot/types/interfaces/offences';
import { AbridgedCandidateReceipt, AttestedCandidate, AuctionIndex, Bidder, CandidateCommitments, CandidateReceipt, CollatorId, CollatorSignature, DoubleVoteReport, DownwardMessage, GlobalValidationSchedule, HeadData, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, LeasePeriod, LeasePeriodOf, LocalValidationData, NewBidder, ParaId, ParaInfo, ParaPastCodeMeta, ParaScheduling, ParachainDispatchOrigin, ParachainProposal, RegisteredParachainInfo, RelayChainBlockNumber, Remark, Retriable, Scheduling, SigningContext, SlotRange, Statement, SubId, UpwardMessage, ValidationCode, ValidationFunctionParams, ValidatorSignature, ValidityAttestation, WinningData, WinningDataEntry } from '@polkadot/types/interfaces/parachains';
@@ -42,7 +42,7 @@ import { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatu
import { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactScore, CompactScoreCompact, ElectionCompute, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RewardDestination, RewardDestinationTo257, RewardPoint, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196 } from '@polkadot/types/interfaces/staking';
import { ApiId, KeyValueOption, ReadProof, RuntimeVersion, RuntimeVersionApi, StorageChangeSet } from '@polkadot/types/interfaces/state';
import { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support';
import { AccountInfo, ApplyExtrinsicResult, ChainProperties, ChainType, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, EventRecordTo76, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, Phase, RefCount, RefCountTo259, TransactionValidityError, UnknownTransaction } from '@polkadot/types/interfaces/system';
import { AccountInfo, ApplyExtrinsicResult, ChainProperties, ChainType, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, Phase, RefCount, RefCountTo259, TransactionValidityError, UnknownTransaction } from '@polkadot/types/interfaces/system';
import { Bounty, BountyIndex, BountyStatus, BountyStatusActive, BountyStatusCuratorProposed, BountyStatusPendingPayout, OpenTip, OpenTipFinderTo225, OpenTipTip, OpenTipTo225, TreasuryProposal } from '@polkadot/types/interfaces/treasury';
import { Multiplier } from '@polkadot/types/interfaces/txpayment';
import { Multisig, Timepoint } from '@polkadot/types/interfaces/utility';
@@ -1134,9 +1134,6 @@ declare module '@polkadot/types/types/registry' {
EventRecord: EventRecord;
'Option<EventRecord>': Option<EventRecord>;
'Vec<EventRecord>': Vec<EventRecord>;
EventRecordTo76: EventRecordTo76;
'Option<EventRecordTo76>': Option<EventRecordTo76>;
'Vec<EventRecordTo76>': Vec<EventRecordTo76>;
Health: Health;
'Option<Health>': Option<Health>;
'Vec<Health>': Vec<Health>;
@@ -1401,345 +1398,6 @@ declare module '@polkadot/types/types/registry' {
EthereumLookupSource: EthereumLookupSource;
'Option<EthereumLookupSource>': Option<EthereumLookupSource>;
'Vec<EthereumLookupSource>': Vec<EthereumLookupSource>;
CallMetadataV0: CallMetadataV0;
'Option<CallMetadataV0>': Option<CallMetadataV0>;
'Vec<CallMetadataV0>': Vec<CallMetadataV0>;
EventMetadataV0: EventMetadataV0;
'Option<EventMetadataV0>': Option<EventMetadataV0>;
'Vec<EventMetadataV0>': Vec<EventMetadataV0>;
FunctionArgumentMetadataV0: FunctionArgumentMetadataV0;
'Option<FunctionArgumentMetadataV0>': Option<FunctionArgumentMetadataV0>;
'Vec<FunctionArgumentMetadataV0>': Vec<FunctionArgumentMetadataV0>;
FunctionMetadataV0: FunctionMetadataV0;
'Option<FunctionMetadataV0>': Option<FunctionMetadataV0>;
'Vec<FunctionMetadataV0>': Vec<FunctionMetadataV0>;
MapTypeV0: MapTypeV0;
'Option<MapTypeV0>': Option<MapTypeV0>;
'Vec<MapTypeV0>': Vec<MapTypeV0>;
MetadataV0: MetadataV0;
'Option<MetadataV0>': Option<MetadataV0>;
'Vec<MetadataV0>': Vec<MetadataV0>;
ModuleMetadataV0: ModuleMetadataV0;
'Option<ModuleMetadataV0>': Option<ModuleMetadataV0>;
'Vec<ModuleMetadataV0>': Vec<ModuleMetadataV0>;
OuterDispatchCallV0: OuterDispatchCallV0;
'Option<OuterDispatchCallV0>': Option<OuterDispatchCallV0>;
'Vec<OuterDispatchCallV0>': Vec<OuterDispatchCallV0>;
OuterDispatchMetadataV0: OuterDispatchMetadataV0;
'Option<OuterDispatchMetadataV0>': Option<OuterDispatchMetadataV0>;
'Vec<OuterDispatchMetadataV0>': Vec<OuterDispatchMetadataV0>;
OuterEventEventMetadataEventsV0: OuterEventEventMetadataEventsV0;
'Option<OuterEventEventMetadataEventsV0>': Option<OuterEventEventMetadataEventsV0>;
'Vec<OuterEventEventMetadataEventsV0>': Vec<OuterEventEventMetadataEventsV0>;
OuterEventEventMetadataV0: OuterEventEventMetadataV0;
'Option<OuterEventEventMetadataV0>': Option<OuterEventEventMetadataV0>;
'Vec<OuterEventEventMetadataV0>': Vec<OuterEventEventMetadataV0>;
OuterEventMetadataV0: OuterEventMetadataV0;
'Option<OuterEventMetadataV0>': Option<OuterEventMetadataV0>;
'Vec<OuterEventMetadataV0>': Vec<OuterEventMetadataV0>;
PlainTypeV0: PlainTypeV0;
'Option<PlainTypeV0>': Option<PlainTypeV0>;
'Vec<PlainTypeV0>': Vec<PlainTypeV0>;
RuntimeModuleMetadataV0: RuntimeModuleMetadataV0;
'Option<RuntimeModuleMetadataV0>': Option<RuntimeModuleMetadataV0>;
'Vec<RuntimeModuleMetadataV0>': Vec<RuntimeModuleMetadataV0>;
StorageFunctionMetadataV0: StorageFunctionMetadataV0;
'Option<StorageFunctionMetadataV0>': Option<StorageFunctionMetadataV0>;
'Vec<StorageFunctionMetadataV0>': Vec<StorageFunctionMetadataV0>;
StorageFunctionModifierV0: StorageFunctionModifierV0;
'Option<StorageFunctionModifierV0>': Option<StorageFunctionModifierV0>;
'Vec<StorageFunctionModifierV0>': Vec<StorageFunctionModifierV0>;
StorageFunctionTypeV0: StorageFunctionTypeV0;
'Option<StorageFunctionTypeV0>': Option<StorageFunctionTypeV0>;
'Vec<StorageFunctionTypeV0>': Vec<StorageFunctionTypeV0>;
StorageMetadataV0: StorageMetadataV0;
'Option<StorageMetadataV0>': Option<StorageMetadataV0>;
'Vec<StorageMetadataV0>': Vec<StorageMetadataV0>;
EventMetadataV1: EventMetadataV1;
'Option<EventMetadataV1>': Option<EventMetadataV1>;
'Vec<EventMetadataV1>': Vec<EventMetadataV1>;
FunctionArgumentMetadataV1: FunctionArgumentMetadataV1;
'Option<FunctionArgumentMetadataV1>': Option<FunctionArgumentMetadataV1>;
'Vec<FunctionArgumentMetadataV1>': Vec<FunctionArgumentMetadataV1>;
FunctionMetadataV1: FunctionMetadataV1;
'Option<FunctionMetadataV1>': Option<FunctionMetadataV1>;
'Vec<FunctionMetadataV1>': Vec<FunctionMetadataV1>;
MetadataV1: MetadataV1;
'Option<MetadataV1>': Option<MetadataV1>;
'Vec<MetadataV1>': Vec<MetadataV1>;
ModuleMetadataV1: ModuleMetadataV1;
'Option<ModuleMetadataV1>': Option<ModuleMetadataV1>;
'Vec<ModuleMetadataV1>': Vec<ModuleMetadataV1>;
StorageFunctionMetadataV1: StorageFunctionMetadataV1;
'Option<StorageFunctionMetadataV1>': Option<StorageFunctionMetadataV1>;
'Vec<StorageFunctionMetadataV1>': Vec<StorageFunctionMetadataV1>;
StorageFunctionModifierV1: StorageFunctionModifierV1;
'Option<StorageFunctionModifierV1>': Option<StorageFunctionModifierV1>;
'Vec<StorageFunctionModifierV1>': Vec<StorageFunctionModifierV1>;
StorageFunctionTypeV1: StorageFunctionTypeV1;
'Option<StorageFunctionTypeV1>': Option<StorageFunctionTypeV1>;
'Vec<StorageFunctionTypeV1>': Vec<StorageFunctionTypeV1>;
EventMetadataV2: EventMetadataV2;
'Option<EventMetadataV2>': Option<EventMetadataV2>;
'Vec<EventMetadataV2>': Vec<EventMetadataV2>;
FunctionArgumentMetadataV2: FunctionArgumentMetadataV2;
'Option<FunctionArgumentMetadataV2>': Option<FunctionArgumentMetadataV2>;
'Vec<FunctionArgumentMetadataV2>': Vec<FunctionArgumentMetadataV2>;
FunctionMetadataV2: FunctionMetadataV2;
'Option<FunctionMetadataV2>': Option<FunctionMetadataV2>;
'Vec<FunctionMetadataV2>': Vec<FunctionMetadataV2>;
MapTypeV2: MapTypeV2;
'Option<MapTypeV2>': Option<MapTypeV2>;
'Vec<MapTypeV2>': Vec<MapTypeV2>;
MetadataV2: MetadataV2;
'Option<MetadataV2>': Option<MetadataV2>;
'Vec<MetadataV2>': Vec<MetadataV2>;
ModuleMetadataV2: ModuleMetadataV2;
'Option<ModuleMetadataV2>': Option<ModuleMetadataV2>;
'Vec<ModuleMetadataV2>': Vec<ModuleMetadataV2>;
PlainTypeV2: PlainTypeV2;
'Option<PlainTypeV2>': Option<PlainTypeV2>;
'Vec<PlainTypeV2>': Vec<PlainTypeV2>;
StorageFunctionMetadataV2: StorageFunctionMetadataV2;
'Option<StorageFunctionMetadataV2>': Option<StorageFunctionMetadataV2>;
'Vec<StorageFunctionMetadataV2>': Vec<StorageFunctionMetadataV2>;
StorageFunctionModifierV2: StorageFunctionModifierV2;
'Option<StorageFunctionModifierV2>': Option<StorageFunctionModifierV2>;
'Vec<StorageFunctionModifierV2>': Vec<StorageFunctionModifierV2>;
StorageFunctionTypeV2: StorageFunctionTypeV2;
'Option<StorageFunctionTypeV2>': Option<StorageFunctionTypeV2>;
'Vec<StorageFunctionTypeV2>': Vec<StorageFunctionTypeV2>;
DoubleMapTypeV3: DoubleMapTypeV3;
'Option<DoubleMapTypeV3>': Option<DoubleMapTypeV3>;
'Vec<DoubleMapTypeV3>': Vec<DoubleMapTypeV3>;
EventMetadataV3: EventMetadataV3;
'Option<EventMetadataV3>': Option<EventMetadataV3>;
'Vec<EventMetadataV3>': Vec<EventMetadataV3>;
FunctionArgumentMetadataV3: FunctionArgumentMetadataV3;
'Option<FunctionArgumentMetadataV3>': Option<FunctionArgumentMetadataV3>;
'Vec<FunctionArgumentMetadataV3>': Vec<FunctionArgumentMetadataV3>;
FunctionMetadataV3: FunctionMetadataV3;
'Option<FunctionMetadataV3>': Option<FunctionMetadataV3>;
'Vec<FunctionMetadataV3>': Vec<FunctionMetadataV3>;
MapTypeV3: MapTypeV3;
'Option<MapTypeV3>': Option<MapTypeV3>;
'Vec<MapTypeV3>': Vec<MapTypeV3>;
MetadataV3: MetadataV3;
'Option<MetadataV3>': Option<MetadataV3>;
'Vec<MetadataV3>': Vec<MetadataV3>;
ModuleMetadataV3: ModuleMetadataV3;
'Option<ModuleMetadataV3>': Option<ModuleMetadataV3>;
'Vec<ModuleMetadataV3>': Vec<ModuleMetadataV3>;
PlainTypeV3: PlainTypeV3;
'Option<PlainTypeV3>': Option<PlainTypeV3>;
'Vec<PlainTypeV3>': Vec<PlainTypeV3>;
StorageFunctionMetadataV3: StorageFunctionMetadataV3;
'Option<StorageFunctionMetadataV3>': Option<StorageFunctionMetadataV3>;
'Vec<StorageFunctionMetadataV3>': Vec<StorageFunctionMetadataV3>;
StorageFunctionModifierV3: StorageFunctionModifierV3;
'Option<StorageFunctionModifierV3>': Option<StorageFunctionModifierV3>;
'Vec<StorageFunctionModifierV3>': Vec<StorageFunctionModifierV3>;
StorageFunctionTypeV3: StorageFunctionTypeV3;
'Option<StorageFunctionTypeV3>': Option<StorageFunctionTypeV3>;
'Vec<StorageFunctionTypeV3>': Vec<StorageFunctionTypeV3>;
DoubleMapTypeV4: DoubleMapTypeV4;
'Option<DoubleMapTypeV4>': Option<DoubleMapTypeV4>;
'Vec<DoubleMapTypeV4>': Vec<DoubleMapTypeV4>;
EventMetadataV4: EventMetadataV4;
'Option<EventMetadataV4>': Option<EventMetadataV4>;
'Vec<EventMetadataV4>': Vec<EventMetadataV4>;
FunctionArgumentMetadataV4: FunctionArgumentMetadataV4;
'Option<FunctionArgumentMetadataV4>': Option<FunctionArgumentMetadataV4>;
'Vec<FunctionArgumentMetadataV4>': Vec<FunctionArgumentMetadataV4>;
FunctionMetadataV4: FunctionMetadataV4;
'Option<FunctionMetadataV4>': Option<FunctionMetadataV4>;
'Vec<FunctionMetadataV4>': Vec<FunctionMetadataV4>;
MapTypeV4: MapTypeV4;
'Option<MapTypeV4>': Option<MapTypeV4>;
'Vec<MapTypeV4>': Vec<MapTypeV4>;
MetadataV4: MetadataV4;
'Option<MetadataV4>': Option<MetadataV4>;
'Vec<MetadataV4>': Vec<MetadataV4>;
ModuleMetadataV4: ModuleMetadataV4;
'Option<ModuleMetadataV4>': Option<ModuleMetadataV4>;
'Vec<ModuleMetadataV4>': Vec<ModuleMetadataV4>;
PlainTypeV4: PlainTypeV4;
'Option<PlainTypeV4>': Option<PlainTypeV4>;
'Vec<PlainTypeV4>': Vec<PlainTypeV4>;
StorageFunctionMetadataV4: StorageFunctionMetadataV4;
'Option<StorageFunctionMetadataV4>': Option<StorageFunctionMetadataV4>;
'Vec<StorageFunctionMetadataV4>': Vec<StorageFunctionMetadataV4>;
StorageFunctionModifierV4: StorageFunctionModifierV4;
'Option<StorageFunctionModifierV4>': Option<StorageFunctionModifierV4>;
'Vec<StorageFunctionModifierV4>': Vec<StorageFunctionModifierV4>;
StorageFunctionTypeV4: StorageFunctionTypeV4;
'Option<StorageFunctionTypeV4>': Option<StorageFunctionTypeV4>;
'Vec<StorageFunctionTypeV4>': Vec<StorageFunctionTypeV4>;
StorageHasherV4: StorageHasherV4;
'Option<StorageHasherV4>': Option<StorageHasherV4>;
'Vec<StorageHasherV4>': Vec<StorageHasherV4>;
DoubleMapTypeV5: DoubleMapTypeV5;
'Option<DoubleMapTypeV5>': Option<DoubleMapTypeV5>;
'Vec<DoubleMapTypeV5>': Vec<DoubleMapTypeV5>;
EventMetadataV5: EventMetadataV5;
'Option<EventMetadataV5>': Option<EventMetadataV5>;
'Vec<EventMetadataV5>': Vec<EventMetadataV5>;
FunctionArgumentMetadataV5: FunctionArgumentMetadataV5;
'Option<FunctionArgumentMetadataV5>': Option<FunctionArgumentMetadataV5>;
'Vec<FunctionArgumentMetadataV5>': Vec<FunctionArgumentMetadataV5>;
FunctionMetadataV5: FunctionMetadataV5;
'Option<FunctionMetadataV5>': Option<FunctionMetadataV5>;
'Vec<FunctionMetadataV5>': Vec<FunctionMetadataV5>;
MapTypeV5: MapTypeV5;
'Option<MapTypeV5>': Option<MapTypeV5>;
'Vec<MapTypeV5>': Vec<MapTypeV5>;
MetadataV5: MetadataV5;
'Option<MetadataV5>': Option<MetadataV5>;
'Vec<MetadataV5>': Vec<MetadataV5>;
ModuleMetadataV5: ModuleMetadataV5;
'Option<ModuleMetadataV5>': Option<ModuleMetadataV5>;
'Vec<ModuleMetadataV5>': Vec<ModuleMetadataV5>;
PlainTypeV5: PlainTypeV5;
'Option<PlainTypeV5>': Option<PlainTypeV5>;
'Vec<PlainTypeV5>': Vec<PlainTypeV5>;
StorageFunctionMetadataV5: StorageFunctionMetadataV5;
'Option<StorageFunctionMetadataV5>': Option<StorageFunctionMetadataV5>;
'Vec<StorageFunctionMetadataV5>': Vec<StorageFunctionMetadataV5>;
StorageFunctionModifierV5: StorageFunctionModifierV5;
'Option<StorageFunctionModifierV5>': Option<StorageFunctionModifierV5>;
'Vec<StorageFunctionModifierV5>': Vec<StorageFunctionModifierV5>;
StorageFunctionTypeV5: StorageFunctionTypeV5;
'Option<StorageFunctionTypeV5>': Option<StorageFunctionTypeV5>;
'Vec<StorageFunctionTypeV5>': Vec<StorageFunctionTypeV5>;
StorageHasherV5: StorageHasherV5;
'Option<StorageHasherV5>': Option<StorageHasherV5>;
'Vec<StorageHasherV5>': Vec<StorageHasherV5>;
DoubleMapTypeV6: DoubleMapTypeV6;
'Option<DoubleMapTypeV6>': Option<DoubleMapTypeV6>;
'Vec<DoubleMapTypeV6>': Vec<DoubleMapTypeV6>;
EventMetadataV6: EventMetadataV6;
'Option<EventMetadataV6>': Option<EventMetadataV6>;
'Vec<EventMetadataV6>': Vec<EventMetadataV6>;
FunctionArgumentMetadataV6: FunctionArgumentMetadataV6;
'Option<FunctionArgumentMetadataV6>': Option<FunctionArgumentMetadataV6>;
'Vec<FunctionArgumentMetadataV6>': Vec<FunctionArgumentMetadataV6>;
FunctionMetadataV6: FunctionMetadataV6;
'Option<FunctionMetadataV6>': Option<FunctionMetadataV6>;
'Vec<FunctionMetadataV6>': Vec<FunctionMetadataV6>;
MapTypeV6: MapTypeV6;
'Option<MapTypeV6>': Option<MapTypeV6>;
'Vec<MapTypeV6>': Vec<MapTypeV6>;
MetadataV6: MetadataV6;
'Option<MetadataV6>': Option<MetadataV6>;
'Vec<MetadataV6>': Vec<MetadataV6>;
ModuleConstantMetadataV6: ModuleConstantMetadataV6;
'Option<ModuleConstantMetadataV6>': Option<ModuleConstantMetadataV6>;
'Vec<ModuleConstantMetadataV6>': Vec<ModuleConstantMetadataV6>;
ModuleMetadataV6: ModuleMetadataV6;
'Option<ModuleMetadataV6>': Option<ModuleMetadataV6>;
'Vec<ModuleMetadataV6>': Vec<ModuleMetadataV6>;
PlainTypeV6: PlainTypeV6;
'Option<PlainTypeV6>': Option<PlainTypeV6>;
'Vec<PlainTypeV6>': Vec<PlainTypeV6>;
StorageEntryModifierV6: StorageEntryModifierV6;
'Option<StorageEntryModifierV6>': Option<StorageEntryModifierV6>;
'Vec<StorageEntryModifierV6>': Vec<StorageEntryModifierV6>;
StorageEntryMetadataV6: StorageEntryMetadataV6;
'Option<StorageEntryMetadataV6>': Option<StorageEntryMetadataV6>;
'Vec<StorageEntryMetadataV6>': Vec<StorageEntryMetadataV6>;
StorageEntryTypeV6: StorageEntryTypeV6;
'Option<StorageEntryTypeV6>': Option<StorageEntryTypeV6>;
'Vec<StorageEntryTypeV6>': Vec<StorageEntryTypeV6>;
StorageHasherV6: StorageHasherV6;
'Option<StorageHasherV6>': Option<StorageHasherV6>;
'Vec<StorageHasherV6>': Vec<StorageHasherV6>;
DoubleMapTypeV7: DoubleMapTypeV7;
'Option<DoubleMapTypeV7>': Option<DoubleMapTypeV7>;
'Vec<DoubleMapTypeV7>': Vec<DoubleMapTypeV7>;
EventMetadataV7: EventMetadataV7;
'Option<EventMetadataV7>': Option<EventMetadataV7>;
'Vec<EventMetadataV7>': Vec<EventMetadataV7>;
FunctionArgumentMetadataV7: FunctionArgumentMetadataV7;
'Option<FunctionArgumentMetadataV7>': Option<FunctionArgumentMetadataV7>;
'Vec<FunctionArgumentMetadataV7>': Vec<FunctionArgumentMetadataV7>;
FunctionMetadataV7: FunctionMetadataV7;
'Option<FunctionMetadataV7>': Option<FunctionMetadataV7>;
'Vec<FunctionMetadataV7>': Vec<FunctionMetadataV7>;
MapTypeV7: MapTypeV7;
'Option<MapTypeV7>': Option<MapTypeV7>;
'Vec<MapTypeV7>': Vec<MapTypeV7>;
MetadataV7: MetadataV7;
'Option<MetadataV7>': Option<MetadataV7>;
'Vec<MetadataV7>': Vec<MetadataV7>;
ModuleConstantMetadataV7: ModuleConstantMetadataV7;
'Option<ModuleConstantMetadataV7>': Option<ModuleConstantMetadataV7>;
'Vec<ModuleConstantMetadataV7>': Vec<ModuleConstantMetadataV7>;
ModuleMetadataV7: ModuleMetadataV7;
'Option<ModuleMetadataV7>': Option<ModuleMetadataV7>;
'Vec<ModuleMetadataV7>': Vec<ModuleMetadataV7>;
PlainTypeV7: PlainTypeV7;
'Option<PlainTypeV7>': Option<PlainTypeV7>;
'Vec<PlainTypeV7>': Vec<PlainTypeV7>;
StorageEntryModifierV7: StorageEntryModifierV7;
'Option<StorageEntryModifierV7>': Option<StorageEntryModifierV7>;
'Vec<StorageEntryModifierV7>': Vec<StorageEntryModifierV7>;
StorageEntryMetadataV7: StorageEntryMetadataV7;
'Option<StorageEntryMetadataV7>': Option<StorageEntryMetadataV7>;
'Vec<StorageEntryMetadataV7>': Vec<StorageEntryMetadataV7>;
StorageEntryTypeV7: StorageEntryTypeV7;
'Option<StorageEntryTypeV7>': Option<StorageEntryTypeV7>;
'Vec<StorageEntryTypeV7>': Vec<StorageEntryTypeV7>;
StorageHasherV7: StorageHasherV7;
'Option<StorageHasherV7>': Option<StorageHasherV7>;
'Vec<StorageHasherV7>': Vec<StorageHasherV7>;
StorageMetadataV7: StorageMetadataV7;
'Option<StorageMetadataV7>': Option<StorageMetadataV7>;
'Vec<StorageMetadataV7>': Vec<StorageMetadataV7>;
DoubleMapTypeV8: DoubleMapTypeV8;
'Option<DoubleMapTypeV8>': Option<DoubleMapTypeV8>;
'Vec<DoubleMapTypeV8>': Vec<DoubleMapTypeV8>;
ErrorMetadataV8: ErrorMetadataV8;
'Option<ErrorMetadataV8>': Option<ErrorMetadataV8>;
'Vec<ErrorMetadataV8>': Vec<ErrorMetadataV8>;
EventMetadataV8: EventMetadataV8;
'Option<EventMetadataV8>': Option<EventMetadataV8>;
'Vec<EventMetadataV8>': Vec<EventMetadataV8>;
FunctionArgumentMetadataV8: FunctionArgumentMetadataV8;
'Option<FunctionArgumentMetadataV8>': Option<FunctionArgumentMetadataV8>;
'Vec<FunctionArgumentMetadataV8>': Vec<FunctionArgumentMetadataV8>;
FunctionMetadataV8: FunctionMetadataV8;
'Option<FunctionMetadataV8>': Option<FunctionMetadataV8>;
'Vec<FunctionMetadataV8>': Vec<FunctionMetadataV8>;
MapTypeV8: MapTypeV8;
'Option<MapTypeV8>': Option<MapTypeV8>;
'Vec<MapTypeV8>': Vec<MapTypeV8>;
MetadataV8: MetadataV8;
'Option<MetadataV8>': Option<MetadataV8>;
'Vec<MetadataV8>': Vec<MetadataV8>;
ModuleConstantMetadataV8: ModuleConstantMetadataV8;
'Option<ModuleConstantMetadataV8>': Option<ModuleConstantMetadataV8>;
'Vec<ModuleConstantMetadataV8>': Vec<ModuleConstantMetadataV8>;
ModuleMetadataV8: ModuleMetadataV8;
'Option<ModuleMetadataV8>': Option<ModuleMetadataV8>;
'Vec<ModuleMetadataV8>': Vec<ModuleMetadataV8>;
PlainTypeV8: PlainTypeV8;
'Option<PlainTypeV8>': Option<PlainTypeV8>;
'Vec<PlainTypeV8>': Vec<PlainTypeV8>;
StorageEntryModifierV8: StorageEntryModifierV8;
'Option<StorageEntryModifierV8>': Option<StorageEntryModifierV8>;
'Vec<StorageEntryModifierV8>': Vec<StorageEntryModifierV8>;
StorageEntryMetadataV8: StorageEntryMetadataV8;
'Option<StorageEntryMetadataV8>': Option<StorageEntryMetadataV8>;
'Vec<StorageEntryMetadataV8>': Vec<StorageEntryMetadataV8>;
StorageEntryTypeV8: StorageEntryTypeV8;
'Option<StorageEntryTypeV8>': Option<StorageEntryTypeV8>;
'Vec<StorageEntryTypeV8>': Vec<StorageEntryTypeV8>;
StorageHasherV8: StorageHasherV8;
'Option<StorageHasherV8>': Option<StorageHasherV8>;
'Vec<StorageHasherV8>': Vec<StorageHasherV8>;
StorageMetadataV8: StorageMetadataV8;
'Option<StorageMetadataV8>': Option<StorageMetadataV8>;
'Vec<StorageMetadataV8>': Vec<StorageMetadataV8>;
DoubleMapTypeV9: DoubleMapTypeV9;
'Option<DoubleMapTypeV9>': Option<DoubleMapTypeV9>;
'Vec<DoubleMapTypeV9>': Vec<DoubleMapTypeV9>;
@@ -1767,15 +1425,12 @@ declare module '@polkadot/types/types/registry' {
ModuleMetadataV9: ModuleMetadataV9;
'Option<ModuleMetadataV9>': Option<ModuleMetadataV9>;
'Vec<ModuleMetadataV9>': Vec<ModuleMetadataV9>;
PlainTypeV9: PlainTypeV9;
'Option<PlainTypeV9>': Option<PlainTypeV9>;
'Vec<PlainTypeV9>': Vec<PlainTypeV9>;
StorageEntryModifierV9: StorageEntryModifierV9;
'Option<StorageEntryModifierV9>': Option<StorageEntryModifierV9>;
'Vec<StorageEntryModifierV9>': Vec<StorageEntryModifierV9>;
StorageEntryMetadataV9: StorageEntryMetadataV9;
'Option<StorageEntryMetadataV9>': Option<StorageEntryMetadataV9>;
'Vec<StorageEntryMetadataV9>': Vec<StorageEntryMetadataV9>;
StorageEntryModifierV9: StorageEntryModifierV9;
'Option<StorageEntryModifierV9>': Option<StorageEntryModifierV9>;
'Vec<StorageEntryModifierV9>': Vec<StorageEntryModifierV9>;
StorageEntryTypeV9: StorageEntryTypeV9;
'Option<StorageEntryTypeV9>': Option<StorageEntryTypeV9>;
'Vec<StorageEntryTypeV9>': Vec<StorageEntryTypeV9>;
@@ -1812,9 +1467,6 @@ declare module '@polkadot/types/types/registry' {
ModuleMetadataV10: ModuleMetadataV10;
'Option<ModuleMetadataV10>': Option<ModuleMetadataV10>;
'Vec<ModuleMetadataV10>': Vec<ModuleMetadataV10>;
PlainTypeV10: PlainTypeV10;
'Option<PlainTypeV10>': Option<PlainTypeV10>;
'Vec<PlainTypeV10>': Vec<PlainTypeV10>;
StorageEntryModifierV10: StorageEntryModifierV10;
'Option<StorageEntryModifierV10>': Option<StorageEntryModifierV10>;
'Vec<StorageEntryModifierV10>': Vec<StorageEntryModifierV10>;
@@ -1860,9 +1512,6 @@ declare module '@polkadot/types/types/registry' {
ModuleMetadataV11: ModuleMetadataV11;
'Option<ModuleMetadataV11>': Option<ModuleMetadataV11>;
'Vec<ModuleMetadataV11>': Vec<ModuleMetadataV11>;
PlainTypeV11: PlainTypeV11;
'Option<PlainTypeV11>': Option<PlainTypeV11>;
'Vec<PlainTypeV11>': Vec<PlainTypeV11>;
StorageEntryModifierV11: StorageEntryModifierV11;
'Option<StorageEntryModifierV11>': Option<StorageEntryModifierV11>;
'Vec<StorageEntryModifierV11>': Vec<StorageEntryModifierV11>;
@@ -1908,9 +1557,6 @@ declare module '@polkadot/types/types/registry' {
ModuleMetadataV12: ModuleMetadataV12;
'Option<ModuleMetadataV12>': Option<ModuleMetadataV12>;
'Vec<ModuleMetadataV12>': Vec<ModuleMetadataV12>;
PlainTypeV12: PlainTypeV12;
'Option<PlainTypeV12>': Option<PlainTypeV12>;
'Vec<PlainTypeV12>': Vec<PlainTypeV12>;
StorageEntryModifierV12: StorageEntryModifierV12;
'Option<StorageEntryModifierV12>': Option<StorageEntryModifierV12>;
'Vec<StorageEntryModifierV12>': Vec<StorageEntryModifierV12>;
@@ -1953,9 +1599,6 @@ declare module '@polkadot/types/types/registry' {
ModuleMetadataLatest: ModuleMetadataLatest;
'Option<ModuleMetadataLatest>': Option<ModuleMetadataLatest>;
'Vec<ModuleMetadataLatest>': Vec<ModuleMetadataLatest>;
PlainTypeLatest: PlainTypeLatest;
'Option<PlainTypeLatest>': Option<PlainTypeLatest>;
'Vec<PlainTypeLatest>': Vec<PlainTypeLatest>;
StorageEntryMetadataLatest: StorageEntryMetadataLatest;
'Option<StorageEntryMetadataLatest>': Option<StorageEntryMetadataLatest>;
'Vec<StorageEntryMetadataLatest>': Vec<StorageEntryMetadataLatest>;
+1
View File
@@ -17,6 +17,7 @@ const UNCONSTRUCTABLE = [
'ExtrinsicPayloadUnknown', 'GenericExtrinsicPayloadUnknown',
'ExtrinsicUnknown', 'GenericExtrinsicUnknown',
'DoNotConstruct',
'MetadataAll',
'Origin',
'usize'
].map((v): string => v.toLowerCase());
@@ -22,220 +22,73 @@ export { AllHashers };
export default {
rpc: {},
types: {
// v0
CallMetadataV0: {
name: 'Text',
functions: 'Vec<FunctionMetadataV0>'
// v9
DoubleMapTypeV9: {
hasher: 'StorageHasherV9',
key1: 'Type',
key2: 'Type',
value: 'Type',
key2Hasher: 'StorageHasherV9'
},
EventMetadataV0: {
ErrorMetadataV9: {
name: 'Text',
documentation: 'Vec<Text>'
},
EventMetadataV9: {
name: 'Text',
args: 'Vec<Type>',
documentation: 'Vec<Text>'
},
FunctionArgumentMetadataV0: {
FunctionArgumentMetadataV9: {
name: 'Text',
type: 'Type'
},
FunctionMetadataV0: {
id: 'u16',
FunctionMetadataV9: {
name: 'Text',
args: 'Vec<FunctionArgumentMetadataV0>',
args: 'Vec<FunctionArgumentMetadataV9>',
documentation: 'Vec<Text>'
},
MapTypeV0: {
MapTypeV9: {
hasher: 'StorageHasherV9',
key: 'Type',
value: 'Type'
value: 'Type',
linked: 'bool'
},
MetadataV0: {
outerEvent: 'OuterEventMetadataV0',
modules: 'Vec<RuntimeModuleMetadataV0>',
outerDispatch: 'OuterDispatchMetadataV0'
MetadataV9: {
modules: 'Vec<ModuleMetadataV9>'
},
ModuleMetadataV0: {
ModuleConstantMetadataV9: {
name: 'Text',
call: 'CallMetadataV0'
type: 'Type',
value: 'Bytes',
documentation: 'Vec<Text>'
},
OuterDispatchCallV0: {
ModuleMetadataV9: {
name: 'Text',
prefix: 'Text',
index: 'u16'
storage: 'Option<StorageMetadataV9>',
calls: 'Option<Vec<FunctionMetadataV9>>',
events: 'Option<Vec<EventMetadataV9>>',
constants: 'Vec<ModuleConstantMetadataV9>',
errors: 'Vec<ErrorMetadataV9>'
},
OuterDispatchMetadataV0: {
StorageEntryMetadataV9: {
name: 'Text',
calls: 'Vec<OuterDispatchCallV0>'
},
OuterEventEventMetadataEventsV0: 'Vec<EventMetadataV0>',
OuterEventEventMetadataV0: '(Text, OuterEventEventMetadataEventsV0)',
OuterEventMetadataV0: {
name: 'Text',
events: 'Vec<OuterEventEventMetadataV0>'
},
PlainTypeV0: 'Type',
RuntimeModuleMetadataV0: {
prefix: 'Text',
module: 'ModuleMetadataV0',
storage: 'Option<StorageMetadataV0>'
},
StorageFunctionMetadataV0: {
name: 'Text',
modifier: 'StorageFunctionModifierV0',
type: 'StorageFunctionTypeV0',
modifier: 'StorageEntryModifierV9',
type: 'StorageEntryTypeV9',
fallback: 'Bytes',
documentation: 'Vec<Text>'
},
StorageFunctionModifierV0: {
StorageEntryModifierV9: {
_enum: ['Optional', 'Default', 'Required']
},
StorageFunctionTypeV0: {
StorageEntryTypeV9: {
_enum: {
Plain: 'PlainTypeV0',
Map: 'MapTypeV0'
Plain: 'Type',
Map: 'MapTypeV9',
DoubleMap: 'DoubleMapTypeV9'
}
},
StorageMetadataV0: {
prefix: 'Text',
functions: 'Vec<StorageFunctionMetadataV0>'
},
// v1
EventMetadataV1: 'EventMetadataV0',
FunctionArgumentMetadataV1: 'FunctionArgumentMetadataV0',
FunctionMetadataV1: {
name: 'Text',
args: 'Vec<FunctionArgumentMetadataV1>',
documentation: 'Vec<Text>'
},
MetadataV1: {
modules: 'Vec<ModuleMetadataV1>'
},
ModuleMetadataV1: {
name: 'Text',
prefix: 'Text',
storage: 'Option<Vec<StorageFunctionMetadataV1>>',
calls: 'Option<Vec<FunctionMetadataV1>>',
events: 'Option<Vec<EventMetadataV1>>'
},
StorageFunctionMetadataV1: 'StorageFunctionMetadataV0',
StorageFunctionModifierV1: 'StorageFunctionModifierV0',
StorageFunctionTypeV1: 'StorageFunctionTypeV0',
// v2
EventMetadataV2: 'EventMetadataV1',
FunctionArgumentMetadataV2: 'FunctionArgumentMetadataV1',
FunctionMetadataV2: 'FunctionMetadataV1',
MapTypeV2: {
key: 'Type',
value: 'Type',
linked: 'bool'
},
MetadataV2: {
modules: 'Vec<ModuleMetadataV2>'
},
ModuleMetadataV2: {
name: 'Text',
prefix: 'Text',
storage: 'Option<Vec<StorageFunctionMetadataV2>>',
calls: 'Option<Vec<FunctionMetadataV2>>',
events: 'Option<Vec<EventMetadataV2>>'
},
PlainTypeV2: 'Type',
StorageFunctionMetadataV2: {
name: 'Text',
modifier: 'StorageFunctionModifierV2',
type: 'StorageFunctionTypeV2',
fallback: 'Bytes',
documentation: 'Vec<Text>'
},
StorageFunctionModifierV2: 'StorageFunctionModifierV1',
StorageFunctionTypeV2: {
_enum: {
Plain: 'PlainTypeV2',
Map: 'MapTypeV2'
}
},
// v3
DoubleMapTypeV3: {
key1: 'Type',
key2: 'Type',
value: 'Type',
key2Hasher: 'Text'
},
EventMetadataV3: 'EventMetadataV2',
FunctionArgumentMetadataV3: 'FunctionArgumentMetadataV2',
FunctionMetadataV3: 'FunctionMetadataV2',
MapTypeV3: 'MapTypeV2',
MetadataV3: {
modules: 'Vec<ModuleMetadataV3>'
},
ModuleMetadataV3: {
name: 'Text',
prefix: 'Text',
storage: 'Option<Vec<StorageFunctionMetadataV3>>',
calls: 'Option<Vec<FunctionMetadataV3>>',
events: 'Option<Vec<EventMetadataV3>>'
},
PlainTypeV3: 'Type',
StorageFunctionMetadataV3: {
name: 'Text',
modifier: 'StorageFunctionModifierV3',
type: 'StorageFunctionTypeV3',
fallback: 'Bytes',
documentation: 'Vec<Text>'
},
StorageFunctionModifierV3: 'StorageFunctionModifierV2',
StorageFunctionTypeV3: {
_enum: {
Plain: 'PlainTypeV3',
Map: 'MapTypeV3',
DoubleMap: 'DoubleMapTypeV3'
}
},
// v4
DoubleMapTypeV4: {
hasher: 'StorageHasherV4',
key1: 'Type',
key2: 'Type',
value: 'Type',
key2Hasher: 'Text'
},
EventMetadataV4: 'EventMetadataV3',
FunctionArgumentMetadataV4: 'FunctionArgumentMetadataV3',
FunctionMetadataV4: 'FunctionMetadataV3',
MapTypeV4: {
hasher: 'StorageHasherV4',
key: 'Type',
value: 'Type',
linked: 'bool'
},
MetadataV4: {
modules: 'Vec<ModuleMetadataV4>'
},
ModuleMetadataV4: {
name: 'Text',
prefix: 'Text',
storage: 'Option<Vec<StorageFunctionMetadataV4>>',
calls: 'Option<Vec<FunctionMetadataV4>>',
events: 'Option<Vec<EventMetadataV4>>'
},
PlainTypeV4: 'Type',
StorageFunctionMetadataV4: {
name: 'Text',
modifier: 'StorageFunctionModifierV4',
type: 'StorageFunctionTypeV4',
fallback: 'Bytes',
documentation: 'Vec<Text>'
},
StorageFunctionModifierV4: 'StorageFunctionModifierV3',
StorageFunctionTypeV4: {
_enum: {
Plain: 'PlainTypeV4',
Map: 'MapTypeV4',
DoubleMap: 'DoubleMapTypeV4'
}
},
StorageHasherV4: {
StorageHasherV9: {
_enum: {
Blake2_128: null, // eslint-disable-line camelcase
Blake2_256: null, // eslint-disable-line camelcase
@@ -244,148 +97,10 @@ export default {
Twox64Concat: null
}
},
// v5
DoubleMapTypeV5: {
hasher: 'StorageHasherV5',
key1: 'Type',
key2: 'Type',
value: 'Type',
key2Hasher: 'StorageHasherV5'
},
EventMetadataV5: 'EventMetadataV4',
FunctionArgumentMetadataV5: 'FunctionArgumentMetadataV4',
FunctionMetadataV5: 'FunctionMetadataV4',
MapTypeV5: 'MapTypeV4',
MetadataV5: {
modules: 'Vec<ModuleMetadataV5>'
},
ModuleMetadataV5: {
name: 'Text',
StorageMetadataV9: {
prefix: 'Text',
storage: 'Option<Vec<StorageFunctionMetadataV5>>',
calls: 'Option<Vec<FunctionMetadataV5>>',
events: 'Option<Vec<EventMetadataV5>>'
items: 'Vec<StorageEntryMetadataV9>'
},
PlainTypeV5: 'Type',
StorageFunctionMetadataV5: {
name: 'Text',
modifier: 'StorageFunctionModifierV5',
type: 'StorageFunctionTypeV5',
fallback: 'Bytes',
documentation: 'Vec<Text>'
},
StorageFunctionModifierV5: 'StorageFunctionModifierV4',
StorageFunctionTypeV5: {
_enum: {
Plain: 'PlainTypeV5',
Map: 'MapTypeV5',
DoubleMap: 'DoubleMapTypeV5'
}
},
StorageHasherV5: 'StorageHasherV4',
// v6
DoubleMapTypeV6: 'DoubleMapTypeV5',
EventMetadataV6: 'EventMetadataV5',
FunctionArgumentMetadataV6: 'FunctionArgumentMetadataV5',
FunctionMetadataV6: 'FunctionMetadataV5',
MapTypeV6: 'MapTypeV5',
MetadataV6: {
modules: 'Vec<ModuleMetadataV6>'
},
ModuleConstantMetadataV6: {
name: 'Text',
type: 'Type',
value: 'Bytes',
documentation: 'Vec<Text>'
},
ModuleMetadataV6: {
name: 'Text',
prefix: 'Text',
storage: 'Option<Vec<StorageEntryMetadataV6>>',
calls: 'Option<Vec<FunctionMetadataV6>>',
events: 'Option<Vec<EventMetadataV6>>',
constants: 'Vec<ModuleConstantMetadataV6>'
},
PlainTypeV6: 'Type',
StorageEntryModifierV6: 'StorageFunctionModifierV5',
StorageEntryMetadataV6: 'StorageFunctionMetadataV5',
StorageEntryTypeV6: 'StorageFunctionTypeV5',
StorageHasherV6: 'StorageHasherV5',
// v7
DoubleMapTypeV7: 'DoubleMapTypeV6',
EventMetadataV7: 'EventMetadataV6',
FunctionArgumentMetadataV7: 'FunctionArgumentMetadataV6',
FunctionMetadataV7: 'FunctionMetadataV6',
MapTypeV7: 'MapTypeV6',
MetadataV7: {
modules: 'Vec<ModuleMetadataV7>'
},
ModuleConstantMetadataV7: 'ModuleConstantMetadataV6',
ModuleMetadataV7: {
name: 'Text',
storage: 'Option<StorageMetadataV7>',
calls: 'Option<Vec<FunctionMetadataV7>>',
events: 'Option<Vec<EventMetadataV7>>',
constants: 'Vec<ModuleConstantMetadataV7>'
},
PlainTypeV7: 'Type',
StorageEntryModifierV7: 'StorageEntryModifierV6',
StorageEntryMetadataV7: 'StorageEntryMetadataV6',
StorageEntryTypeV7: 'StorageEntryTypeV6',
StorageHasherV7: 'StorageHasherV6',
StorageMetadataV7: {
prefix: 'Text',
items: 'Vec<StorageEntryMetadataV7>'
},
// v8
DoubleMapTypeV8: 'DoubleMapTypeV7',
ErrorMetadataV8: {
name: 'Text',
documentation: 'Vec<Text>'
},
EventMetadataV8: 'EventMetadataV7',
FunctionArgumentMetadataV8: 'FunctionArgumentMetadataV7',
FunctionMetadataV8: 'FunctionMetadataV7',
MapTypeV8: 'MapTypeV7',
MetadataV8: {
modules: 'Vec<ModuleMetadataV8>'
},
ModuleConstantMetadataV8: 'ModuleConstantMetadataV7',
ModuleMetadataV8: {
name: 'Text',
storage: 'Option<StorageMetadataV8>',
calls: 'Option<Vec<FunctionMetadataV8>>',
events: 'Option<Vec<EventMetadataV8>>',
constants: 'Vec<ModuleConstantMetadataV8>',
errors: 'Vec<ErrorMetadataV8>'
},
PlainTypeV8: 'Type',
StorageEntryModifierV8: 'StorageEntryModifierV7',
StorageEntryMetadataV8: 'StorageEntryMetadataV7',
StorageEntryTypeV8: 'StorageEntryTypeV7',
StorageHasherV8: 'StorageHasherV7',
StorageMetadataV8: 'StorageMetadataV7',
// v9
DoubleMapTypeV9: 'DoubleMapTypeV8',
ErrorMetadataV9: 'ErrorMetadataV8',
EventMetadataV9: 'EventMetadataV8',
FunctionArgumentMetadataV9: 'FunctionArgumentMetadataV8',
FunctionMetadataV9: 'FunctionMetadataV8',
MapTypeV9: 'MapTypeV8',
MetadataV9: 'MetadataV8',
ModuleConstantMetadataV9: 'ModuleConstantMetadataV8',
ModuleMetadataV9: 'ModuleMetadataV8',
PlainTypeV9: 'Type',
StorageEntryModifierV9: 'StorageEntryModifierV8',
StorageEntryMetadataV9: 'StorageEntryMetadataV8',
StorageEntryTypeV9: 'StorageEntryTypeV8',
StorageHasherV9: 'StorageHasherV8',
StorageMetadataV9: 'StorageMetadataV8',
// v10
DoubleMapTypeV10: {
@@ -417,7 +132,6 @@ export default {
constants: 'Vec<ModuleConstantMetadataV10>',
errors: 'Vec<ErrorMetadataV10>'
},
PlainTypeV10: 'Type',
StorageEntryModifierV10: 'StorageEntryModifierV9',
StorageEntryMetadataV10: {
name: 'Text',
@@ -428,7 +142,7 @@ export default {
},
StorageEntryTypeV10: {
_enum: {
Plain: 'PlainTypeV10',
Plain: 'Type',
Map: 'MapTypeV10',
DoubleMap: 'DoubleMapTypeV10'
}
@@ -483,7 +197,6 @@ export default {
constants: 'Vec<ModuleConstantMetadataV11>',
errors: 'Vec<ErrorMetadataV11>'
},
PlainTypeV11: 'Type',
StorageEntryModifierV11: 'StorageEntryModifierV10',
StorageEntryMetadataV11: {
name: 'Text',
@@ -494,7 +207,7 @@ export default {
},
StorageEntryTypeV11: {
_enum: {
Plain: 'PlainTypeV11',
Plain: 'Type',
Map: 'MapTypeV11',
DoubleMap: 'DoubleMapTypeV11'
}
@@ -529,7 +242,6 @@ export default {
errors: 'Vec<ErrorMetadataV12>',
index: 'u8'
},
PlainTypeV12: 'Type',
StorageEntryModifierV12: 'StorageEntryModifierV11',
StorageEntryMetadataV12: 'StorageEntryMetadataV11',
StorageEntryTypeV12: 'StorageEntryTypeV11',
@@ -546,7 +258,6 @@ export default {
MetadataLatest: 'MetadataV12',
ModuleConstantMetadataLatest: 'ModuleConstantMetadataV12',
ModuleMetadataLatest: 'ModuleMetadataV12',
PlainTypeLatest: 'PlainTypeV12',
StorageEntryMetadataLatest: 'StorageEntryMetadataV12',
StorageEntryModifierLatest: 'StorageEntryModifierV12',
StorageEntryTypeLatest: 'StorageEntryTypeV12',
@@ -556,15 +267,16 @@ export default {
// the enum containing all the mappings
MetadataAll: {
_enum: {
V0: 'MetadataV0',
V1: 'MetadataV1',
V2: 'MetadataV2',
V3: 'MetadataV3',
V4: 'MetadataV4',
V5: 'MetadataV5',
V6: 'MetadataV6',
V7: 'MetadataV7',
V8: 'MetadataV8',
V0: 'DoNotConstruct<MetadataV0>',
V1: 'DoNotConstruct<MetadataV1>',
V2: 'DoNotConstruct<MetadataV2>',
V3: 'DoNotConstruct<MetadataV3>',
V4: 'DoNotConstruct<MetadataV4>',
V5: 'DoNotConstruct<MetadataV5>',
V6: 'DoNotConstruct<MetadataV6>',
V7: 'DoNotConstruct<MetadataV7>',
V8: 'DoNotConstruct<MetadataV8>',
// First version on Kusama in V9, dropping will be problematic
V9: 'MetadataV9',
V10: 'MetadataV10',
V11: 'MetadataV11',
+64 -592
View File
@@ -1,15 +1,8 @@
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
import { ITuple } from '@polkadot/types/types';
import { Enum, Option, Struct, Vec } from '@polkadot/types/codec';
import { Bytes, Text, Type, bool, u16, u8 } from '@polkadot/types/primitive';
/** @name CallMetadataV0 */
export interface CallMetadataV0 extends Struct {
readonly name: Text;
readonly functions: Vec<FunctionMetadataV0>;
}
import { Bytes, Text, Type, bool, u8 } from '@polkadot/types/primitive';
/** @name DoubleMapTypeLatest */
export interface DoubleMapTypeLatest extends DoubleMapTypeV12 {}
@@ -35,43 +28,14 @@ export interface DoubleMapTypeV11 extends Struct {
/** @name DoubleMapTypeV12 */
export interface DoubleMapTypeV12 extends DoubleMapTypeV11 {}
/** @name DoubleMapTypeV3 */
export interface DoubleMapTypeV3 extends Struct {
readonly key1: Type;
readonly key2: Type;
readonly value: Type;
readonly key2Hasher: Text;
}
/** @name DoubleMapTypeV4 */
export interface DoubleMapTypeV4 extends Struct {
readonly hasher: StorageHasherV4;
readonly key1: Type;
readonly key2: Type;
readonly value: Type;
readonly key2Hasher: Text;
}
/** @name DoubleMapTypeV5 */
export interface DoubleMapTypeV5 extends Struct {
readonly hasher: StorageHasherV5;
readonly key1: Type;
readonly key2: Type;
readonly value: Type;
readonly key2Hasher: StorageHasherV5;
}
/** @name DoubleMapTypeV6 */
export interface DoubleMapTypeV6 extends DoubleMapTypeV5 {}
/** @name DoubleMapTypeV7 */
export interface DoubleMapTypeV7 extends DoubleMapTypeV6 {}
/** @name DoubleMapTypeV8 */
export interface DoubleMapTypeV8 extends DoubleMapTypeV7 {}
/** @name DoubleMapTypeV9 */
export interface DoubleMapTypeV9 extends DoubleMapTypeV8 {}
export interface DoubleMapTypeV9 extends Struct {
readonly hasher: StorageHasherV9;
readonly key1: Type;
readonly key2: Type;
readonly value: Type;
readonly key2Hasher: StorageHasherV9;
}
/** @name ErrorMetadataV10 */
export interface ErrorMetadataV10 extends ErrorMetadataV9 {}
@@ -82,28 +46,15 @@ export interface ErrorMetadataV11 extends ErrorMetadataV10 {}
/** @name ErrorMetadataV12 */
export interface ErrorMetadataV12 extends ErrorMetadataV11 {}
/** @name ErrorMetadataV8 */
export interface ErrorMetadataV8 extends Struct {
/** @name ErrorMetadataV9 */
export interface ErrorMetadataV9 extends Struct {
readonly name: Text;
readonly documentation: Vec<Text>;
}
/** @name ErrorMetadataV9 */
export interface ErrorMetadataV9 extends ErrorMetadataV8 {}
/** @name EventMetadataLatest */
export interface EventMetadataLatest extends EventMetadataV12 {}
/** @name EventMetadataV0 */
export interface EventMetadataV0 extends Struct {
readonly name: Text;
readonly args: Vec<Type>;
readonly documentation: Vec<Text>;
}
/** @name EventMetadataV1 */
export interface EventMetadataV1 extends EventMetadataV0 {}
/** @name EventMetadataV10 */
export interface EventMetadataV10 extends EventMetadataV9 {}
@@ -113,29 +64,12 @@ export interface EventMetadataV11 extends EventMetadataV10 {}
/** @name EventMetadataV12 */
export interface EventMetadataV12 extends EventMetadataV11 {}
/** @name EventMetadataV2 */
export interface EventMetadataV2 extends EventMetadataV1 {}
/** @name EventMetadataV3 */
export interface EventMetadataV3 extends EventMetadataV2 {}
/** @name EventMetadataV4 */
export interface EventMetadataV4 extends EventMetadataV3 {}
/** @name EventMetadataV5 */
export interface EventMetadataV5 extends EventMetadataV4 {}
/** @name EventMetadataV6 */
export interface EventMetadataV6 extends EventMetadataV5 {}
/** @name EventMetadataV7 */
export interface EventMetadataV7 extends EventMetadataV6 {}
/** @name EventMetadataV8 */
export interface EventMetadataV8 extends EventMetadataV7 {}
/** @name EventMetadataV9 */
export interface EventMetadataV9 extends EventMetadataV8 {}
export interface EventMetadataV9 extends Struct {
readonly name: Text;
readonly args: Vec<Type>;
readonly documentation: Vec<Text>;
}
/** @name ExtrinsicMetadataLatest */
export interface ExtrinsicMetadataLatest extends ExtrinsicMetadataV12 {}
@@ -152,15 +86,6 @@ export interface ExtrinsicMetadataV12 extends ExtrinsicMetadataV11 {}
/** @name FunctionArgumentMetadataLatest */
export interface FunctionArgumentMetadataLatest extends FunctionArgumentMetadataV12 {}
/** @name FunctionArgumentMetadataV0 */
export interface FunctionArgumentMetadataV0 extends Struct {
readonly name: Text;
readonly type: Type;
}
/** @name FunctionArgumentMetadataV1 */
export interface FunctionArgumentMetadataV1 extends FunctionArgumentMetadataV0 {}
/** @name FunctionArgumentMetadataV10 */
export interface FunctionArgumentMetadataV10 extends FunctionArgumentMetadataV9 {}
@@ -170,48 +95,15 @@ export interface FunctionArgumentMetadataV11 extends FunctionArgumentMetadataV10
/** @name FunctionArgumentMetadataV12 */
export interface FunctionArgumentMetadataV12 extends FunctionArgumentMetadataV11 {}
/** @name FunctionArgumentMetadataV2 */
export interface FunctionArgumentMetadataV2 extends FunctionArgumentMetadataV1 {}
/** @name FunctionArgumentMetadataV3 */
export interface FunctionArgumentMetadataV3 extends FunctionArgumentMetadataV2 {}
/** @name FunctionArgumentMetadataV4 */
export interface FunctionArgumentMetadataV4 extends FunctionArgumentMetadataV3 {}
/** @name FunctionArgumentMetadataV5 */
export interface FunctionArgumentMetadataV5 extends FunctionArgumentMetadataV4 {}
/** @name FunctionArgumentMetadataV6 */
export interface FunctionArgumentMetadataV6 extends FunctionArgumentMetadataV5 {}
/** @name FunctionArgumentMetadataV7 */
export interface FunctionArgumentMetadataV7 extends FunctionArgumentMetadataV6 {}
/** @name FunctionArgumentMetadataV8 */
export interface FunctionArgumentMetadataV8 extends FunctionArgumentMetadataV7 {}
/** @name FunctionArgumentMetadataV9 */
export interface FunctionArgumentMetadataV9 extends FunctionArgumentMetadataV8 {}
export interface FunctionArgumentMetadataV9 extends Struct {
readonly name: Text;
readonly type: Type;
}
/** @name FunctionMetadataLatest */
export interface FunctionMetadataLatest extends FunctionMetadataV12 {}
/** @name FunctionMetadataV0 */
export interface FunctionMetadataV0 extends Struct {
readonly id: u16;
readonly name: Text;
readonly args: Vec<FunctionArgumentMetadataV0>;
readonly documentation: Vec<Text>;
}
/** @name FunctionMetadataV1 */
export interface FunctionMetadataV1 extends Struct {
readonly name: Text;
readonly args: Vec<FunctionArgumentMetadataV1>;
readonly documentation: Vec<Text>;
}
/** @name FunctionMetadataV10 */
export interface FunctionMetadataV10 extends FunctionMetadataV9 {}
@@ -221,39 +113,16 @@ export interface FunctionMetadataV11 extends FunctionMetadataV10 {}
/** @name FunctionMetadataV12 */
export interface FunctionMetadataV12 extends FunctionMetadataV11 {}
/** @name FunctionMetadataV2 */
export interface FunctionMetadataV2 extends FunctionMetadataV1 {}
/** @name FunctionMetadataV3 */
export interface FunctionMetadataV3 extends FunctionMetadataV2 {}
/** @name FunctionMetadataV4 */
export interface FunctionMetadataV4 extends FunctionMetadataV3 {}
/** @name FunctionMetadataV5 */
export interface FunctionMetadataV5 extends FunctionMetadataV4 {}
/** @name FunctionMetadataV6 */
export interface FunctionMetadataV6 extends FunctionMetadataV5 {}
/** @name FunctionMetadataV7 */
export interface FunctionMetadataV7 extends FunctionMetadataV6 {}
/** @name FunctionMetadataV8 */
export interface FunctionMetadataV8 extends FunctionMetadataV7 {}
/** @name FunctionMetadataV9 */
export interface FunctionMetadataV9 extends FunctionMetadataV8 {}
export interface FunctionMetadataV9 extends Struct {
readonly name: Text;
readonly args: Vec<FunctionArgumentMetadataV9>;
readonly documentation: Vec<Text>;
}
/** @name MapTypeLatest */
export interface MapTypeLatest extends MapTypeV12 {}
/** @name MapTypeV0 */
export interface MapTypeV0 extends Struct {
readonly key: Type;
readonly value: Type;
}
/** @name MapTypeV10 */
export interface MapTypeV10 extends Struct {
readonly hasher: StorageHasherV10;
@@ -273,59 +142,16 @@ export interface MapTypeV11 extends Struct {
/** @name MapTypeV12 */
export interface MapTypeV12 extends MapTypeV11 {}
/** @name MapTypeV2 */
export interface MapTypeV2 extends Struct {
readonly key: Type;
readonly value: Type;
readonly linked: bool;
}
/** @name MapTypeV3 */
export interface MapTypeV3 extends MapTypeV2 {}
/** @name MapTypeV4 */
export interface MapTypeV4 extends Struct {
readonly hasher: StorageHasherV4;
readonly key: Type;
readonly value: Type;
readonly linked: bool;
}
/** @name MapTypeV5 */
export interface MapTypeV5 extends MapTypeV4 {}
/** @name MapTypeV6 */
export interface MapTypeV6 extends MapTypeV5 {}
/** @name MapTypeV7 */
export interface MapTypeV7 extends MapTypeV6 {}
/** @name MapTypeV8 */
export interface MapTypeV8 extends MapTypeV7 {}
/** @name MapTypeV9 */
export interface MapTypeV9 extends MapTypeV8 {}
export interface MapTypeV9 extends Struct {
readonly hasher: StorageHasherV9;
readonly key: Type;
readonly value: Type;
readonly linked: bool;
}
/** @name MetadataAll */
export interface MetadataAll extends Enum {
readonly isV0: boolean;
readonly asV0: MetadataV0;
readonly isV1: boolean;
readonly asV1: MetadataV1;
readonly isV2: boolean;
readonly asV2: MetadataV2;
readonly isV3: boolean;
readonly asV3: MetadataV3;
readonly isV4: boolean;
readonly asV4: MetadataV4;
readonly isV5: boolean;
readonly asV5: MetadataV5;
readonly isV6: boolean;
readonly asV6: MetadataV6;
readonly isV7: boolean;
readonly asV7: MetadataV7;
readonly isV8: boolean;
readonly asV8: MetadataV8;
readonly isV9: boolean;
readonly asV9: MetadataV9;
readonly isV10: boolean;
@@ -339,18 +165,6 @@ export interface MetadataAll extends Enum {
/** @name MetadataLatest */
export interface MetadataLatest extends MetadataV12 {}
/** @name MetadataV0 */
export interface MetadataV0 extends Struct {
readonly outerEvent: OuterEventMetadataV0;
readonly modules: Vec<RuntimeModuleMetadataV0>;
readonly outerDispatch: OuterDispatchMetadataV0;
}
/** @name MetadataV1 */
export interface MetadataV1 extends Struct {
readonly modules: Vec<ModuleMetadataV1>;
}
/** @name MetadataV10 */
export interface MetadataV10 extends Struct {
readonly modules: Vec<ModuleMetadataV10>;
@@ -368,43 +182,10 @@ export interface MetadataV12 extends Struct {
readonly extrinsic: ExtrinsicMetadataV12;
}
/** @name MetadataV2 */
export interface MetadataV2 extends Struct {
readonly modules: Vec<ModuleMetadataV2>;
}
/** @name MetadataV3 */
export interface MetadataV3 extends Struct {
readonly modules: Vec<ModuleMetadataV3>;
}
/** @name MetadataV4 */
export interface MetadataV4 extends Struct {
readonly modules: Vec<ModuleMetadataV4>;
}
/** @name MetadataV5 */
export interface MetadataV5 extends Struct {
readonly modules: Vec<ModuleMetadataV5>;
}
/** @name MetadataV6 */
export interface MetadataV6 extends Struct {
readonly modules: Vec<ModuleMetadataV6>;
}
/** @name MetadataV7 */
export interface MetadataV7 extends Struct {
readonly modules: Vec<ModuleMetadataV7>;
}
/** @name MetadataV8 */
export interface MetadataV8 extends Struct {
readonly modules: Vec<ModuleMetadataV8>;
}
/** @name MetadataV9 */
export interface MetadataV9 extends MetadataV8 {}
export interface MetadataV9 extends Struct {
readonly modules: Vec<ModuleMetadataV9>;
}
/** @name ModuleConstantMetadataLatest */
export interface ModuleConstantMetadataLatest extends ModuleConstantMetadataV12 {}
@@ -418,41 +199,17 @@ export interface ModuleConstantMetadataV11 extends ModuleConstantMetadataV10 {}
/** @name ModuleConstantMetadataV12 */
export interface ModuleConstantMetadataV12 extends ModuleConstantMetadataV11 {}
/** @name ModuleConstantMetadataV6 */
export interface ModuleConstantMetadataV6 extends Struct {
/** @name ModuleConstantMetadataV9 */
export interface ModuleConstantMetadataV9 extends Struct {
readonly name: Text;
readonly type: Type;
readonly value: Bytes;
readonly documentation: Vec<Text>;
}
/** @name ModuleConstantMetadataV7 */
export interface ModuleConstantMetadataV7 extends ModuleConstantMetadataV6 {}
/** @name ModuleConstantMetadataV8 */
export interface ModuleConstantMetadataV8 extends ModuleConstantMetadataV7 {}
/** @name ModuleConstantMetadataV9 */
export interface ModuleConstantMetadataV9 extends ModuleConstantMetadataV8 {}
/** @name ModuleMetadataLatest */
export interface ModuleMetadataLatest extends ModuleMetadataV12 {}
/** @name ModuleMetadataV0 */
export interface ModuleMetadataV0 extends Struct {
readonly name: Text;
readonly call: CallMetadataV0;
}
/** @name ModuleMetadataV1 */
export interface ModuleMetadataV1 extends Struct {
readonly name: Text;
readonly prefix: Text;
readonly storage: Option<Vec<StorageFunctionMetadataV1>>;
readonly calls: Option<Vec<FunctionMetadataV1>>;
readonly events: Option<Vec<EventMetadataV1>>;
}
/** @name ModuleMetadataV10 */
export interface ModuleMetadataV10 extends Struct {
readonly name: Text;
@@ -484,143 +241,14 @@ export interface ModuleMetadataV12 extends Struct {
readonly index: u8;
}
/** @name ModuleMetadataV2 */
export interface ModuleMetadataV2 extends Struct {
readonly name: Text;
readonly prefix: Text;
readonly storage: Option<Vec<StorageFunctionMetadataV2>>;
readonly calls: Option<Vec<FunctionMetadataV2>>;
readonly events: Option<Vec<EventMetadataV2>>;
}
/** @name ModuleMetadataV3 */
export interface ModuleMetadataV3 extends Struct {
readonly name: Text;
readonly prefix: Text;
readonly storage: Option<Vec<StorageFunctionMetadataV3>>;
readonly calls: Option<Vec<FunctionMetadataV3>>;
readonly events: Option<Vec<EventMetadataV3>>;
}
/** @name ModuleMetadataV4 */
export interface ModuleMetadataV4 extends Struct {
readonly name: Text;
readonly prefix: Text;
readonly storage: Option<Vec<StorageFunctionMetadataV4>>;
readonly calls: Option<Vec<FunctionMetadataV4>>;
readonly events: Option<Vec<EventMetadataV4>>;
}
/** @name ModuleMetadataV5 */
export interface ModuleMetadataV5 extends Struct {
readonly name: Text;
readonly prefix: Text;
readonly storage: Option<Vec<StorageFunctionMetadataV5>>;
readonly calls: Option<Vec<FunctionMetadataV5>>;
readonly events: Option<Vec<EventMetadataV5>>;
}
/** @name ModuleMetadataV6 */
export interface ModuleMetadataV6 extends Struct {
readonly name: Text;
readonly prefix: Text;
readonly storage: Option<Vec<StorageEntryMetadataV6>>;
readonly calls: Option<Vec<FunctionMetadataV6>>;
readonly events: Option<Vec<EventMetadataV6>>;
readonly constants: Vec<ModuleConstantMetadataV6>;
}
/** @name ModuleMetadataV7 */
export interface ModuleMetadataV7 extends Struct {
readonly name: Text;
readonly storage: Option<StorageMetadataV7>;
readonly calls: Option<Vec<FunctionMetadataV7>>;
readonly events: Option<Vec<EventMetadataV7>>;
readonly constants: Vec<ModuleConstantMetadataV7>;
}
/** @name ModuleMetadataV8 */
export interface ModuleMetadataV8 extends Struct {
readonly name: Text;
readonly storage: Option<StorageMetadataV8>;
readonly calls: Option<Vec<FunctionMetadataV8>>;
readonly events: Option<Vec<EventMetadataV8>>;
readonly constants: Vec<ModuleConstantMetadataV8>;
readonly errors: Vec<ErrorMetadataV8>;
}
/** @name ModuleMetadataV9 */
export interface ModuleMetadataV9 extends ModuleMetadataV8 {}
/** @name OuterDispatchCallV0 */
export interface OuterDispatchCallV0 extends Struct {
export interface ModuleMetadataV9 extends Struct {
readonly name: Text;
readonly prefix: Text;
readonly index: u16;
}
/** @name OuterDispatchMetadataV0 */
export interface OuterDispatchMetadataV0 extends Struct {
readonly name: Text;
readonly calls: Vec<OuterDispatchCallV0>;
}
/** @name OuterEventEventMetadataEventsV0 */
export interface OuterEventEventMetadataEventsV0 extends Vec<EventMetadataV0> {}
/** @name OuterEventEventMetadataV0 */
export interface OuterEventEventMetadataV0 extends ITuple<[Text, OuterEventEventMetadataEventsV0]> {}
/** @name OuterEventMetadataV0 */
export interface OuterEventMetadataV0 extends Struct {
readonly name: Text;
readonly events: Vec<OuterEventEventMetadataV0>;
}
/** @name PlainTypeLatest */
export interface PlainTypeLatest extends PlainTypeV12 {}
/** @name PlainTypeV0 */
export interface PlainTypeV0 extends Type {}
/** @name PlainTypeV10 */
export interface PlainTypeV10 extends Type {}
/** @name PlainTypeV11 */
export interface PlainTypeV11 extends Type {}
/** @name PlainTypeV12 */
export interface PlainTypeV12 extends Type {}
/** @name PlainTypeV2 */
export interface PlainTypeV2 extends Type {}
/** @name PlainTypeV3 */
export interface PlainTypeV3 extends Type {}
/** @name PlainTypeV4 */
export interface PlainTypeV4 extends Type {}
/** @name PlainTypeV5 */
export interface PlainTypeV5 extends Type {}
/** @name PlainTypeV6 */
export interface PlainTypeV6 extends Type {}
/** @name PlainTypeV7 */
export interface PlainTypeV7 extends Type {}
/** @name PlainTypeV8 */
export interface PlainTypeV8 extends Type {}
/** @name PlainTypeV9 */
export interface PlainTypeV9 extends Type {}
/** @name RuntimeModuleMetadataV0 */
export interface RuntimeModuleMetadataV0 extends Struct {
readonly prefix: Text;
readonly module: ModuleMetadataV0;
readonly storage: Option<StorageMetadataV0>;
readonly storage: Option<StorageMetadataV9>;
readonly calls: Option<Vec<FunctionMetadataV9>>;
readonly events: Option<Vec<EventMetadataV9>>;
readonly constants: Vec<ModuleConstantMetadataV9>;
readonly errors: Vec<ErrorMetadataV9>;
}
/** @name StorageEntryMetadataLatest */
@@ -647,17 +275,14 @@ export interface StorageEntryMetadataV11 extends Struct {
/** @name StorageEntryMetadataV12 */
export interface StorageEntryMetadataV12 extends StorageEntryMetadataV11 {}
/** @name StorageEntryMetadataV6 */
export interface StorageEntryMetadataV6 extends StorageFunctionMetadataV5 {}
/** @name StorageEntryMetadataV7 */
export interface StorageEntryMetadataV7 extends StorageEntryMetadataV6 {}
/** @name StorageEntryMetadataV8 */
export interface StorageEntryMetadataV8 extends StorageEntryMetadataV7 {}
/** @name StorageEntryMetadataV9 */
export interface StorageEntryMetadataV9 extends StorageEntryMetadataV8 {}
export interface StorageEntryMetadataV9 extends Struct {
readonly name: Text;
readonly modifier: StorageEntryModifierV9;
readonly type: StorageEntryTypeV9;
readonly fallback: Bytes;
readonly documentation: Vec<Text>;
}
/** @name StorageEntryModifierLatest */
export interface StorageEntryModifierLatest extends StorageEntryModifierV12 {}
@@ -671,17 +296,12 @@ export interface StorageEntryModifierV11 extends StorageEntryModifierV10 {}
/** @name StorageEntryModifierV12 */
export interface StorageEntryModifierV12 extends StorageEntryModifierV11 {}
/** @name StorageEntryModifierV6 */
export interface StorageEntryModifierV6 extends StorageFunctionModifierV5 {}
/** @name StorageEntryModifierV7 */
export interface StorageEntryModifierV7 extends StorageEntryModifierV6 {}
/** @name StorageEntryModifierV8 */
export interface StorageEntryModifierV8 extends StorageEntryModifierV7 {}
/** @name StorageEntryModifierV9 */
export interface StorageEntryModifierV9 extends StorageEntryModifierV8 {}
export interface StorageEntryModifierV9 extends Enum {
readonly isOptional: boolean;
readonly isDefault: boolean;
readonly isRequired: boolean;
}
/** @name StorageEntryTypeLatest */
export interface StorageEntryTypeLatest extends StorageEntryTypeV12 {}
@@ -689,7 +309,7 @@ export interface StorageEntryTypeLatest extends StorageEntryTypeV12 {}
/** @name StorageEntryTypeV10 */
export interface StorageEntryTypeV10 extends Enum {
readonly isPlain: boolean;
readonly asPlain: PlainTypeV10;
readonly asPlain: Type;
readonly isMap: boolean;
readonly asMap: MapTypeV10;
readonly isDoubleMap: boolean;
@@ -699,7 +319,7 @@ export interface StorageEntryTypeV10 extends Enum {
/** @name StorageEntryTypeV11 */
export interface StorageEntryTypeV11 extends Enum {
readonly isPlain: boolean;
readonly asPlain: PlainTypeV11;
readonly asPlain: Type;
readonly isMap: boolean;
readonly asMap: MapTypeV11;
readonly isDoubleMap: boolean;
@@ -709,135 +329,14 @@ export interface StorageEntryTypeV11 extends Enum {
/** @name StorageEntryTypeV12 */
export interface StorageEntryTypeV12 extends StorageEntryTypeV11 {}
/** @name StorageEntryTypeV6 */
export interface StorageEntryTypeV6 extends StorageFunctionTypeV5 {}
/** @name StorageEntryTypeV7 */
export interface StorageEntryTypeV7 extends StorageEntryTypeV6 {}
/** @name StorageEntryTypeV8 */
export interface StorageEntryTypeV8 extends StorageEntryTypeV7 {}
/** @name StorageEntryTypeV9 */
export interface StorageEntryTypeV9 extends StorageEntryTypeV8 {}
/** @name StorageFunctionMetadataV0 */
export interface StorageFunctionMetadataV0 extends Struct {
readonly name: Text;
readonly modifier: StorageFunctionModifierV0;
readonly type: StorageFunctionTypeV0;
readonly fallback: Bytes;
readonly documentation: Vec<Text>;
}
/** @name StorageFunctionMetadataV1 */
export interface StorageFunctionMetadataV1 extends StorageFunctionMetadataV0 {}
/** @name StorageFunctionMetadataV2 */
export interface StorageFunctionMetadataV2 extends Struct {
readonly name: Text;
readonly modifier: StorageFunctionModifierV2;
readonly type: StorageFunctionTypeV2;
readonly fallback: Bytes;
readonly documentation: Vec<Text>;
}
/** @name StorageFunctionMetadataV3 */
export interface StorageFunctionMetadataV3 extends Struct {
readonly name: Text;
readonly modifier: StorageFunctionModifierV3;
readonly type: StorageFunctionTypeV3;
readonly fallback: Bytes;
readonly documentation: Vec<Text>;
}
/** @name StorageFunctionMetadataV4 */
export interface StorageFunctionMetadataV4 extends Struct {
readonly name: Text;
readonly modifier: StorageFunctionModifierV4;
readonly type: StorageFunctionTypeV4;
readonly fallback: Bytes;
readonly documentation: Vec<Text>;
}
/** @name StorageFunctionMetadataV5 */
export interface StorageFunctionMetadataV5 extends Struct {
readonly name: Text;
readonly modifier: StorageFunctionModifierV5;
readonly type: StorageFunctionTypeV5;
readonly fallback: Bytes;
readonly documentation: Vec<Text>;
}
/** @name StorageFunctionModifierV0 */
export interface StorageFunctionModifierV0 extends Enum {
readonly isOptional: boolean;
readonly isDefault: boolean;
readonly isRequired: boolean;
}
/** @name StorageFunctionModifierV1 */
export interface StorageFunctionModifierV1 extends StorageFunctionModifierV0 {}
/** @name StorageFunctionModifierV2 */
export interface StorageFunctionModifierV2 extends StorageFunctionModifierV1 {}
/** @name StorageFunctionModifierV3 */
export interface StorageFunctionModifierV3 extends StorageFunctionModifierV2 {}
/** @name StorageFunctionModifierV4 */
export interface StorageFunctionModifierV4 extends StorageFunctionModifierV3 {}
/** @name StorageFunctionModifierV5 */
export interface StorageFunctionModifierV5 extends StorageFunctionModifierV4 {}
/** @name StorageFunctionTypeV0 */
export interface StorageFunctionTypeV0 extends Enum {
export interface StorageEntryTypeV9 extends Enum {
readonly isPlain: boolean;
readonly asPlain: PlainTypeV0;
readonly asPlain: Type;
readonly isMap: boolean;
readonly asMap: MapTypeV0;
}
/** @name StorageFunctionTypeV1 */
export interface StorageFunctionTypeV1 extends StorageFunctionTypeV0 {}
/** @name StorageFunctionTypeV2 */
export interface StorageFunctionTypeV2 extends Enum {
readonly isPlain: boolean;
readonly asPlain: PlainTypeV2;
readonly isMap: boolean;
readonly asMap: MapTypeV2;
}
/** @name StorageFunctionTypeV3 */
export interface StorageFunctionTypeV3 extends Enum {
readonly isPlain: boolean;
readonly asPlain: PlainTypeV3;
readonly isMap: boolean;
readonly asMap: MapTypeV3;
readonly asMap: MapTypeV9;
readonly isDoubleMap: boolean;
readonly asDoubleMap: DoubleMapTypeV3;
}
/** @name StorageFunctionTypeV4 */
export interface StorageFunctionTypeV4 extends Enum {
readonly isPlain: boolean;
readonly asPlain: PlainTypeV4;
readonly isMap: boolean;
readonly asMap: MapTypeV4;
readonly isDoubleMap: boolean;
readonly asDoubleMap: DoubleMapTypeV4;
}
/** @name StorageFunctionTypeV5 */
export interface StorageFunctionTypeV5 extends Enum {
readonly isPlain: boolean;
readonly asPlain: PlainTypeV5;
readonly isMap: boolean;
readonly asMap: MapTypeV5;
readonly isDoubleMap: boolean;
readonly asDoubleMap: DoubleMapTypeV5;
readonly asDoubleMap: DoubleMapTypeV9;
}
/** @name StorageHasher */
@@ -867,8 +366,8 @@ export interface StorageHasherV11 extends Enum {
/** @name StorageHasherV12 */
export interface StorageHasherV12 extends StorageHasherV11 {}
/** @name StorageHasherV4 */
export interface StorageHasherV4 extends Enum {
/** @name StorageHasherV9 */
export interface StorageHasherV9 extends Enum {
readonly isBlake2128: boolean;
readonly isBlake2256: boolean;
readonly isTwox128: boolean;
@@ -876,30 +375,9 @@ export interface StorageHasherV4 extends Enum {
readonly isTwox64Concat: boolean;
}
/** @name StorageHasherV5 */
export interface StorageHasherV5 extends StorageHasherV4 {}
/** @name StorageHasherV6 */
export interface StorageHasherV6 extends StorageHasherV5 {}
/** @name StorageHasherV7 */
export interface StorageHasherV7 extends StorageHasherV6 {}
/** @name StorageHasherV8 */
export interface StorageHasherV8 extends StorageHasherV7 {}
/** @name StorageHasherV9 */
export interface StorageHasherV9 extends StorageHasherV8 {}
/** @name StorageMetadataLatest */
export interface StorageMetadataLatest extends StorageMetadataV12 {}
/** @name StorageMetadataV0 */
export interface StorageMetadataV0 extends Struct {
readonly prefix: Text;
readonly functions: Vec<StorageFunctionMetadataV0>;
}
/** @name StorageMetadataV10 */
export interface StorageMetadataV10 extends Struct {
readonly prefix: Text;
@@ -915,16 +393,10 @@ export interface StorageMetadataV11 extends Struct {
/** @name StorageMetadataV12 */
export interface StorageMetadataV12 extends StorageMetadataV11 {}
/** @name StorageMetadataV7 */
export interface StorageMetadataV7 extends Struct {
/** @name StorageMetadataV9 */
export interface StorageMetadataV9 extends Struct {
readonly prefix: Text;
readonly items: Vec<StorageEntryMetadataV7>;
readonly items: Vec<StorageEntryMetadataV9>;
}
/** @name StorageMetadataV8 */
export interface StorageMetadataV8 extends StorageMetadataV7 {}
/** @name StorageMetadataV9 */
export interface StorageMetadataV9 extends StorageMetadataV8 {}
export type PHANTOM_METADATA = 'metadata';
@@ -5,7 +5,6 @@
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import Metadata from '@polkadot/metadata/Metadata';
import rpcMetadataV1 from '@polkadot/metadata/Metadata/v1/static';
import rpcMetadata from '@polkadot/metadata/Metadata/static';
import { TypeRegistry } from '../../create';
@@ -15,21 +14,6 @@ import json3 from '../../json/EventRecord.003.json';
describe('EventRecord', (): void => {
const registry = new TypeRegistry();
describe('EventRecordTo76', (): void => {
beforeEach((): void => {
const metadata = new Metadata(registry, rpcMetadataV1);
registry.setMetadata(metadata);
});
it('decodes correctly', (): void => {
const records = registry.createType('Vec<EventRecord>', json1.params.result.changes[0][1]) as any;
const er = records[0];
expect(er.phase.type).toEqual('ApplyExtrinsic');
});
});
describe('EventRecord (current)', (): void => {
beforeEach((): void => {
const metadata = new Metadata(registry, rpcMetadata);
@@ -178,10 +178,6 @@ export default {
event: 'Event',
topics: 'Vec<Hash>'
},
EventRecordTo76: {
phase: 'Phase',
event: 'Event'
},
Health: {
peers: 'u64',
isSyncing: 'bool',
@@ -133,12 +133,6 @@ export interface EventRecord extends Struct {
readonly topics: Vec<Hash>;
}
/** @name EventRecordTo76 */
export interface EventRecordTo76 extends Struct {
readonly phase: Phase;
readonly event: Event;
}
/** @name Health */
export interface Health extends Struct {
readonly peers: u64;
@@ -3,14 +3,7 @@
import Decorated from '@polkadot/metadata/Decorated';
import Metadata from '@polkadot/metadata/Metadata';
import rpcDataV3 from '@polkadot/metadata/Metadata/v3/static';
import rpcDataV4 from '@polkadot/metadata/Metadata/v4/static';
import rpcDataV5 from '@polkadot/metadata/Metadata/v5/static';
import rpcDataV6 from '@polkadot/metadata/Metadata/v6/static';
import rpcDataV7 from '@polkadot/metadata/Metadata/v7/static';
import rpcDataV8 from '@polkadot/metadata/Metadata/v8/static';
import rpcDataV11 from '@polkadot/metadata/Metadata/v11/static';
import { hexToU8a } from '@polkadot/util';
import { TypeRegistry } from '../create';
import StorageKey from './StorageKey';
@@ -18,244 +11,6 @@ import StorageKey from './StorageKey';
describe('StorageKey', (): void => {
const registry = new TypeRegistry();
describe('with MetadataV3 (uses xxHash by default)', (): void => {
const metadata = new Metadata(registry, rpcDataV3);
registry.setMetadata(metadata);
const decorated = new Decorated(registry, metadata);
it('should correctly get Alice\'s freeBalance storage key (hex)', (): void => {
expect(
new StorageKey(
registry,
decorated
.query
.balances
.freeBalance('5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY')
)
.toHex()
).toBe('0xc99f5446efa57788f39ab529311f4550'); // FIXME OK this should be length-prefixed in reality
});
it('should correctly get Alice\'s freeBalance storage key (u8a)', (): void => {
expect(
new StorageKey(
registry,
decorated
.query
.balances
.freeBalance('5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY')
)
.toU8a()
).toEqual(
// length prefix attached
hexToU8a('0x40c99f5446efa57788f39ab529311f4550')
);
});
});
describe('with MetadataV4 (uses xxHash by default)', (): void => {
const metadata = new Metadata(registry, rpcDataV4);
registry.setMetadata(metadata);
const decorated = new Decorated(registry, metadata);
it('should correctly get Alice\'s freeBalance storage key (hex)', (): void => {
expect(
new StorageKey(
registry,
decorated
.query
.balances
.freeBalance('5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY')
)
.toHex()
).toBe('0x7f864e18e3dd8b58386310d2fe0919eef27c6e558564b7f67f22d99d20f587bb');
});
it('should correctly get Alice\'s freeBalance storage key (u8a)', (): void => {
expect(
new StorageKey(
registry,
decorated
.query
.balances
.freeBalance('5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY')
)
.toU8a()
).toEqual(
// length prefix attached
Uint8Array.from([
128, 127, 134, 78, 24, 227, 221, 139, 88, 56, 99, 16, 210, 254, 9, 25, 238, 242, 124, 110, 85, 133, 100, 183, 246, 127, 34, 217, 157, 32, 245, 135, 187
])
);
});
it('should correctly get the EventTopics double map storage key (hex)', (): void => {
expect(
new StorageKey(registry, [
decorated
.query
.system
.eventTopics,
['any', [1, 2, 3]]
])
.toHex()
).toBe('0x3007c9ff7027f65900abcdfca4fdb107ead47e2a9e3558e01b691b0f4a5f8518d487326614f066416308bf6aa4e5041d1949928e4b26ede98e3cebb36a3b1726');
});
it('should correctly get the EventTopics double map storage key (u8a)', (): void => {
expect(
new StorageKey(registry, [
decorated
.query
.system
.eventTopics,
['any', [1, 2, 3]]
])
.toU8a()
).toEqual(Uint8Array.from([1, 1, 48, 7, 201, 255, 112, 39, 246, 89, 0, 171, 205, 252, 164, 253, 177, 7, 234, 212, 126, 42, 158, 53, 88, 224, 27, 105, 27, 15, 74, 95, 133, 24, 212, 135, 50, 102, 20, 240, 102, 65, 99, 8, 191, 106, 164, 229, 4, 29, 25, 73, 146, 142, 75, 38, 237, 233, 142, 60, 235, 179, 106, 59, 23, 38]));
});
});
describe('with MetadataV5', (): void => {
const metadata = new Metadata(registry, rpcDataV5);
registry.setMetadata(metadata);
const decorated = new Decorated(registry, metadata);
it('should correctly get the EventTopics double map storage key (hex)', (): void => {
expect(
new StorageKey(registry, [
decorated
.query
.system
.eventTopics,
['any', [1, 2, 3]]
])
.toHex()
).toBe('0x3007c9ff7027f65900abcdfca4fdb107ead47e2a9e3558e01b691b0f4a5f8518d487326614f066416308bf6aa4e5041d1949928e4b26ede98e3cebb36a3b1726');
});
it('should correctly get the EventTopics double map storage key (u8a)', (): void => {
expect(
new StorageKey(registry, [
decorated
.query
.system
.eventTopics,
['any', [1, 2, 3]]
])
.toU8a()
).toEqual(Uint8Array.from([1, 1, 48, 7, 201, 255, 112, 39, 246, 89, 0, 171, 205, 252, 164, 253, 177, 7, 234, 212, 126, 42, 158, 53, 88, 224, 27, 105, 27, 15, 74, 95, 133, 24, 212, 135, 50, 102, 20, 240, 102, 65, 99, 8, 191, 106, 164, 229, 4, 29, 25, 73, 146, 142, 75, 38, 237, 233, 142, 60, 235, 179, 106, 59, 23, 38]));
});
});
describe('with MetadataV6', (): void => {
const metadata = new Metadata(registry, rpcDataV6);
registry.setMetadata(metadata);
const decorated = new Decorated(registry, metadata);
it('should correctly get the EventTopics double map storage key (hex)', (): void => {
expect(
new StorageKey(registry, [
decorated
.query
.system
.eventTopics,
['any', [1, 2, 3]]
])
.toHex()
).toBe('0x3007c9ff7027f65900abcdfca4fdb107ead47e2a9e3558e01b691b0f4a5f8518d487326614f066416308bf6aa4e5041d1949928e4b26ede98e3cebb36a3b1726');
});
it('should correctly get the EventTopics double map storage key (u8a)', (): void => {
expect(
new StorageKey(registry, [
decorated
.query
.system
.eventTopics,
['any', [1, 2, 3]]
])
.toU8a()
).toEqual(Uint8Array.from([1, 1, 48, 7, 201, 255, 112, 39, 246, 89, 0, 171, 205, 252, 164, 253, 177, 7, 234, 212, 126, 42, 158, 53, 88, 224, 27, 105, 27, 15, 74, 95, 133, 24, 212, 135, 50, 102, 20, 240, 102, 65, 99, 8, 191, 106, 164, 229, 4, 29, 25, 73, 146, 142, 75, 38, 237, 233, 142, 60, 235, 179, 106, 59, 23, 38]));
});
});
describe('with MetadataV7', (): void => {
const metadata = new Metadata(registry, rpcDataV7);
registry.setMetadata(metadata);
const decorated = new Decorated(registry, metadata);
it('should correctly get the EventTopics double map storage key (hex)', (): void => {
expect(
new StorageKey(registry, [
decorated
.query
.system
.eventTopics,
['any', [1, 2, 3]]
])
.toHex()
).toBe('0x3007c9ff7027f65900abcdfca4fdb107ead47e2a9e3558e01b691b0f4a5f8518d487326614f066416308bf6aa4e5041d1949928e4b26ede98e3cebb36a3b1726');
});
it('should correctly get the EventTopics double map storage key (u8a)', (): void => {
expect(
new StorageKey(registry, [
decorated
.query
.system
.eventTopics,
['any', [1, 2, 3]]
])
.toU8a()
).toEqual(Uint8Array.from([1, 1, 48, 7, 201, 255, 112, 39, 246, 89, 0, 171, 205, 252, 164, 253, 177, 7, 234, 212, 126, 42, 158, 53, 88, 224, 27, 105, 27, 15, 74, 95, 133, 24, 212, 135, 50, 102, 20, 240, 102, 65, 99, 8, 191, 106, 164, 229, 4, 29, 25, 73, 146, 142, 75, 38, 237, 233, 142, 60, 235, 179, 106, 59, 23, 38]));
});
});
describe('with MetadataV8', (): void => {
const metadata = new Metadata(registry, rpcDataV8);
registry.setMetadata(metadata);
const decorated = new Decorated(registry, metadata);
it('should correctly get the EventTopics double map storage key (hex)', (): void => {
expect(
new StorageKey(registry, [
decorated
.query
.system
.eventTopics,
['any', [1, 2, 3]]
])
.toHex()
).toBe('0x3007c9ff7027f65900abcdfca4fdb107ead47e2a9e3558e01b691b0f4a5f8518d487326614f066416308bf6aa4e5041d1949928e4b26ede98e3cebb36a3b1726');
});
it('should correctly get the EventTopics double map storage key (u8a)', (): void => {
expect(
new StorageKey(registry, [
decorated
.query
.system
.eventTopics,
['any', [1, 2, 3]]
])
.toU8a()
).toEqual(Uint8Array.from([1, 1, 48, 7, 201, 255, 112, 39, 246, 89, 0, 171, 205, 252, 164, 253, 177, 7, 234, 212, 126, 42, 158, 53, 88, 224, 27, 105, 27, 15, 74, 95, 133, 24, 212, 135, 50, 102, 20, 240, 102, 65, 99, 8, 191, 106, 164, 229, 4, 29, 25, 73, 146, 142, 75, 38, 237, 233, 142, 60, 235, 179, 106, 59, 23, 38]));
});
});
describe('with MetadataV11', (): void => {
const metadata = new Metadata(registry, rpcDataV11);