From 5c1f7fb52742d18c0e56e2c471c67a492112ce92 Mon Sep 17 00:00:00 2001 From: Amaury Martiny Date: Thu, 25 Apr 2019 15:34:35 +0200 Subject: [PATCH] Use custom hasher for Map (#857) * Use blake2 instead of two_x * Add v4 * Update to new v4 static * Update json * Revert * Use hasher enum * Fix metadata v4 test * Fix metadata v4 test * Fix versioned metadata * refactor & clean * Use consistent naming * Make jsons consistent * Add backward compat * Fix tests * Start working on type-storage * Fix output * Grumble * Update to latest static * Clean code * Fix imports * Remove useless imports * Fix tests * Use prettier output for toJSON in metadata * Implement different hashers * Remove generic storageKey * Bump version * Add backwards-compat * Fix hashing function, use Twox128 * Grumbles * Add tests --- CHANGELOG.md | 4 + lerna.json | 2 +- packages/api/src/Base.ts | 2 +- packages/rpc-core/src/index.ts | 8 +- .../src/fromMetadata/fromMetadata.ts | 27 + .../type-storage/src/fromMetadata/index.ts | 7 + .../v0}/createFunction.spec.ts | 0 .../v0}/createFunction.ts | 5 +- .../v0/index.ts} | 8 +- .../src/{ => fromMetadata/v0}/storage.spec.ts | 0 .../src/{ => fromMetadata/v0}/storage.ts | 2 +- .../{ => fromMetadata/v0}/substrate.spec.ts | 0 .../src/fromMetadata/v0/substrate.ts | 61 + .../v0/v0.spec.ts} | 6 +- .../fromMetadata/v4/createFunction.spec.ts | 56 + .../src/fromMetadata/v4/createFunction.ts | 81 + .../src/fromMetadata/v4/getHasher.ts | 39 + .../type-storage/src/fromMetadata/v4/index.ts | 37 + .../src/fromMetadata/v4/storage.spec.ts | 17 + .../src/fromMetadata/v4/storage.ts | 10 + .../src/fromMetadata/v4/substrate.spec.ts | 33 + .../src/{ => fromMetadata/v4}/substrate.ts | 9 +- .../src/fromMetadata/v4/v4.spec.ts | 35 + packages/type-storage/src/index.ts | 2 +- packages/type-storage/src/static.ts | 2 +- packages/type-storage/src/types.ts | 6 +- .../types/src/Metadata/MetadataVersioned.ts | 38 +- packages/types/src/Metadata/v0/Events.ts | 8 + .../types/src/Metadata/v0/Metadata.spec.ts | 2 +- packages/types/src/Metadata/v0/Modules.ts | 246 +- packages/types/src/Metadata/v0/Storage.ts | 207 + .../src/Metadata/v0/latest.substrate.json | 444 +-- packages/types/src/Metadata/v1/Calls.ts | 12 +- packages/types/src/Metadata/v1/Events.ts | 12 +- packages/types/src/Metadata/v1/Metadata.ts | 8 +- packages/types/src/Metadata/v1/Storage.ts | 195 +- .../src/Metadata/v1/latest.substrate.v1.json | 464 +-- packages/types/src/Metadata/v1/toV0.ts | 17 +- packages/types/src/Metadata/v2/Metadata.ts | 8 +- packages/types/src/Metadata/v2/Storage.ts | 86 +- .../src/Metadata/v2/latest.substrate.v2.json | 474 +-- packages/types/src/Metadata/v3/Metadata.ts | 8 +- packages/types/src/Metadata/v3/Storage.ts | 162 +- .../src/Metadata/v3/latest.substrate.v3.json | 486 +-- .../types/src/Metadata/v4/Metadata.spec.ts | 22 + packages/types/src/Metadata/v4/Metadata.ts | 130 + packages/types/src/Metadata/v4/Storage.ts | 290 ++ packages/types/src/Metadata/v4/index.ts | 11 + .../src/Metadata/v4/latest.substrate.v4.json | 3341 +++++++++++++++++ packages/types/src/Metadata/v4/static.ts | 7 + packages/types/src/Metadata/v4/toV3.ts | 10 + packages/types/src/primitive/StorageKey.ts | 11 +- .../src/scripts/METHODS_STORAGE_SUBSTRATE.md | 2 +- 53 files changed, 5690 insertions(+), 1470 deletions(-) create mode 100644 packages/type-storage/src/fromMetadata/fromMetadata.ts create mode 100644 packages/type-storage/src/fromMetadata/index.ts rename packages/type-storage/src/{utils => fromMetadata/v0}/createFunction.spec.ts (100%) rename packages/type-storage/src/{utils => fromMetadata/v0}/createFunction.ts (92%) rename packages/type-storage/src/{fromMetadata.ts => fromMetadata/v0/index.ts} (84%) rename packages/type-storage/src/{ => fromMetadata/v0}/storage.spec.ts (100%) rename packages/type-storage/src/{ => fromMetadata/v0}/storage.ts (90%) rename packages/type-storage/src/{ => fromMetadata/v0}/substrate.spec.ts (100%) create mode 100644 packages/type-storage/src/fromMetadata/v0/substrate.ts rename packages/type-storage/src/{fromMetadata.spec.ts => fromMetadata/v0/v0.spec.ts} (89%) create mode 100644 packages/type-storage/src/fromMetadata/v4/createFunction.spec.ts create mode 100644 packages/type-storage/src/fromMetadata/v4/createFunction.ts create mode 100644 packages/type-storage/src/fromMetadata/v4/getHasher.ts create mode 100644 packages/type-storage/src/fromMetadata/v4/index.ts create mode 100644 packages/type-storage/src/fromMetadata/v4/storage.spec.ts create mode 100644 packages/type-storage/src/fromMetadata/v4/storage.ts create mode 100644 packages/type-storage/src/fromMetadata/v4/substrate.spec.ts rename packages/type-storage/src/{ => fromMetadata/v4}/substrate.ts (89%) create mode 100644 packages/type-storage/src/fromMetadata/v4/v4.spec.ts create mode 100644 packages/types/src/Metadata/v0/Storage.ts create mode 100644 packages/types/src/Metadata/v4/Metadata.spec.ts create mode 100644 packages/types/src/Metadata/v4/Metadata.ts create mode 100644 packages/types/src/Metadata/v4/Storage.ts create mode 100644 packages/types/src/Metadata/v4/index.ts create mode 100644 packages/types/src/Metadata/v4/latest.substrate.v4.json create mode 100644 packages/types/src/Metadata/v4/static.ts create mode 100644 packages/types/src/Metadata/v4/toV3.ts diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fd9c081c7..f79652ce24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.78.1 + +- Support Metadata v4, which introduces the use of a custom hasher to hash storage map keys. + # 0.77.1 - Add TresuryProposal (not the same as democracy, type aliassed) diff --git a/lerna.json b/lerna.json index e1e35ac2d1..4f3a8449f3 100644 --- a/lerna.json +++ b/lerna.json @@ -9,5 +9,5 @@ "packages": [ "packages/*" ], - "version": "0.76.102" + "version": "0.77.0" } diff --git a/packages/api/src/Base.ts b/packages/api/src/Base.ts index 5cd3782b2c..064b53b5f4 100644 --- a/packages/api/src/Base.ts +++ b/packages/api/src/Base.ts @@ -390,7 +390,7 @@ export default abstract class ApiBase implement } const extrinsics = extrinsicsFromMeta(this.runtimeMetadata.asV0); - const storage = storageFromMeta(this.runtimeMetadata.asV0); + const storage = storageFromMeta(this.runtimeMetadata); this._extrinsics = this.decorateExtrinsics(extrinsics, this.onCall); this._query = this.decorateStorage(storage, this.onCall) as any; // FIXME 3.4.1 diff --git a/packages/rpc-core/src/index.ts b/packages/rpc-core/src/index.ts index 96841a2196..d39e11fc20 100644 --- a/packages/rpc-core/src/index.ts +++ b/packages/rpc-core/src/index.ts @@ -192,7 +192,7 @@ export default class Rpc implements RpcInterface { const key = params[0] as StorageKey; const type = key.outputType || 'Data'; const Clazz = createClass(type); - const meta = key.meta || { default: undefined, modifier: { isOptional: true } }; + const meta = key.meta || { fallback: undefined, modifier: { isOptional: true } }; if (key.meta && key.meta.type.isMap && key.meta.type.asMap.isLinked) { // linked map @@ -218,11 +218,11 @@ export default class Rpc implements RpcInterface { const { value } = (base as StorageChangeSet).changes.find((item) => item.key.toHex() === hexKey ) || { value: null }; - const meta = key.meta || { default: undefined, modifier: { isOptional: true } }; + const meta = key.meta || { fallback: undefined, modifier: { isOptional: true } }; if (!value) { // if we don't have a value, do not fill in the entry, it will be up to the - // caller to sort this out, either ignoring or having a cache for older values + // caller to sort this out, either ignoring or having a cache for older values result.push(undefined); } else { if (key.meta && key.meta.type.isMap && key.meta.type.asMap.isLinked) { @@ -236,7 +236,7 @@ export default class Rpc implements RpcInterface { } else { // for `null` we fallback to the default value, or create an empty type, // otherwise we return the actual value as retrieved - result.push(new Clazz(value.unwrapOr(meta.default))); + result.push(new Clazz(value.unwrapOr(meta.fallback))); } } } diff --git a/packages/type-storage/src/fromMetadata/fromMetadata.ts b/packages/type-storage/src/fromMetadata/fromMetadata.ts new file mode 100644 index 0000000000..1778420b9e --- /dev/null +++ b/packages/type-storage/src/fromMetadata/fromMetadata.ts @@ -0,0 +1,27 @@ +// Copyright 2017-2019 @polkadot/storage authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import { Storage } from '../types'; + +import Metadata from '@polkadot/types/Metadata'; + +import fromV0 from './v0'; +import fromV4 from './v4'; + +/** + * Extend a storage object with the storage modules & module functions present + * in the metadata. + * + * @param storage - A storage object to be extended. + * @param metadata - The metadata to extend the storage object against. + */ +export default function fromMetadata (metadata: Metadata): Storage { + // For v0-v3 we convert to v0, and use the fromV0 function to parse + if ([0, 1, 2, 3].includes(metadata.version)) { + return fromV0(metadata.asV0); + } + + // For v4, we use fromV4 function + return fromV4(metadata.asV4); +} diff --git a/packages/type-storage/src/fromMetadata/index.ts b/packages/type-storage/src/fromMetadata/index.ts new file mode 100644 index 0000000000..1cda4fcf49 --- /dev/null +++ b/packages/type-storage/src/fromMetadata/index.ts @@ -0,0 +1,7 @@ +// Copyright 2017-2019 @polkadot/storage authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import fromMetadata from './fromMetadata'; + +export default fromMetadata; diff --git a/packages/type-storage/src/utils/createFunction.spec.ts b/packages/type-storage/src/fromMetadata/v0/createFunction.spec.ts similarity index 100% rename from packages/type-storage/src/utils/createFunction.spec.ts rename to packages/type-storage/src/fromMetadata/v0/createFunction.spec.ts diff --git a/packages/type-storage/src/utils/createFunction.ts b/packages/type-storage/src/fromMetadata/v0/createFunction.ts similarity index 92% rename from packages/type-storage/src/utils/createFunction.ts rename to packages/type-storage/src/fromMetadata/v0/createFunction.ts index 04c682c8be..adcc9dbcd0 100644 --- a/packages/type-storage/src/utils/createFunction.ts +++ b/packages/type-storage/src/fromMetadata/v0/createFunction.ts @@ -2,12 +2,11 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { StorageFunctionMetadata, StorageFunctionModifier, StorageFunctionType } from '@plugnet/types/Metadata/v0/Modules'; +import { PlainType, StorageFunctionMetadata, StorageFunctionModifier, StorageFunctionType } from '@plugnet/types/Metadata/v0/Storage'; import { StorageFunction } from '@plugnet/types/primitive/StorageKey'; import { Compact, Text, createType, StorageKey, Bytes, U8a } from '@plugnet/types'; import { assert, isNull, isUndefined, stringLowerFirst, stringToU8a, u8aConcat } from '@plugnet/util'; import { xxhashAsU8a } from '@plugnet/util-crypto'; -import { PlainType } from '@plugnet/types/Metadata/v2/Storage'; export interface CreateItemOptions { isUnhashed?: boolean; @@ -60,7 +59,7 @@ export default function createFunction (section: Text | string, method: Text | s name: meta.name, modifier: new StorageFunctionModifier('Required'), type: new StorageFunctionType(new PlainType(meta.type.asMap.key), 0), - default: new Bytes(), + fallback: new Bytes(), documentation: meta.documentation }); storageFn.headKey = new StorageKey(keyFn); diff --git a/packages/type-storage/src/fromMetadata.ts b/packages/type-storage/src/fromMetadata/v0/index.ts similarity index 84% rename from packages/type-storage/src/fromMetadata.ts rename to packages/type-storage/src/fromMetadata/v0/index.ts index 7cc7e70e1e..c2caa7d246 100644 --- a/packages/type-storage/src/fromMetadata.ts +++ b/packages/type-storage/src/fromMetadata/v0/index.ts @@ -2,13 +2,13 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { ModuleStorage, Storage } from './types'; +import { ModuleStorage, Storage } from '../../types'; import MetadataV0 from '@plugnet/types/Metadata/v0'; import { stringLowerFirst } from '@plugnet/util'; -import createFunction from './utils/createFunction'; -import storage from '.'; +import createFunction from './createFunction'; +import { storage } from './storage'; /** * Extend a storage object with the storage modules & module functions present @@ -17,7 +17,7 @@ import storage from '.'; * @param storage - A storage object to be extended. * @param metadata - The metadata to extend the storage object against. */ -export default function fromMetadata (metadata: MetadataV0): Storage { +export default function fromV0 (metadata: MetadataV0): Storage { return metadata.modules.reduce((result, moduleMetadata) => { if (moduleMetadata.storage.isNone) { return result; diff --git a/packages/type-storage/src/storage.spec.ts b/packages/type-storage/src/fromMetadata/v0/storage.spec.ts similarity index 100% rename from packages/type-storage/src/storage.spec.ts rename to packages/type-storage/src/fromMetadata/v0/storage.spec.ts diff --git a/packages/type-storage/src/storage.ts b/packages/type-storage/src/fromMetadata/v0/storage.ts similarity index 90% rename from packages/type-storage/src/storage.ts rename to packages/type-storage/src/fromMetadata/v0/storage.ts index 7745bfd70a..c40c05d6f8 100644 --- a/packages/type-storage/src/storage.ts +++ b/packages/type-storage/src/fromMetadata/v0/storage.ts @@ -2,7 +2,7 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { Storage } from './types'; +import { Storage } from '../../types'; import * as substrate from './substrate'; export const storage: Storage = { diff --git a/packages/type-storage/src/substrate.spec.ts b/packages/type-storage/src/fromMetadata/v0/substrate.spec.ts similarity index 100% rename from packages/type-storage/src/substrate.spec.ts rename to packages/type-storage/src/fromMetadata/v0/substrate.spec.ts diff --git a/packages/type-storage/src/fromMetadata/v0/substrate.ts b/packages/type-storage/src/fromMetadata/v0/substrate.ts new file mode 100644 index 0000000000..f6510c0923 --- /dev/null +++ b/packages/type-storage/src/fromMetadata/v0/substrate.ts @@ -0,0 +1,61 @@ +// Copyright 2017-2019 @polkadot/storage authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import { StorageFunctionMetadata, StorageFunctionModifier, StorageFunctionType } from '@polkadot/types/Metadata/v0/Storage'; +import { StorageFunction } from '@polkadot/types/primitive/StorageKey'; +import { Text, Vector } from '@polkadot/types'; + +import createFunction from './createFunction'; + +interface SubstrateMetadata { + documentation: string; + type: string; +} + +// Small helper function to factorize code on this page. +const createRuntimeFunction = (method: string, key: string, { documentation, type }: SubstrateMetadata): StorageFunction => + createFunction( + new Text('Substrate'), + new Text(method), + { + documentation: new Vector(Text, [documentation]), + modifier: new StorageFunctionModifier(1), // default + type: new StorageFunctionType(type, 0), + toJSON: (): any => key + } as StorageFunctionMetadata, + { + isUnhashed: true, + key + } + ); + +export const code = createRuntimeFunction('code', ':code', { + documentation: 'Wasm code of the runtime.', + type: 'Bytes' +}); + +export const heapPages = createRuntimeFunction('heapPages', ':heappages', { + documentation: 'Number of wasm linear memory pages required for execution of the runtime.', + type: 'u64' +}); + +export const authorityCount = createRuntimeFunction('authorityCount', ':auth:len', { + documentation: 'Number of authorities.', + type: 'u32' +}); + +export const authorityPrefix = createRuntimeFunction('authorityPrefix', ':auth:', { + documentation: 'Prefix under which authorities are stored.', + type: 'u32' +}); + +export const extrinsicIndex = createRuntimeFunction('extrinsicIndex', ':extrinsic_index', { + documentation: 'Current extrinsic index (u32) is stored under this key.', + type: 'u32' +}); + +export const changesTrieConfig = createRuntimeFunction('changesTrieConfig', ':changes_trie', { + documentation: 'Changes trie configuration is stored under this key.', + type: 'u32' +}); diff --git a/packages/type-storage/src/fromMetadata.spec.ts b/packages/type-storage/src/fromMetadata/v0/v0.spec.ts similarity index 89% rename from packages/type-storage/src/fromMetadata.spec.ts rename to packages/type-storage/src/fromMetadata/v0/v0.spec.ts index f49022eb52..6a206401ae 100644 --- a/packages/type-storage/src/fromMetadata.spec.ts +++ b/packages/type-storage/src/fromMetadata/v0/v0.spec.ts @@ -6,13 +6,13 @@ import { u8aToHex } from '@plugnet/util'; import { Metadata } from '@plugnet/types'; import json from '@plugnet/types/Metadata/v0/static'; -import fromMetadata from './fromMetadata'; +import fromv0 from '.'; // Use the pre-generated metadata const metadata = new Metadata(json).asV0; -const newStorage = fromMetadata(metadata); +const newStorage = fromv0(metadata); -describe('fromMetadata', () => { +describe('fromv0', () => { it('should throw if the storage function expects an argument', () => { expect(() => newStorage.balances.freeBalance()).toThrowError(/expects one argument/); }); diff --git a/packages/type-storage/src/fromMetadata/v4/createFunction.spec.ts b/packages/type-storage/src/fromMetadata/v4/createFunction.spec.ts new file mode 100644 index 0000000000..7fae0edf76 --- /dev/null +++ b/packages/type-storage/src/fromMetadata/v4/createFunction.spec.ts @@ -0,0 +1,56 @@ +// Copyright 2017-2019 @polkadot/storage authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import { stringToU8a, u8aConcat } from '@polkadot/util'; + +import createFunction from './createFunction'; + +describe('createFunction', () => { + it('should create timestamp.now correctly', () => { + expect( + createFunction( + 'Timestamp', + 'Now', + { type: {} } as any + )() + ).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)', () => { + expect( + createFunction( + 'Substrate', + 'authorityCount', + { type: {} } as any, + { + isUnhashed: true, + key: ':auth:len' + } + ).method + ).toEqual('authorityCount'); + }); + + it('allows overrides on key (unhashed)', () => { + const key = ':auth:len'; + + expect( + createFunction( + 'Substrate', + 'authorityCount', + { type: {} } as any, + { + isUnhashed: true, + key + } + )() + ).toEqual( + u8aConcat( + Uint8Array.from([key.length << 2]), + stringToU8a(':auth:len') + ) + ); + }); +}); diff --git a/packages/type-storage/src/fromMetadata/v4/createFunction.ts b/packages/type-storage/src/fromMetadata/v4/createFunction.ts new file mode 100644 index 0000000000..fb80f089cf --- /dev/null +++ b/packages/type-storage/src/fromMetadata/v4/createFunction.ts @@ -0,0 +1,81 @@ +// Copyright 2017-2019 @polkadot/storage authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import { createType, Bytes, Compact, StorageKey, Text, U8a } from '@polkadot/types'; +import { PlainType, StorageFunctionMetadata, StorageFunctionModifier, StorageFunctionType } from '@polkadot/types/Metadata/v4/Storage'; +import { StorageFunction } from '@polkadot/types/primitive/StorageKey'; +import { assert, isNull, isUndefined, stringLowerFirst, stringToU8a, u8aConcat } from '@polkadot/util'; + +import getHasher from './getHasher'; + +export interface CreateItemOptions { + isUnhashed?: boolean; + key?: string; +} + +/** + * From the schema of a function in the module's storage, generate the function + * that will return the correct storage key. + * + * @param schema - The function's definition schema to create the function from. + * The schema is taken from state_getMetadata. + * @param options - Additional options when creating the function. These options + * are not known at runtime (from state_getMetadata), they need to be supplied + * by us manually at compile time. + */ +export default function createFunction (section: Text | string, method: Text | string, meta: StorageFunctionMetadata, options: CreateItemOptions = {}): StorageFunction { + const stringKey = options.key + ? options.key + : `${section.toString()} ${method.toString()}`; + const rawKey = stringToU8a(stringKey); + + // Get the hashing function + // FIXME Hash correctly for double map too + const hasher = meta.type.isMap + ? getHasher(meta.type.asMap.hasher) + : getHasher(); + + // Can only have zero or one argument: + // - storage.balances.freeBalance(address) + // - storage.timestamp.blockPeriod() + const storageFn = (arg?: any): Uint8Array => { + let key = rawKey; + if (meta.type.isMap) { + assert(!isUndefined(arg) && !isNull(arg), `${meta.name} expects one argument`); + + const type = meta.type.asMap.key.toString(); + const param = createType(type, arg).toU8a(false); + + key = u8aConcat(key, param); + } + + // StorageKey is a Bytes, so is length-prefixed + return Compact.addLengthPrefix( + options.isUnhashed + ? key + : hasher(key) + ); + }; + + if (meta.type.isMap && meta.type.asMap.isLinked) { + // TODO: there needs some better way to do this + const keyHash = new U8a(hasher(`head of ${stringKey}`)); + const keyFn: any = () => keyHash; + keyFn.meta = new StorageFunctionMetadata({ + name: meta.name, + modifier: new StorageFunctionModifier('Required'), + type: new StorageFunctionType(new PlainType(meta.type.asMap.key), 0), + fallback: new Bytes(), + documentation: meta.documentation + }); + storageFn.headKey = new StorageKey(keyFn); + } + + storageFn.meta = meta; + storageFn.method = stringLowerFirst(method.toString()); + storageFn.section = stringLowerFirst(section.toString()); + storageFn.toJSON = (): any => meta.toJSON(); + + return storageFn as StorageFunction; +} diff --git a/packages/type-storage/src/fromMetadata/v4/getHasher.ts b/packages/type-storage/src/fromMetadata/v4/getHasher.ts new file mode 100644 index 0000000000..9eb91106d9 --- /dev/null +++ b/packages/type-storage/src/fromMetadata/v4/getHasher.ts @@ -0,0 +1,39 @@ +// Copyright 2017-2019 @polkadot/storage authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import { StorageHasher } from '@polkadot/types/Metadata/v4/Storage'; +import { blake2AsU8a, xxhashAsU8a } from '@polkadot/util-crypto'; + +type HasherInput = string | Buffer | Uint8Array; + +type HasherFunction = (data: HasherInput) => Uint8Array; + +export default function getHasher (hasher?: StorageHasher): HasherFunction { + // This one is the default for PlainType storage keys + if (!hasher) { + return (data: HasherInput) => xxhashAsU8a(data, 128); + } + + if (hasher.isBlake2128) { + return (data: HasherInput) => blake2AsU8a(data, 128); + } + + if (hasher.isBlake2256) { + return (data: HasherInput) => blake2AsU8a(data, 256); + } + + if (hasher.isTwox128) { + return (data: HasherInput) => xxhashAsU8a(data, 128); + } + + if (hasher.isTwox256) { + return (data: HasherInput) => xxhashAsU8a(data, 256); + } + + // FIXME Add Twox128Concat + + // All cases should be handled above, but if not, return Twox128 for + // backwards-compatbility + return (data: HasherInput) => xxhashAsU8a(data, 128); +} diff --git a/packages/type-storage/src/fromMetadata/v4/index.ts b/packages/type-storage/src/fromMetadata/v4/index.ts new file mode 100644 index 0000000000..324c440a8b --- /dev/null +++ b/packages/type-storage/src/fromMetadata/v4/index.ts @@ -0,0 +1,37 @@ +// Copyright 2017-2019 @polkadot/storage authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import { ModuleStorage, Storage } from '../../types'; + +import MetadataV4 from '@polkadot/types/Metadata/v4'; +import { stringLowerFirst } from '@polkadot/util'; + +import createFunction from './createFunction'; +import { storage } from './storage'; + +/** + * Extend a storage object with the storage modules & module functions present + * in the metadata. + * + * @param storage - A storage object to be extended. + * @param metadata - The metadata to extend the storage object against. + */ +export default function fromV4 (metadata: MetadataV4): Storage { + return metadata.modules.reduce((result, moduleMetadata) => { + if (moduleMetadata.storage.isNone) { + return result; + } + + const prefix = moduleMetadata.prefix; + + // For access, we change the index names, i.e. Balances.FreeBalance -> balances.freeBalance + result[stringLowerFirst(prefix.toString())] = moduleMetadata.storage.unwrap().reduce((newModule, storageFnMeta) => { + newModule[stringLowerFirst(storageFnMeta.name.toString())] = createFunction(prefix, storageFnMeta.name, storageFnMeta); + + return newModule; + }, {} as ModuleStorage); + + return result; + }, { ...storage }); +} diff --git a/packages/type-storage/src/fromMetadata/v4/storage.spec.ts b/packages/type-storage/src/fromMetadata/v4/storage.spec.ts new file mode 100644 index 0000000000..e842262079 --- /dev/null +++ b/packages/type-storage/src/fromMetadata/v4/storage.spec.ts @@ -0,0 +1,17 @@ +// Copyright 2017-2019 @polkadot/storage authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import { storage } from './storage'; + +describe('storage', () => { + it('should return well known keys', () => { + expect(typeof storage.substrate).toBe('object'); + expect(storage.substrate.authorityCount).toBeTruthy(); + expect(storage.substrate.authorityPrefix).toBeTruthy(); + expect(storage.substrate.changesTrieConfig).toBeTruthy(); + expect(storage.substrate.code).toBeTruthy(); + expect(storage.substrate.extrinsicIndex).toBeTruthy(); + expect(storage.substrate.heapPages).toBeTruthy(); + }); +}); diff --git a/packages/type-storage/src/fromMetadata/v4/storage.ts b/packages/type-storage/src/fromMetadata/v4/storage.ts new file mode 100644 index 0000000000..c40c05d6f8 --- /dev/null +++ b/packages/type-storage/src/fromMetadata/v4/storage.ts @@ -0,0 +1,10 @@ +// Copyright 2017-2019 @polkadot/storage authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import { Storage } from '../../types'; +import * as substrate from './substrate'; + +export const storage: Storage = { + substrate // Prefill storage with well known keys, as not returned by state_getMetadata +}; diff --git a/packages/type-storage/src/fromMetadata/v4/substrate.spec.ts b/packages/type-storage/src/fromMetadata/v4/substrate.spec.ts new file mode 100644 index 0000000000..c442e3d58e --- /dev/null +++ b/packages/type-storage/src/fromMetadata/v4/substrate.spec.ts @@ -0,0 +1,33 @@ +// Copyright 2017-2019 @polkadot/storage authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import { authorityCount, authorityPrefix, changesTrieConfig, code, extrinsicIndex, heapPages } from './substrate'; + +describe('substrate', () => { + it('authorityCount should return the correct storage key', () => { + expect(authorityCount()).toEqual(Uint8Array.from([36, 58, 97, 117, 116, 104, 58, 108, 101, 110])); // Length-prefixed + }); + + it('authorityPrefix should return the correct storage key', () => { + expect(authorityPrefix()).toEqual(Uint8Array.from([24, 58, 97, 117, 116, 104, 58])); // Length-prefixed + }); + + it('changesTrieConfig should return the correct storage key', () => { + expect(changesTrieConfig()).toEqual(Uint8Array.from([52, 58, 99, 104, 97, 110, 103, 101, 115, 95, 116, 114, 105, 101])); // Length-prefixed + }); + + it('code should return the correct storage key', () => { + expect(code()).toEqual(Uint8Array.from([20, 58, 99, 111, 100, 101])); // Length-prefixed + }); + + it('extrinsicIndex should return the correct storage key', () => { + expect(extrinsicIndex()).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', () => { + expect(heapPages()).toEqual(Uint8Array.from([40, 58, 104, 101, 97, 112, 112, 97, 103, 101, 115])); // Length-prefixed + }); +}); diff --git a/packages/type-storage/src/substrate.ts b/packages/type-storage/src/fromMetadata/v4/substrate.ts similarity index 89% rename from packages/type-storage/src/substrate.ts rename to packages/type-storage/src/fromMetadata/v4/substrate.ts index 81b0756b7a..4d34210243 100644 --- a/packages/type-storage/src/substrate.ts +++ b/packages/type-storage/src/fromMetadata/v4/substrate.ts @@ -2,11 +2,11 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { StorageFunctionMetadata, StorageFunctionModifier, StorageFunctionType } from '@plugnet/types/Metadata/v0/Modules'; +import { StorageFunctionMetadata, StorageFunctionModifier, StorageFunctionType } from '@plugnet/types/Metadata/v4/Storage'; import { StorageFunction } from '@plugnet/types/primitive/StorageKey'; import { Text, Vector } from '@plugnet/types'; -import createFunction from './utils/createFunction'; +import createFunction from './createFunction'; interface SubstrateMetadata { documentation: string; @@ -22,8 +22,7 @@ const createRuntimeFunction = (method: string, key: string, { documentation, typ documentation: new Vector(Text, [documentation]), modifier: new StorageFunctionModifier(1), // default type: new StorageFunctionType(type, 0), - toJSON: (): any => - key + toJSON: (): any => key } as StorageFunctionMetadata, { isUnhashed: true, @@ -47,7 +46,7 @@ export const authorityCount = createRuntimeFunction('authorityCount', ':auth:len }); export const authorityPrefix = createRuntimeFunction('authorityPrefix', ':auth:', { - documentation: 'Prefix under which authorities are storied.', + documentation: 'Prefix under which authorities are stored.', type: 'u32' }); diff --git a/packages/type-storage/src/fromMetadata/v4/v4.spec.ts b/packages/type-storage/src/fromMetadata/v4/v4.spec.ts new file mode 100644 index 0000000000..8b0247cac6 --- /dev/null +++ b/packages/type-storage/src/fromMetadata/v4/v4.spec.ts @@ -0,0 +1,35 @@ +// Copyright 2017-2019 @polkadot/storage authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import testingPairs from '@polkadot/keyring/testingPairs'; +import { Metadata } from '@polkadot/types'; +import json from '@polkadot/types/Metadata/v4/static'; +import { u8aToHex } from '@polkadot/util'; + +import fromv4 from '.'; + +const keyring = testingPairs({ type: 'ed25519' }); +// Use the pre-generated metadata +const metadata = new Metadata(json).asV4; +const newStorage = fromv4(metadata); + +describe('fromv4', () => { + it('should throw if the storage function expects an argument', () => { + expect(() => newStorage.balances.freeBalance()).toThrowError(/expects one argument/); + }); + + it('should return a value if the storage function does not expect an argument', () => { + expect(() => newStorage.timestamp.now()).not.toThrow(); + }); + + it('should return the correct length-prefixed storage key', () => { + expect( + u8aToHex( + newStorage.balances.freeBalance(keyring.alice.address()) + ) + ).toEqual( + '0x807f864e18e3dd8b58386310d2fe0919eef27c6e558564b7f67f22d99d20f587bb' + ); + }); +}); diff --git a/packages/type-storage/src/index.ts b/packages/type-storage/src/index.ts index b08bf51d89..27f79886a0 100644 --- a/packages/type-storage/src/index.ts +++ b/packages/type-storage/src/index.ts @@ -2,6 +2,6 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { storage } from './storage'; +import { storage } from './fromMetadata/v0/storage'; export default storage; diff --git a/packages/type-storage/src/static.ts b/packages/type-storage/src/static.ts index a06a32c99d..3c2bc0cd7f 100644 --- a/packages/type-storage/src/static.ts +++ b/packages/type-storage/src/static.ts @@ -8,5 +8,5 @@ import metadataRpc from '@plugnet/types/Metadata/v0/static'; import fromMetadata from './fromMetadata'; export default fromMetadata( - new Metadata(metadataRpc).asV0 + new Metadata(metadataRpc) ); diff --git a/packages/type-storage/src/types.ts b/packages/type-storage/src/types.ts index 085457134f..e7aade3435 100644 --- a/packages/type-storage/src/types.ts +++ b/packages/type-storage/src/types.ts @@ -4,15 +4,11 @@ import { StorageFunction } from '@plugnet/types/primitive/StorageKey'; -import * as substrate from './substrate'; - -type Substrate = keyof typeof substrate; - export interface ModuleStorage { [key: string]: StorageFunction; } export interface Storage { [key: string]: ModuleStorage; // Will hold modules returned by state_getMetadata - substrate: { [key in Substrate]: StorageFunction }; + substrate: { [key: string]: StorageFunction }; } diff --git a/packages/types/src/Metadata/MetadataVersioned.ts b/packages/types/src/Metadata/MetadataVersioned.ts index 8865d92d9e..ec45ba1dfe 100644 --- a/packages/types/src/Metadata/MetadataVersioned.ts +++ b/packages/types/src/Metadata/MetadataVersioned.ts @@ -14,17 +14,20 @@ import MetadataV0 from './v0'; import MetadataV1 from './v1'; import MetadataV2 from './v2'; import MetadataV3 from './v3'; +import MetadataV4 from './v4'; import v1ToV0 from './v1/toV0'; import v2ToV1 from './v2/toV1'; import v3ToV2 from './v3/toV2'; +import v4ToV3 from './v4/toV3'; -class MetadataEnum extends EnumType { +class MetadataEnum extends EnumType { constructor (value?: any) { super({ MetadataV0, // once rolled-out, can replace this with Null MetadataV1, // once rolled-out, can replace this with Null MetadataV2, // once rolled-out, can replace this with Null - MetadataV3 + MetadataV3, // once rolled-out, can replace this with Null + MetadataV4 }, value); } @@ -56,6 +59,13 @@ class MetadataEnum extends EnumType { return this.value as MetadataV3; } + /** + * @description Returns the wrapped values as a V4 object + */ + get asV4 (): MetadataV4 { + return this.value as MetadataV4; + } + /** * @description The version this metadata represents */ @@ -73,6 +83,7 @@ export default class MetadataVersioned extends Struct implements MetadataInterfa private _convertedV0?: MetadataV0; private _convertedV1?: MetadataV1; private _convertedV2?: MetadataV2; + private _convertedV3?: MetadataV3; constructor (value?: any) { super({ @@ -125,7 +136,7 @@ export default class MetadataVersioned extends Struct implements MetadataInterfa return this.metadata.asV1; } - assert([2, 3].includes(this.metadata.version), `Cannot convert metadata from v${this.metadata.version} to v1`); + assert([2, 3, 4].includes(this.metadata.version), `Cannot convert metadata from v${this.metadata.version} to v1`); if (isUndefined(this._convertedV1)) { this._convertedV1 = v2ToV1(this.metadata.asV2); @@ -142,7 +153,7 @@ export default class MetadataVersioned extends Struct implements MetadataInterfa return this.metadata.asV2; } - assert(this.metadata.version === 3, `Cannot convert metadata from v${this.metadata.version} to v1`); + assert([3, 4].includes(this.metadata.version), `Cannot convert metadata from v${this.metadata.version} to v2`); if (isUndefined(this._convertedV2)) { this._convertedV2 = v3ToV2(this.metadata.asV3); @@ -155,7 +166,15 @@ export default class MetadataVersioned extends Struct implements MetadataInterfa * @description Returns the wrapped values as a V3 object */ get asV3 (): MetadataV3 { - assert(this.metadata.version === 3, `Cannot convert metadata from v${this.metadata.version} to v3`); + if (this.metadata.version === 3) { + return this.metadata.asV3; + } + + assert([4].includes(this.metadata.version), `Cannot convert metadata from v${this.metadata.version} to v2`); + + if (isUndefined(this._convertedV3)) { + this._convertedV3 = v4ToV3(this.metadata.asV4); + } return this.metadata.asV3; } @@ -163,4 +182,13 @@ export default class MetadataVersioned extends Struct implements MetadataInterfa getUniqTypes (throwError: boolean): Array { return (this.metadata.value as any as MetadataInterface).getUniqTypes(throwError); } + + /** + * @description Returns the wrapped values as a V3 object + */ + get asV4 (): MetadataV4 { + assert(this.metadata.version === 4, `Cannot convert metadata from v${this.metadata.version} to v4`); + + return this.metadata.asV4; + } } diff --git a/packages/types/src/Metadata/v0/Events.ts b/packages/types/src/Metadata/v0/Events.ts index dc4a517438..c23bf30ba3 100644 --- a/packages/types/src/Metadata/v0/Events.ts +++ b/packages/types/src/Metadata/v0/Events.ts @@ -31,6 +31,14 @@ export class EventMetadata extends Struct { return this.get('documentation') as Vector; } + /** + * @description The [[Text]] documentation + * @deprecated Use `.documentation` instead. + */ + get docs (): Vector { + return this.documentation; + } + /** * @description The name for the event */ diff --git a/packages/types/src/Metadata/v0/Metadata.spec.ts b/packages/types/src/Metadata/v0/Metadata.spec.ts index 2a4c693010..d57dbb4022 100644 --- a/packages/types/src/Metadata/v0/Metadata.spec.ts +++ b/packages/types/src/Metadata/v0/Metadata.spec.ts @@ -33,7 +33,7 @@ describe('Metadata', () => { mod.storage.unwrap().functions.forEach((fn) => { it(`creates default types for ${mod.prefix}.${fn.name}, type ${fn.type}`, () => { expect( - () => createType(fn.type.toString(), fn.default) + () => createType(fn.type.toString(), fn.fallback) ).not.toThrow(); }); }); diff --git a/packages/types/src/Metadata/v0/Modules.ts b/packages/types/src/Metadata/v0/Modules.ts index f5a73ac5fd..9781768226 100644 --- a/packages/types/src/Metadata/v0/Modules.ts +++ b/packages/types/src/Metadata/v0/Modules.ts @@ -2,18 +2,15 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import { AnyNumber } from '../../types'; - -import Enum from '../../codec/Enum'; -import EnumType from '../../codec/EnumType'; import Option from '../../codec/Option'; import Struct from '../../codec/Struct'; import Vector from '../../codec/Vector'; -import Bytes from '../../primitive/Bytes'; import Text from '../../primitive/Text'; import Type from '../../primitive/Type'; import U16 from '../../primitive/U16'; +import { StorageMetadata } from './Storage'; + export class FunctionArgumentMetadata extends Struct { constructor (value?: any) { super({ @@ -61,6 +58,14 @@ export class FunctionMetadata extends Struct { return this.get('documentation') as Vector; } + /** + * @description The [[Text]] documentation + * @deprecated Use `.documentation` instead. + */ + get docs (): Vector { + return this.documentation; + } + /** * @description The `[sectionIndex, methodIndex]` call id */ @@ -122,237 +127,6 @@ export class ModuleMetadata extends Struct { } } -export class StorageFunctionModifier extends Enum { - constructor (value?: any) { - super(['Optional', 'Default', 'Required'], value); - } - - /** - * @description `true` if the storage entry is optional - */ - get isOptional (): boolean { - return this.toNumber() === 0; - } -} - -export class DoubleMapType extends Struct { - constructor (value?: any) { - super({ - key1: Text, - key2: Text, - value: Text, - keyHasher: Text - }, value); - } - - /** - * @description The mapped key as [[Text]] - */ - get key1 (): Text { - return this.get('key1') as Text; - } - - /** - * @description The mapped key as [[Text]] - */ - get key2 (): Text { - return this.get('key2') as Text; - } - - /** - * @description The mapped key as [[Text]] - */ - get keyHasher (): Text { - return this.get('keyHasher') as Text; - } - - /** - * @description The mapped key as [[Text]] - */ - get value (): Text { - return this.get('value') as Text; - } -} - -export class MapType extends Struct { - private _isLinked = false; - - constructor (value?: any) { - super({ - key: Type, - value: Type - }, value); - - if (value && value.isLinked) { - this._isLinked = true; - } - } - - /** - * @description The mapped key as [[Type]] - */ - get key (): Type { - return this.get('key') as Type; - } - - /** - * @description The mapped value as [[Type]] - */ - get value (): Type { - return this.get('value') as Type; - } - - /** - * @description Is this an enumerable linked map - */ - get isLinked (): boolean { - return this._isLinked; - } -} - -class PlainType extends Type { -} - -export class StorageFunctionType extends EnumType { - constructor (value?: any, index?: number) { - super({ - PlainType, - MapType, - DoubleMapType - }, value, index); - } - - /** - * @description `true` if the storage entry is a doublemap - */ - get isDoubleMap (): boolean { - return this.toNumber() === 2; - } - - /** - * @description `true` if the storage entry is a map - */ - get isMap (): boolean { - return this.toNumber() === 1; - } - - /** - * @description The value as a mapped value - */ - get asDoubleMap (): DoubleMapType { - return this.value as DoubleMapType; - } - - /** - * @description The value as a mapped value - */ - get asMap (): MapType { - return this.value as MapType; - } - - /** - * @description The value as a [[Type]] value - */ - get asType (): PlainType { - return this.value as PlainType; - } - - /** - * @description Returns the string representation of the value - */ - toString (): string { - if (this.isDoubleMap) { - return this.asDoubleMap.value.toString(); - } - - if (this.isMap) { - if (this.asMap.isLinked) { - return `(${this.asMap.value.toString()}, Linkage<${this.asMap.key.toString()}>)`; - } - return this.asMap.value.toString(); - } - return this.asType.toString(); - } -} - -type StorageFunctionMetadataValue = { - name: string | Text, - modifier: StorageFunctionModifier | AnyNumber, - type: StorageFunctionType, - default: Bytes, - documentation: Vector | Array -}; - -export class StorageFunctionMetadata extends Struct { - constructor (value?: StorageFunctionMetadataValue | Uint8Array) { - super({ - name: Text, - modifier: StorageFunctionModifier, - type: StorageFunctionType, - default: Bytes, - documentation: Vector.with(Text) - }, value); - } - - /** - * @description The default value of the storage function - */ - get default (): Bytes { - return this.get('default') as Bytes; - } - - /** - * @description The [[Text]] documentation - */ - get documentation (): Vector { - return this.get('documentation') as Vector; - } - - /** - * @description The key name - */ - get name (): Text { - return this.get('name') as Text; - } - - /** - * @description The modifier - */ - get modifier (): StorageFunctionModifier { - return this.get('modifier') as StorageFunctionModifier; - } - - /** - * @description The [[StorageFunctionType]] - */ - get type (): StorageFunctionType { - return this.get('type') as StorageFunctionType; - } -} - -export class StorageMetadata extends Struct { - constructor (value?: any) { - super({ - prefix: Text, - functions: Vector.with(StorageFunctionMetadata) - }, value); - } - - /** - * @description The [[StorageFunctionMetadata]] for the section - */ - get functions (): Vector { - return this.get('functions') as Vector; - } - - /** - * @description The section prefix - */ - get prefix (): Text { - return this.get('prefix') as Text; - } -} - export class RuntimeModuleMetadata extends Struct { constructor (value?: any) { super({ diff --git a/packages/types/src/Metadata/v0/Storage.ts b/packages/types/src/Metadata/v0/Storage.ts new file mode 100644 index 0000000000..e0803942cc --- /dev/null +++ b/packages/types/src/Metadata/v0/Storage.ts @@ -0,0 +1,207 @@ +// Copyright 2017-2019 @polkadot/types authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import { AnyNumber } from '../../types'; + +import Enum from '../../codec/Enum'; +import EnumType from '../../codec/EnumType'; +import Struct from '../../codec/Struct'; +import Vector from '../../codec/Vector'; +import Bytes from '../../primitive/Bytes'; +import Text from '../../primitive/Text'; +import Type from '../../primitive/Type'; + +export class StorageFunctionModifier extends Enum { + constructor (value?: any) { + super(['Optional', 'Default', 'Required'], value); + } + + /** + * @description `true` if the storage entry is optional + */ + get isOptional (): boolean { + return this.toNumber() === 0; + } + + toJSON (): any { + // This looks prettier in the generated JSON + return this.toString(); + } +} + +export class MapType extends Struct { + private _isLinked = false; + + constructor (value?: any) { + super({ + key: Type, + value: Type + }, value); + + if (value && value.isLinked) { + this._isLinked = true; + } + } + + /** + * @description The mapped key as [[Type]] + */ + get key (): Type { + return this.get('key') as Type; + } + + /** + * @description The mapped value as [[Type]] + */ + get value (): Type { + return this.get('value') as Type; + } + + /** + * @description Is this an enumerable linked map + */ + get isLinked (): boolean { + return this._isLinked; + } +} + +export class PlainType extends Type { +} + +export class StorageFunctionType extends EnumType { + constructor (value?: any, index?: number) { + super({ + PlainType, + MapType + }, value, index); + } + + /** + * @description `true` if the storage entry is a map + */ + get isMap (): boolean { + return this.toNumber() === 1; + } + + /** + * @description The value as a mapped value + */ + get asMap (): MapType { + return this.value as MapType; + } + + /** + * @description The value as a [[Type]] value + */ + get asType (): PlainType { + return this.value as PlainType; + } + + /** + * @description Returns the string representation of the value + */ + toString (): string { + if (this.isMap) { + if (this.asMap.isLinked) { + return `(${this.asMap.value.toString()}, Linkage<${this.asMap.key.toString()}>)`; + } + return this.asMap.value.toString(); + } + return this.asType.toString(); + } +} + +export type StorageFunctionMetadataValue = { + name: string | Text, + modifier: StorageFunctionModifier | AnyNumber, + type: StorageFunctionType, + fallback: Bytes, + documentation: Vector | Array +}; + +export class StorageFunctionMetadata extends Struct { + constructor (value?: StorageFunctionMetadataValue | Uint8Array) { + super({ + name: Text, + modifier: StorageFunctionModifier, + type: StorageFunctionType, + fallback: Bytes, + documentation: Vector.with(Text) + }, value); + } + + /** + * @description The default value of the storage function + * @deprecated Use `.fallback` instead. + */ + get default (): Bytes { + return this.fallback; + } + + /** + * @description The default value of the storage function + */ + get fallback (): Bytes { + return this.get('fallback') as Bytes; + } + + /** + * @description The [[Text]] documentation + */ + get documentation (): Vector { + return this.get('documentation') as Vector; + } + + /** + * @description The [[Text]] documentation + * @deprecated Use `.documentation` instead. + */ + get docs (): Vector { + return this.documentation; + } + + /** + * @description The key name + */ + get name (): Text { + return this.get('name') as Text; + } + + /** + * @description The modifier + */ + get modifier (): StorageFunctionModifier { + return this.get('modifier') as StorageFunctionModifier; + } + + /** + * @description The [[StorageFunctionType]] + */ + get type (): StorageFunctionType { + return this.get('type') as StorageFunctionType; + } +} + +export class StorageMetadata extends Struct { + constructor (value?: any) { + super({ + prefix: Text, + functions: Vector.with(StorageFunctionMetadata) + }, value); + } + + /** + * @description The [[StorageFunctionMetadata]] for the section + */ + get functions (): Vector { + return this.get('functions') as Vector; + } + + /** + * @description The section prefix + */ + get prefix (): Text { + return this.get('prefix') as Text; + } +} diff --git a/packages/types/src/Metadata/v0/latest.substrate.json b/packages/types/src/Metadata/v0/latest.substrate.json index 1a68c40d24..b2e677ee13 100644 --- a/packages/types/src/Metadata/v0/latest.substrate.json +++ b/packages/types/src/Metadata/v0/latest.substrate.json @@ -438,103 +438,103 @@ "functions": [ { "name": "AccountNonce", - "modifier": 1, + "modifier": "Default", "type": { "MapType": { "key": "AccountId", "value": "Index" } }, - "default": "0x0000000000000000", + "fallback": "0x0000000000000000", "documentation": [] }, { "name": "ExtrinsicCount", - "modifier": 0, + "modifier": "Optional", "type": { "PlainType": "u32" }, - "default": "0x00", + "fallback": "0x00", "documentation": [] }, { "name": "BlockHash", - "modifier": 1, + "modifier": "Default", "type": { "MapType": { "key": "BlockNumber", "value": "Hash" } }, - "default": "0x0000000000000000000000000000000000000000000000000000000000000000", + "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", "documentation": [] }, { "name": "ExtrinsicData", - "modifier": 1, + "modifier": "Default", "type": { "MapType": { "key": "u32", "value": "Bytes" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [] }, { "name": "RandomSeed", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Hash" }, - "default": "0x0000000000000000000000000000000000000000000000000000000000000000", + "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", "documentation": [] }, { "name": "Number", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "BlockNumber" }, - "default": "0x0000000000000000", + "fallback": "0x0000000000000000", "documentation": [ " The current block number being processed. Set by `execute_block`." ] }, { "name": "ParentHash", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Hash" }, - "default": "0x0000000000000000000000000000000000000000000000000000000000000000", + "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", "documentation": [] }, { "name": "ExtrinsicsRoot", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Hash" }, - "default": "0x0000000000000000000000000000000000000000000000000000000000000000", + "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", "documentation": [] }, { "name": "Digest", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Digest" }, - "default": "0x00", + "fallback": "0x00", "documentation": [] }, { "name": "Events", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Vec" }, - "default": "0x00", + "fallback": "0x00", "documentation": [] } ] @@ -586,33 +586,33 @@ "functions": [ { "name": "Now", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Moment" }, - "default": "0x0000000000000000", + "fallback": "0x0000000000000000", "documentation": [ " Current time for the current block." ] }, { "name": "BlockPeriod", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Moment" }, - "default": "0x0500000000000000", + "fallback": "0x0500000000000000", "documentation": [ " The minimum (and advised) period between blocks." ] }, { "name": "DidUpdate", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "bool" }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " Did the timestamp get updated in this block?" ] @@ -713,11 +713,11 @@ "functions": [ { "name": "OriginalAuthorities", - "modifier": 0, + "modifier": "Optional", "type": { "PlainType": "Vec" }, - "default": "0x00", + "fallback": "0x00", "documentation": [] } ] @@ -737,25 +737,25 @@ "functions": [ { "name": "NextEnumSet", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "AccountIndex" }, - "default": "0x00000000", + "fallback": "0x00000000", "documentation": [ " The next free enumeration set." ] }, { "name": "EnumSet", - "modifier": 1, + "modifier": "Default", "type": { "MapType": { "key": "AccountIndex", "value": "Vec" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " The enumeration sets." ] @@ -816,58 +816,58 @@ "functions": [ { "name": "TotalIssuance", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Balance" }, - "default": "0x00000000000000000000000000000000", + "fallback": "0x00000000000000000000000000000000", "documentation": [ " The total amount of stake on the system." ] }, { "name": "ExistentialDeposit", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Balance" }, - "default": "0x00000000000000000000000000000000", + "fallback": "0x00000000000000000000000000000000", "documentation": [ " The minimum amount allowed to keep an account open." ] }, { "name": "TransferFee", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Balance" }, - "default": "0x00000000000000000000000000000000", + "fallback": "0x00000000000000000000000000000000", "documentation": [ " The fee required to make a transfer." ] }, { "name": "CreationFee", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Balance" }, - "default": "0x00000000000000000000000000000000", + "fallback": "0x00000000000000000000000000000000", "documentation": [ " The fee required to create an account. At least as big as ReclaimRebate." ] }, { "name": "FreeBalance", - "modifier": 1, + "modifier": "Default", "type": { "MapType": { "key": "AccountId", "value": "Balance" } }, - "default": "0x00000000000000000000000000000000", + "fallback": "0x00000000000000000000000000000000", "documentation": [ " The 'free' balance of a given account.", "", @@ -884,14 +884,14 @@ }, { "name": "ReservedBalance", - "modifier": 1, + "modifier": "Default", "type": { "MapType": { "key": "AccountId", "value": "Balance" } }, - "default": "0x00000000000000000000000000000000", + "fallback": "0x00000000000000000000000000000000", "documentation": [ " The amount of the balance of a given account that is externally reserved; this can still get", " slashed, but gets slashed last of all.", @@ -909,22 +909,22 @@ }, { "name": "TransactionBaseFee", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Balance" }, - "default": "0x00000000000000000000000000000000", + "fallback": "0x00000000000000000000000000000000", "documentation": [ " The fee to be paid for making a transaction; the base." ] }, { "name": "TransactionByteFee", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Balance" }, - "default": "0x00000000000000000000000000000000", + "fallback": "0x00000000000000000000000000000000", "documentation": [ " The fee to be paid for making a transaction; the per-byte portion." ] @@ -987,55 +987,55 @@ "functions": [ { "name": "Validators", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Vec" }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " The current set of validators." ] }, { "name": "SessionLength", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "BlockNumber" }, - "default": "0xe803000000000000", + "fallback": "0xe803000000000000", "documentation": [ " Current length of the session." ] }, { "name": "CurrentIndex", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "BlockNumber" }, - "default": "0x0000000000000000", + "fallback": "0x0000000000000000", "documentation": [ " Current index of the session." ] }, { "name": "CurrentStart", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Moment" }, - "default": "0x0000000000000000", + "fallback": "0x0000000000000000", "documentation": [ " Timestamp when current session started." ] }, { "name": "ForcingNewSession", - "modifier": 0, + "modifier": "Optional", "type": { "PlainType": "bool" }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " New session is being forced is this entry exists; in which case, the boolean value is whether", " the new session should be considered a normal rotation (rewardable) or exceptional (slashable)." @@ -1043,36 +1043,36 @@ }, { "name": "LastLengthChange", - "modifier": 0, + "modifier": "Optional", "type": { "PlainType": "BlockNumber" }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " Block at which the session length last changed." ] }, { "name": "NextKeyFor", - "modifier": 0, + "modifier": "Optional", "type": { "MapType": { "key": "AccountId", "value": "SessionKey" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " The next key for a given validator." ] }, { "name": "NextSessionLength", - "modifier": 0, + "modifier": "Optional", "type": { "PlainType": "BlockNumber" }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " The next session length." ] @@ -1243,88 +1243,88 @@ "functions": [ { "name": "ValidatorCount", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "u32" }, - "default": "0x00000000", + "fallback": "0x00000000", "documentation": [ " The ideal number of staking participants." ] }, { "name": "MinimumValidatorCount", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "u32" }, - "default": "0x04000000", + "fallback": "0x04000000", "documentation": [ " Minimum number of staking participants before emergency conditions are imposed." ] }, { "name": "SessionsPerEra", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "BlockNumber" }, - "default": "0xe803000000000000", + "fallback": "0xe803000000000000", "documentation": [ " The length of a staking era in sessions." ] }, { "name": "SessionReward", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Perbill" }, - "default": "0x3c000000", + "fallback": "0x3c000000", "documentation": [ " Maximum reward, per validator, that is provided per acceptable session." ] }, { "name": "OfflineSlash", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Perbill" }, - "default": "0x40420f00", + "fallback": "0x40420f00", "documentation": [ " Slash, per validator that is taken for the first time they are found to be offline." ] }, { "name": "OfflineSlashGrace", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "u32" }, - "default": "0x00000000", + "fallback": "0x00000000", "documentation": [ " Number of instances of offline reports before slashing begins for validators." ] }, { "name": "BondingDuration", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "BlockNumber" }, - "default": "0xe803000000000000", + "fallback": "0xe803000000000000", "documentation": [ " The length of the bonding duration in blocks." ] }, { "name": "Invulerables", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Vec" }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " Any validators that may never be slashed or forcible kicked. It's a Vec since they're easy to initialise", " and the performance hit is minimal (we expect no more than four invulnerables) and restricted to testnets." @@ -1332,172 +1332,172 @@ }, { "name": "CurrentEra", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "BlockNumber" }, - "default": "0x0000000000000000", + "fallback": "0x0000000000000000", "documentation": [ " The current era index." ] }, { "name": "ValidatorPreferences", - "modifier": 1, + "modifier": "Default", "type": { "MapType": { "key": "AccountId", "value": "ValidatorPrefs" } }, - "default": "0x0c00", + "fallback": "0x0c00", "documentation": [ " Preferences that a validator has." ] }, { "name": "Intentions", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Vec" }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " All the accounts with a desire to stake." ] }, { "name": "Nominating", - "modifier": 0, + "modifier": "Optional", "type": { "MapType": { "key": "AccountId", "value": "AccountId" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " All nominator -> nominee relationships." ] }, { "name": "NominatorsFor", - "modifier": 1, + "modifier": "Default", "type": { "MapType": { "key": "AccountId", "value": "Vec" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " Nominators for a particular account." ] }, { "name": "CurrentNominatorsFor", - "modifier": 1, + "modifier": "Default", "type": { "MapType": { "key": "AccountId", "value": "Vec" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " Nominators for a particular account that is in action right now." ] }, { "name": "CurrentSessionReward", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Balance" }, - "default": "0x00000000000000000000000000000000", + "fallback": "0x00000000000000000000000000000000", "documentation": [ " Maximum reward, per validator, that is provided per acceptable session." ] }, { "name": "CurrentOfflineSlash", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Balance" }, - "default": "0x00000000000000000000000000000000", + "fallback": "0x00000000000000000000000000000000", "documentation": [ " Slash, per validator that is taken for the first time they are found to be offline." ] }, { "name": "NextSessionsPerEra", - "modifier": 0, + "modifier": "Optional", "type": { "PlainType": "BlockNumber" }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " The next value of sessions per era." ] }, { "name": "LastEraLengthChange", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "BlockNumber" }, - "default": "0x0000000000000000", + "fallback": "0x0000000000000000", "documentation": [ " The session index at which the era length last changed." ] }, { "name": "StakeRange", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "(Balance,Balance)" }, - "default": "0x0000000000000000000000000000000000000000000000000000000000000000", + "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", "documentation": [ " The highest and lowest staked validator slashable balances." ] }, { "name": "Bondage", - "modifier": 1, + "modifier": "Default", "type": { "MapType": { "key": "AccountId", "value": "BlockNumber" } }, - "default": "0x0000000000000000", + "fallback": "0x0000000000000000", "documentation": [ " The block at which the `who`'s funds become entirely liquid." ] }, { "name": "SlashCount", - "modifier": 1, + "modifier": "Default", "type": { "MapType": { "key": "AccountId", "value": "u32" } }, - "default": "0x00000000", + "fallback": "0x00000000", "documentation": [ " The number of times a given validator has been reported offline. This gets decremented by one each era that passes." ] }, { "name": "ForcingNewEra", - "modifier": 0, + "modifier": "Optional", "type": { "PlainType": "Null" }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " We are forcing a new era." ] @@ -1619,183 +1619,183 @@ "functions": [ { "name": "PublicPropCount", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "PropIndex" }, - "default": "0x00000000", + "fallback": "0x00000000", "documentation": [ " The number of (public) proposals that have been made so far." ] }, { "name": "PublicProps", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Vec<(PropIndex,Proposal,AccountId)>" }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " The public proposals. Unsorted." ] }, { "name": "DepositOf", - "modifier": 0, + "modifier": "Optional", "type": { "MapType": { "key": "PropIndex", "value": "(Balance,Vec)" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " Those who have locked a deposit." ] }, { "name": "LaunchPeriod", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "BlockNumber" }, - "default": "0xe803000000000000", + "fallback": "0xe803000000000000", "documentation": [ " How often (in blocks) new public referenda are launched." ] }, { "name": "MinimumDeposit", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Balance" }, - "default": "0x00000000000000000000000000000000", + "fallback": "0x00000000000000000000000000000000", "documentation": [ " The minimum amount to be used as a deposit for a public referendum proposal." ] }, { "name": "PublicDelay", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "BlockNumber" }, - "default": "0x0000000000000000", + "fallback": "0x0000000000000000", "documentation": [ " The delay before enactment for all public referenda." ] }, { "name": "MaxLockPeriods", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "LockPeriods" }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " The maximum number of additional lock periods a voter may offer to strengthen their vote. Multiples of `PublicDelay`." ] }, { "name": "VotingPeriod", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "BlockNumber" }, - "default": "0xe803000000000000", + "fallback": "0xe803000000000000", "documentation": [ " How often (in blocks) to check for new votes." ] }, { "name": "ReferendumCount", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "ReferendumIndex" }, - "default": "0x00000000", + "fallback": "0x00000000", "documentation": [ " The next free referendum index, aka the number of referendums started so far." ] }, { "name": "NextTally", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "ReferendumIndex" }, - "default": "0x00000000", + "fallback": "0x00000000", "documentation": [ " The next referendum index that should be tallied." ] }, { "name": "ReferendumInfoOf", - "modifier": 0, + "modifier": "Optional", "type": { "MapType": { "key": "ReferendumIndex", "value": "ReferendumInfo" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " Information concerning any given referendum." ] }, { "name": "DispatchQueue", - "modifier": 1, + "modifier": "Default", "type": { "MapType": { "key": "BlockNumber", "value": "Vec>" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " Queue of successful referenda to be dispatched." ] }, { "name": "Bondage", - "modifier": 1, + "modifier": "Default", "type": { "MapType": { "key": "AccountId", "value": "BlockNumber" } }, - "default": "0x0000000000000000", + "fallback": "0x0000000000000000", "documentation": [ " The block at which the `who`'s funds become liquid." ] }, { "name": "VotersFor", - "modifier": 1, + "modifier": "Default", "type": { "MapType": { "key": "ReferendumIndex", "value": "Vec" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " Get the voters for the current proposal." ] }, { "name": "VoteOf", - "modifier": 1, + "modifier": "Default", "type": { "MapType": { "key": "(ReferendumIndex,AccountId)", "value": "Vote" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " Get the vote in a given referendum of a particular voter. The result is meaningful only if `voters_for` includes the", " voter when called with the referendum (you'll get the default `Vote` value otherwise). If you don't want to check", @@ -1976,66 +1976,66 @@ "functions": [ { "name": "CandidacyBond", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Balance" }, - "default": "0x09000000000000000000000000000000", + "fallback": "0x09000000000000000000000000000000", "documentation": [ " How much should be locked up in order to submit one's candidacy." ] }, { "name": "VotingBond", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Balance" }, - "default": "0x00000000000000000000000000000000", + "fallback": "0x00000000000000000000000000000000", "documentation": [ " How much should be locked up in order to be able to submit votes." ] }, { "name": "PresentSlashPerVoter", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Balance" }, - "default": "0x01000000000000000000000000000000", + "fallback": "0x01000000000000000000000000000000", "documentation": [ " The punishment, per voter, if you provide an invalid presentation." ] }, { "name": "CarryCount", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "u32" }, - "default": "0x02000000", + "fallback": "0x02000000", "documentation": [ " How many runners-up should have their approvals persist until the next vote." ] }, { "name": "PresentationDuration", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "BlockNumber" }, - "default": "0xe803000000000000", + "fallback": "0xe803000000000000", "documentation": [ " How long to give each top candidate to present themselves after the vote ends." ] }, { "name": "InactiveGracePeriod", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "VoteIndex" }, - "default": "0x01000000", + "fallback": "0x01000000", "documentation": [ " How many vote indexes need to go by after a target voter's last vote before they can be reaped if their", " approvals are moot." @@ -2043,44 +2043,44 @@ }, { "name": "VotingPeriod", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "BlockNumber" }, - "default": "0xe803000000000000", + "fallback": "0xe803000000000000", "documentation": [ " How often (in blocks) to check for new votes." ] }, { "name": "TermDuration", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "BlockNumber" }, - "default": "0x0500000000000000", + "fallback": "0x0500000000000000", "documentation": [ " How long each position is active for." ] }, { "name": "DesiredSeats", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "u32" }, - "default": "0x00000000", + "fallback": "0x00000000", "documentation": [ " Number of accounts that should be sitting on the council." ] }, { "name": "ActiveCouncil", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Vec<(AccountId,BlockNumber)>" }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " The current council. When there's a vote going on, this should still be used for executive", " matters. The block number (second element in the tuple) is the block that their position is", @@ -2090,25 +2090,25 @@ }, { "name": "VoteCount", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "VoteIndex" }, - "default": "0x00000000", + "fallback": "0x00000000", "documentation": [ " The total number of votes that have happened or are in progress." ] }, { "name": "ApprovalsOf", - "modifier": 1, + "modifier": "Default", "type": { "MapType": { "key": "AccountId", "value": "Vec" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " A list of votes for each voter, respecting the last cleared vote index that this voter was", " last active at." @@ -2116,14 +2116,14 @@ }, { "name": "RegisterInfoOf", - "modifier": 0, + "modifier": "Optional", "type": { "MapType": { "key": "AccountId", "value": "(VoteIndex,u32)" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " The vote index and list slot that the candidate `who` was registered or `None` if they are not", " currently registered." @@ -2131,78 +2131,78 @@ }, { "name": "LastActiveOf", - "modifier": 0, + "modifier": "Optional", "type": { "MapType": { "key": "AccountId", "value": "VoteIndex" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " The last cleared vote index that this voter was last active at." ] }, { "name": "Voters", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Vec" }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " The present voter list." ] }, { "name": "Candidates", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Vec" }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " The present candidate list." ] }, { "name": "CandidateCount", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "u32" }, - "default": "0x00000000", + "fallback": "0x00000000", "documentation": [] }, { "name": "NextFinalise", - "modifier": 0, + "modifier": "Optional", "type": { "PlainType": "(BlockNumber,u32,Vec)" }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " The accounts holding the seats that will become free on the next tally." ] }, { "name": "SnapshotedStakes", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Vec" }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " The stakes as they were at the point that the vote ended." ] }, { "name": "Leaderboard", - "modifier": 0, + "modifier": "Optional", "type": { "PlainType": "Vec<(Balance,AccountId)>" }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " Get the leaderboard if we;re in the presentation phase." ] @@ -2284,88 +2284,88 @@ "functions": [ { "name": "CooloffPeriod", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "BlockNumber" }, - "default": "0xe803000000000000", + "fallback": "0xe803000000000000", "documentation": [] }, { "name": "VotingPeriod", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "BlockNumber" }, - "default": "0x0300000000000000", + "fallback": "0x0300000000000000", "documentation": [] }, { "name": "EnactDelayPeriod", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "BlockNumber" }, - "default": "0x0000000000000000", + "fallback": "0x0000000000000000", "documentation": [ " Number of blocks by which to delay enactment of successful, non-unanimous-council-instigated referendum proposals." ] }, { "name": "Proposals", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Vec<(BlockNumber,Hash)>" }, - "default": "0x00", + "fallback": "0x00", "documentation": [] }, { "name": "ProposalOf", - "modifier": 0, + "modifier": "Optional", "type": { "MapType": { "key": "Hash", "value": "Proposal" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [] }, { "name": "ProposalVoters", - "modifier": 1, + "modifier": "Default", "type": { "MapType": { "key": "Hash", "value": "Vec" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [] }, { "name": "CouncilVoteOf", - "modifier": 0, + "modifier": "Optional", "type": { "MapType": { "key": "(Hash,AccountId)", "value": "bool" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [] }, { "name": "VetoedProposal", - "modifier": 0, + "modifier": "Optional", "type": { "MapType": { "key": "Hash", "value": "(BlockNumber,Vec)" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [] } ] @@ -2420,50 +2420,50 @@ "functions": [ { "name": "Proposals", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Vec" }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " The (hashes of) the active proposals." ] }, { "name": "ProposalOf", - "modifier": 0, + "modifier": "Optional", "type": { "MapType": { "key": "Hash", "value": "Proposal" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " Actual proposal for a given hash, if it's current." ] }, { "name": "Voting", - "modifier": 0, + "modifier": "Optional", "type": { "MapType": { "key": "Hash", "value": "(ProposalIndex,u32,Vec,Vec)" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " Votes for a given proposal: (required_yes_votes, yes_voters, no_voters)." ] }, { "name": "ProposalCount", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "u32" }, - "default": "0x00000000", + "fallback": "0x00000000", "documentation": [ " Proposals so far." ] @@ -2499,11 +2499,11 @@ "functions": [ { "name": "PendingChange", - "modifier": 0, + "modifier": "Optional", "type": { "PlainType": "StoredPendingChange" }, - "default": "0x00", + "fallback": "0x00", "documentation": [] } ] @@ -2608,11 +2608,11 @@ "functions": [ { "name": "ProposalBond", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Permill" }, - "default": "0x00000000", + "fallback": "0x00000000", "documentation": [ " Proportion of funds that should be bonded in order to place a proposal. An accepted", " proposal gets these back. A rejected proposal doesn't." @@ -2620,80 +2620,80 @@ }, { "name": "ProposalBondMinimum", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Balance" }, - "default": "0x00000000000000000000000000000000", + "fallback": "0x00000000000000000000000000000000", "documentation": [ " Minimum amount of funds that should be placed in a deposit for making a proposal." ] }, { "name": "SpendPeriod", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "BlockNumber" }, - "default": "0x0100000000000000", + "fallback": "0x0100000000000000", "documentation": [ " Period between successive spends." ] }, { "name": "Burn", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Permill" }, - "default": "0x00000000", + "fallback": "0x00000000", "documentation": [ " Percentage of spare funds (if any) that are burnt per spend period." ] }, { "name": "Pot", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Balance" }, - "default": "0x00000000000000000000000000000000", + "fallback": "0x00000000000000000000000000000000", "documentation": [ " Total funds available to this module for spending." ] }, { "name": "ProposalCount", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "ProposalIndex" }, - "default": "0x00000000", + "fallback": "0x00000000", "documentation": [ " Number of proposals that have been made." ] }, { "name": "Proposals", - "modifier": 0, + "modifier": "Optional", "type": { "MapType": { "key": "ProposalIndex", "value": "Proposal" } }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " Proposals that have been made." ] }, { "name": "Approvals", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "Vec" }, - "default": "0x00", + "fallback": "0x00", "documentation": [ " Proposal indices that have been approved but not yet awarded." ] @@ -2809,11 +2809,11 @@ "functions": [ { "name": "Key", - "modifier": 1, + "modifier": "Default", "type": { "PlainType": "AccountId" }, - "default": "0x0000000000000000000000000000000000000000000000000000000000000000", + "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", "documentation": [] } ] diff --git a/packages/types/src/Metadata/v1/Calls.ts b/packages/types/src/Metadata/v1/Calls.ts index b45e39359c..de33dc1537 100644 --- a/packages/types/src/Metadata/v1/Calls.ts +++ b/packages/types/src/Metadata/v1/Calls.ts @@ -43,7 +43,7 @@ export class MetadataCall extends Struct { // id: u16, name: Text, args: Vector.with(MetadataCallArg), - docs: Vector.with(Text) + documentation: Vector.with(Text) }, value); } @@ -57,8 +57,16 @@ export class MetadataCall extends Struct { /** * @description The [[Text]] documentation */ + get documentation (): Vector { + return this.get('documentation') as Vector; + } + + /** + * @description The [[Text]] documentation + * @deprecated Use `.documentation` instead. + */ get docs (): Vector { - return this.get('docs') as Vector; + return this.documentation; } // /** diff --git a/packages/types/src/Metadata/v1/Events.ts b/packages/types/src/Metadata/v1/Events.ts index 946252b21b..ebdf28d0f2 100644 --- a/packages/types/src/Metadata/v1/Events.ts +++ b/packages/types/src/Metadata/v1/Events.ts @@ -17,7 +17,7 @@ export class MetadataEvent extends Struct { super({ name: Text, args: Vector.with(Type), - docs: Vector.with(Text) + documentation: Vector.with(Text) }, value); } @@ -31,8 +31,16 @@ export class MetadataEvent extends Struct { /** * @description The [[Text]] documentation */ + get documentation (): Vector { + return this.get('documentation') as Vector; + } + + /** + * @description The [[Text]] documentation + * @deprecated Use `.documentation` instead. + */ get docs (): Vector { - return this.get('docs') as Vector; + return this.documentation; } /** diff --git a/packages/types/src/Metadata/v1/Metadata.ts b/packages/types/src/Metadata/v1/Metadata.ts index a575e46def..6e8c8d5c94 100644 --- a/packages/types/src/Metadata/v1/Metadata.ts +++ b/packages/types/src/Metadata/v1/Metadata.ts @@ -12,7 +12,7 @@ import { flattenUniq, validateTypes } from '../util'; import { MetadataCall } from './Calls'; import { MetadataEvent } from './Events'; -import { MetadataStorage } from './Storage'; +import { StorageFunctionMetadata } from './Storage'; /** * @name MetadataModule @@ -24,7 +24,7 @@ export class MetadataModule extends Struct { super({ name: Text, prefix: Text, - storage: Option.with(Vector.with(MetadataStorage)), + storage: Option.with(Vector.with(StorageFunctionMetadata)), calls: Option.with(Vector.with(MetadataCall)), events: Option.with(Vector.with(MetadataEvent)) }, value); @@ -61,8 +61,8 @@ export class MetadataModule extends Struct { /** * @description the associated module storage */ - get storage (): Option> { - return this.get('storage') as Option>; + get storage (): Option> { + return this.get('storage') as Option>; } } diff --git a/packages/types/src/Metadata/v1/Storage.ts b/packages/types/src/Metadata/v1/Storage.ts index 73071f8347..ee71d6eacf 100644 --- a/packages/types/src/Metadata/v1/Storage.ts +++ b/packages/types/src/Metadata/v1/Storage.ts @@ -2,184 +2,19 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. -import EnumType from '../../codec/EnumType'; -import Struct from '../../codec/Struct'; -import Vector from '../../codec/Vector'; -import Bytes from '../../primitive/Bytes'; -import Null from '../../primitive/Null'; -import Text from '../../primitive/Text'; -import Type from '../../primitive/Type'; -import { DoubleMapType } from '../v0/Modules'; +import { + MapType, + PlainType, + StorageFunctionModifier, + StorageFunctionType, + StorageFunctionMetadata +} from '../v0/Storage'; -export class Default extends Null {} - -export class Optional extends Null {} - -export class MetadataStorageModifier extends EnumType { - constructor (value?: any, index?: number) { - super({ - Optional, - Default - }, value, index); - } - - /** - * @description `true` if the storage entry is optional - */ - get isOptional (): boolean { - return this.toNumber() === 0; - } - - toJSON (): any { - return this.toString(); - } -} - -export class MapType extends Struct { - private _isLinked = false; - - constructor (value?: any) { - super({ - key: Type, - value: Type - }, value); - - if (value && value.isLinked) { - this._isLinked = true; - } - } - - /** - * @description The mapped key as [[Type]] - */ - get key (): Type { - return this.get('key') as Type; - } - - /** - * @description The mapped value as [[Type]] - */ - get value (): Type { - return this.get('value') as Type; - } - - /** - * @description Is this an enumerable linked map - */ - get isLinked (): boolean { - return this._isLinked; - } -} - -export class PlainType extends Type { -} - -export class MetadataStorageType extends EnumType { - constructor (value?: any, index?: number) { - super({ - PlainType, - MapType, - DoubleMapType - }, value, index); - } - - /** - * @description `true` if the storage entry is a doublemap - */ - get isDoubleMap (): boolean { - return this.toNumber() === 2; - } - - /** - * @description `true` if the storage entry is a map - */ - get isMap (): boolean { - return this.toNumber() === 1; - } - - /** - * @description The value as a mapped value - */ - get asDoubleMap (): DoubleMapType { - return this.value as DoubleMapType; - } - - /** - * @description The value as a mapped value - */ - get asMap (): MapType { - return this.value as MapType; - } - - /** - * @description The value as a [[Type]] value - */ - get asType (): PlainType { - return this.value as PlainType; - } - - /** - * @description Returns the string representation of the value - */ - toString (): string { - if (this.isDoubleMap) { - return this.asDoubleMap.value.toString(); - } - - return this.isMap - ? this.asMap.value.toString() - : this.asType.toString(); - } -} - -/** - * @name MetadataModule - * @description - * The definition of a storage function - */ -export class MetadataStorage extends Struct { - constructor (value?: any) { - super({ - name: Text, - modifier: MetadataStorageModifier, - type: MetadataStorageType, - fallback: Bytes, - docs: Vector.with(Text) - }, value); - } - - /** - * @description The [[Text]] documentation - */ - get docs (): Vector { - return this.get('docs') as Vector; - } - - /** - * @description The [[Bytes]] fallback default - */ - get fallback (): Bytes { - return this.get('fallback') as Bytes; - } - - /** - * @description The [[MetadataArgument]] for arguments - */ - get modifier (): MetadataStorageModifier { - return this.get('modifier') as MetadataStorageModifier; - } - - /** - * @description The call name - */ - get name (): Text { - return this.get('name') as Text; - } - - /** - * @description The [[MetadataStorageType]] - */ - get type (): MetadataStorageType { - return this.get('type') as MetadataStorageType; - } -} +// Re-export classes that haven't changed between V0 and V1 +export { + MapType, + PlainType, + StorageFunctionModifier, + StorageFunctionType, + StorageFunctionMetadata +}; diff --git a/packages/types/src/Metadata/v1/latest.substrate.v1.json b/packages/types/src/Metadata/v1/latest.substrate.v1.json index 299c7e04e5..472ba8bb89 100644 --- a/packages/types/src/Metadata/v1/latest.substrate.v1.json +++ b/packages/types/src/Metadata/v1/latest.substrate.v1.json @@ -17,7 +17,7 @@ } }, "fallback": "0x0000000000000000", - "docs": [] + "documentation": [] }, { "name": "ExtrinsicCount", @@ -26,7 +26,7 @@ "PlainType": "u32" }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "AllExtrinsicsLen", @@ -35,7 +35,7 @@ "PlainType": "u32" }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "BlockHash", @@ -47,7 +47,7 @@ } }, "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", - "docs": [] + "documentation": [] }, { "name": "ExtrinsicData", @@ -59,7 +59,7 @@ } }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "RandomSeed", @@ -68,7 +68,7 @@ "PlainType": "Hash" }, "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", - "docs": [] + "documentation": [] }, { "name": "Number", @@ -77,7 +77,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " The current block number being processed. Set by `execute_block`." ] }, @@ -88,7 +88,7 @@ "PlainType": "Hash" }, "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", - "docs": [] + "documentation": [] }, { "name": "ExtrinsicsRoot", @@ -97,7 +97,7 @@ "PlainType": "Hash" }, "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", - "docs": [] + "documentation": [] }, { "name": "Digest", @@ -106,7 +106,7 @@ "PlainType": "Digest" }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "Events", @@ -115,7 +115,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [] + "documentation": [] } ], "calls": null, @@ -123,14 +123,14 @@ { "name": "ExtrinsicSuccess", "args": [], - "docs": [ + "documentation": [ " An extrinsic completed successfully." ] }, { "name": "ExtrinsicFailed", "args": [], - "docs": [ + "documentation": [ " An extrinsic failed." ] } @@ -154,7 +154,7 @@ "PlainType": "Moment" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " Current time for the current block." ] }, @@ -165,7 +165,7 @@ "PlainType": "Moment" }, "fallback": "0x0500000000000000", - "docs": [ + "documentation": [ " The minimum (and advised) period between blocks." ] }, @@ -176,7 +176,7 @@ "PlainType": "bool" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Did the timestamp get updated in this block?" ] } @@ -190,7 +190,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the current time.", "", " This call should be invoked exactly once per block. It will panic at the finalization phase,", @@ -215,7 +215,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [] + "documentation": [] } ], "calls": [ @@ -227,7 +227,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Report some misbehaviour." ] }, @@ -239,7 +239,7 @@ "type": "InherentOfflineReport" } ], - "docs": [ + "documentation": [ " Note the previous block's validator missed their opportunity to propose a block." ] }, @@ -251,7 +251,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Make some on-chain remark." ] }, @@ -263,7 +263,7 @@ "type": "u64" } ], - "docs": [ + "documentation": [ " Set the number of pages in the WebAssembly environment's heap." ] }, @@ -275,7 +275,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Set the new code." ] }, @@ -287,7 +287,7 @@ "type": "Vec" } ], - "docs": [ + "documentation": [ " Set some items of storage." ] } @@ -305,7 +305,7 @@ "PlainType": "AccountIndex" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The next free enumeration set." ] }, @@ -319,7 +319,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The enumeration sets." ] } @@ -332,7 +332,7 @@ "AccountId", "AccountIndex" ], - "docs": [ + "documentation": [ " A new account index was assigned.", "", " This event is not triggered when an existing index is reassigned", @@ -352,7 +352,7 @@ "PlainType": "Balance" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The total amount of stake on the system." ] }, @@ -363,7 +363,7 @@ "PlainType": "Balance" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The minimum amount allowed to keep an account open." ] }, @@ -374,7 +374,7 @@ "PlainType": "Balance" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The fee required to make a transfer." ] }, @@ -385,7 +385,7 @@ "PlainType": "Balance" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The fee required to create an account. At least as big as ReclaimRebate." ] }, @@ -399,7 +399,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Information regarding the vesting of a given account." ] }, @@ -413,7 +413,7 @@ } }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The 'free' balance of a given account.", "", " This is the only balance that matters in terms of most operations on tokens. It is", @@ -437,7 +437,7 @@ } }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The amount of the balance of a given account that is externally reserved; this can still get", " slashed, but gets slashed last of all.", "", @@ -462,7 +462,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Any liquidity locks on some account balances." ] } @@ -480,7 +480,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Transfer some liquid free balance to another staker." ] }, @@ -500,7 +500,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the balances of a given account." ] } @@ -512,7 +512,7 @@ "AccountId", "Balance" ], - "docs": [ + "documentation": [ " A new account was created." ] }, @@ -521,7 +521,7 @@ "args": [ "AccountId" ], - "docs": [ + "documentation": [ " An account was reaped." ] }, @@ -533,7 +533,7 @@ "Balance", "Balance" ], - "docs": [ + "documentation": [ " Transfer succeeded (from, to, value, fees)." ] } @@ -550,7 +550,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The current set of validators." ] }, @@ -561,7 +561,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " Current length of the session." ] }, @@ -572,7 +572,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " Current index of the session." ] }, @@ -583,7 +583,7 @@ "PlainType": "Moment" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " Timestamp when current session started." ] }, @@ -594,7 +594,7 @@ "PlainType": "bool" }, "fallback": "0x00", - "docs": [ + "documentation": [ " New session is being forced is this entry exists; in which case, the boolean value is whether", " the new session should be considered a normal rotation (rewardable) or exceptional (slashable)." ] @@ -606,7 +606,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Block at which the session length last changed." ] }, @@ -620,7 +620,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The next key for a given validator." ] }, @@ -631,7 +631,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The next session length." ] } @@ -645,7 +645,7 @@ "type": "SessionKey" } ], - "docs": [ + "documentation": [ " Sets the session key of `_validator` to `_key`. This doesn't take effect until the next", " session." ] @@ -658,7 +658,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set a new session length. Won't kick in until the next session change (at current length)." ] }, @@ -670,7 +670,7 @@ "type": "bool" } ], - "docs": [ + "documentation": [ " Forces a new session." ] } @@ -681,7 +681,7 @@ "args": [ "BlockNumber" ], - "docs": [ + "documentation": [ " New session has happened. Note that the argument is the session index, not the block", " number as the type might suggest." ] @@ -699,7 +699,7 @@ "PlainType": "u32" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The ideal number of staking participants." ] }, @@ -710,7 +710,7 @@ "PlainType": "u32" }, "fallback": "0x04000000", - "docs": [ + "documentation": [ " Minimum number of staking participants before emergency conditions are imposed." ] }, @@ -721,7 +721,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " The length of a staking era in sessions." ] }, @@ -732,7 +732,7 @@ "PlainType": "Perbill" }, "fallback": "0x3c000000", - "docs": [ + "documentation": [ " Maximum reward, per validator, that is provided per acceptable session." ] }, @@ -743,7 +743,7 @@ "PlainType": "Perbill" }, "fallback": "0x40420f00", - "docs": [ + "documentation": [ " Slash, per validator that is taken for the first time they are found to be offline." ] }, @@ -754,7 +754,7 @@ "PlainType": "u32" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " Number of instances of offline reports before slashing begins for validators." ] }, @@ -765,7 +765,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " The length of the bonding duration in blocks." ] }, @@ -776,7 +776,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "Invulnerables", @@ -785,7 +785,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Any validators that may never be slashed or forcibly kicked. It's a Vec since they're easy to initialise", " and the performance hit is minimal (we expect no more than four invulnerables) and restricted to testnets." ] @@ -800,7 +800,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Map from all locked \"stash\" accounts to the controller account." ] }, @@ -814,7 +814,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Map from all (unlocked) \"controller\" accounts to the info regarding the staking." ] }, @@ -828,7 +828,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Where the reward payment should be made." ] }, @@ -842,7 +842,7 @@ } }, "fallback": "0x0c00", - "docs": [ + "documentation": [ " The set of keys are all controllers that want to validate.", "", " The values are the preferences that a validator has." @@ -858,7 +858,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The set of keys are all controllers that want to nominate.", "", " The value are the nominations." @@ -874,7 +874,7 @@ } }, "fallback": "0x000000", - "docs": [ + "documentation": [ " Nominators for a particular account that is in action right now. You can't iterate through validators here,", " but you can find them in the `sessions` module." ] @@ -886,7 +886,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " The current era index." ] }, @@ -897,7 +897,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " Maximum reward, per validator, that is provided per acceptable session." ] }, @@ -908,7 +908,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " Slash, per validator that is taken for the first time they are found to be offline." ] }, @@ -919,7 +919,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The accumulated reward for the current era. Reset to zero at the beginning of the era and", " increased for every successfully finished session." ] @@ -931,7 +931,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The next value of sessions per era." ] }, @@ -942,7 +942,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " The session index at which the era length last changed." ] }, @@ -953,7 +953,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The amount of balance actively at stake for each validator slot, currently.", "", " This is used to derive rewards and punishments." @@ -969,7 +969,7 @@ } }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The number of times a given validator has been reported offline. This gets decremented by one each era that passes." ] }, @@ -980,7 +980,7 @@ "PlainType": "Null" }, "fallback": "0x00", - "docs": [ + "documentation": [ " We are forcing a new era." ] }, @@ -991,7 +991,7 @@ "PlainType": "Vec<(AccountId,BlockNumber,u32)>" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Most recent `RECENT_OFFLINE_COUNT` instances. (who it was, when it was reported, how many instances they were offline for)." ] } @@ -1013,7 +1013,7 @@ "type": "RewardDestination" } ], - "docs": [ + "documentation": [ " Take the origin account as a stash and lock up `value` of its balance. `controller` will be the", " account that controls it." ] @@ -1026,7 +1026,7 @@ "type": "BalanceOf" } ], - "docs": [ + "documentation": [ " Add some extra amount that have appeared in the stash `free_balance` into the balance up for", " staking.", "", @@ -1043,7 +1043,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Schedule a portion of the stash to be unlocked ready for transfer out after the bond", " period ends. If this leaves an amount actively bonded less than", " T::Currency::existential_deposit(), then it is increased to the full amount.", @@ -1059,7 +1059,7 @@ { "name": "withdraw_unbonded", "args": [], - "docs": [ + "documentation": [ " Remove any unlocked chunks from the `unlocking` queue from our management.", "", " This essentially frees up that balance to be used by the stash account to do", @@ -1078,7 +1078,7 @@ "type": "ValidatorPrefs" } ], - "docs": [ + "documentation": [ " Declare the desire to validate for the origin controller.", "", " Effects will be felt at the beginning of the next era.", @@ -1094,7 +1094,7 @@ "type": "Vec
" } ], - "docs": [ + "documentation": [ " Declare the desire to nominate `targets` for the origin controller.", "", " Effects will be felt at the beginning of the next era.", @@ -1105,7 +1105,7 @@ { "name": "chill", "args": [], - "docs": [ + "documentation": [ " Declare no desire to either validate or nominate.", "", " Effects will be felt at the beginning of the next era.", @@ -1121,7 +1121,7 @@ "type": "RewardDestination" } ], - "docs": [ + "documentation": [ " (Re-)set the payment target for a controller.", "", " Effects will be felt at the beginning of the next era.", @@ -1137,7 +1137,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the number of sessions in an era." ] }, @@ -1149,7 +1149,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " The length of the bonding duration in eras." ] }, @@ -1161,7 +1161,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " The ideal number of validators." ] }, @@ -1173,7 +1173,7 @@ "type": "bool" } ], - "docs": [ + "documentation": [ " Force there to be a new era. This also forces a new session immediately after.", " `apply_rewards` should be true for validators to get the session reward." ] @@ -1186,7 +1186,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the offline slash grace period." ] }, @@ -1198,7 +1198,7 @@ "type": "Vec" } ], - "docs": [ + "documentation": [ " Set the validators who cannot be slashed (if any)." ] } @@ -1209,7 +1209,7 @@ "args": [ "Balance" ], - "docs": [ + "documentation": [ " All validators have been rewarded by the given balance." ] }, @@ -1219,7 +1219,7 @@ "AccountId", "u32" ], - "docs": [ + "documentation": [ " One validator (and their nominators) has been given a offline-warning (they're still", " within their grace). The accrued number of slashes is recorded, too." ] @@ -1230,7 +1230,7 @@ "AccountId", "Balance" ], - "docs": [ + "documentation": [ " One validator (and their nominators) has been slashed by the given amount." ] } @@ -1247,7 +1247,7 @@ "PlainType": "PropIndex" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The number of (public) proposals that have been made so far." ] }, @@ -1258,7 +1258,7 @@ "PlainType": "Vec<(PropIndex,Proposal,AccountId)>" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The public proposals. Unsorted." ] }, @@ -1272,7 +1272,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Those who have locked a deposit." ] }, @@ -1283,7 +1283,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " How often (in blocks) new public referenda are launched." ] }, @@ -1294,7 +1294,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The minimum amount to be used as a deposit for a public referendum proposal." ] }, @@ -1305,7 +1305,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " The delay before enactment for all public referenda." ] }, @@ -1316,7 +1316,7 @@ "PlainType": "LockPeriods" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The maximum number of additional lock periods a voter may offer to strengthen their vote. Multiples of `PublicDelay`." ] }, @@ -1327,7 +1327,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " How often (in blocks) to check for new votes." ] }, @@ -1338,7 +1338,7 @@ "PlainType": "ReferendumIndex" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The next free referendum index, aka the number of referendums started so far." ] }, @@ -1349,7 +1349,7 @@ "PlainType": "ReferendumIndex" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The next referendum index that should be tallied." ] }, @@ -1363,7 +1363,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Information concerning any given referendum." ] }, @@ -1377,7 +1377,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Queue of successful referenda to be dispatched." ] }, @@ -1391,7 +1391,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Get the voters for the current proposal." ] }, @@ -1405,7 +1405,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Get the vote in a given referendum of a particular voter. The result is meaningful only if `voters_for` includes the", " voter when called with the referendum (you'll get the default `Vote` value otherwise). If you don't want to check", " `voters_for`, then you can also check for simple existence with `VoteOf::exists` first." @@ -1425,7 +1425,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Propose a sensitive action to be taken." ] }, @@ -1437,7 +1437,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Propose a sensitive action to be taken." ] }, @@ -1453,7 +1453,7 @@ "type": "Vote" } ], - "docs": [ + "documentation": [ " Vote in a referendum. If `vote.is_aye()`, the vote is to enact the proposal;", " otherwise it is a vote to keep the status quo." ] @@ -1474,7 +1474,7 @@ "type": "BlockNumber" } ], - "docs": [ + "documentation": [ " Start a referendum." ] }, @@ -1486,7 +1486,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Remove a referendum." ] }, @@ -1502,7 +1502,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Cancel a proposal queued for enactment." ] } @@ -1514,7 +1514,7 @@ "PropIndex", "Balance" ], - "docs": [] + "documentation": [] }, { "name": "Tabled", @@ -1523,7 +1523,7 @@ "Balance", "Vec" ], - "docs": [] + "documentation": [] }, { "name": "Started", @@ -1531,28 +1531,28 @@ "ReferendumIndex", "VoteThreshold" ], - "docs": [] + "documentation": [] }, { "name": "Passed", "args": [ "ReferendumIndex" ], - "docs": [] + "documentation": [] }, { "name": "NotPassed", "args": [ "ReferendumIndex" ], - "docs": [] + "documentation": [] }, { "name": "Cancelled", "args": [ "ReferendumIndex" ], - "docs": [] + "documentation": [] }, { "name": "Executed", @@ -1560,7 +1560,7 @@ "ReferendumIndex", "bool" ], - "docs": [] + "documentation": [] } ] }, @@ -1575,7 +1575,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x09000000000000000000000000000000", - "docs": [ + "documentation": [ " How much should be locked up in order to submit one's candidacy." ] }, @@ -1586,7 +1586,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " How much should be locked up in order to be able to submit votes." ] }, @@ -1597,7 +1597,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x01000000000000000000000000000000", - "docs": [ + "documentation": [ " The punishment, per voter, if you provide an invalid presentation." ] }, @@ -1608,7 +1608,7 @@ "PlainType": "u32" }, "fallback": "0x02000000", - "docs": [ + "documentation": [ " How many runners-up should have their approvals persist until the next vote." ] }, @@ -1619,7 +1619,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " How long to give each top candidate to present themselves after the vote ends." ] }, @@ -1630,7 +1630,7 @@ "PlainType": "VoteIndex" }, "fallback": "0x01000000", - "docs": [ + "documentation": [ " How many vote indexes need to go by after a target voter's last vote before they can be reaped if their", " approvals are moot." ] @@ -1642,7 +1642,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " How often (in blocks) to check for new votes." ] }, @@ -1653,7 +1653,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0500000000000000", - "docs": [ + "documentation": [ " How long each position is active for." ] }, @@ -1664,7 +1664,7 @@ "PlainType": "u32" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " Number of accounts that should be sitting on the council." ] }, @@ -1675,7 +1675,7 @@ "PlainType": "Vec<(AccountId,BlockNumber)>" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The current council. When there's a vote going on, this should still be used for executive", " matters. The block number (second element in the tuple) is the block that their position is", " active until (calculated by the sum of the block number when the council member was elected", @@ -1689,7 +1689,7 @@ "PlainType": "VoteIndex" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The total number of votes that have happened or are in progress." ] }, @@ -1703,7 +1703,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " A list of votes for each voter, respecting the last cleared vote index that this voter was", " last active at." ] @@ -1718,7 +1718,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The vote index and list slot that the candidate `who` was registered or `None` if they are not", " currently registered." ] @@ -1733,7 +1733,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The last cleared vote index that this voter was last active at." ] }, @@ -1744,7 +1744,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The present voter list." ] }, @@ -1755,7 +1755,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The present candidate list." ] }, @@ -1766,7 +1766,7 @@ "PlainType": "u32" }, "fallback": "0x00000000", - "docs": [] + "documentation": [] }, { "name": "NextFinalise", @@ -1775,7 +1775,7 @@ "PlainType": "(BlockNumber,u32,Vec)" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The accounts holding the seats that will become free on the next tally." ] }, @@ -1786,7 +1786,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The stakes as they were at the point that the vote ended." ] }, @@ -1797,7 +1797,7 @@ "PlainType": "Vec<(BalanceOf,AccountId)>" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Get the leaderboard if we;re in the presentation phase." ] } @@ -1815,7 +1815,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set candidate approvals. Approval slots stay valid as long as candidates in those slots", " are registered." ] @@ -1840,7 +1840,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Remove a voter. For it not to be a bond-consuming no-op, all approved candidate indices", " must now be either unregistered or registered to a candidate that registered the slot after", " the voter gave their last approval set.", @@ -1856,7 +1856,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Remove a voter. All votes are cancelled and the voter deposit is returned." ] }, @@ -1868,7 +1868,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Submit oneself for candidacy.", "", " Account must have enough transferrable funds in it to pay the bond." @@ -1890,7 +1890,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Claim that `signed` is one of the top Self::carry_count() + current_vote().1 candidates.", " Only works if the `block_number >= current_vote().0` and `< current_vote().0 + presentation_duration()``", " `signed` should have at least" @@ -1904,7 +1904,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the desired member count; if lower than the current count, then seats will not be up", " election when they expire. If more, then a new vote will be started if one is not already", " in progress." @@ -1918,7 +1918,7 @@ "type": "Address" } ], - "docs": [ + "documentation": [ " Remove a particular member. A tally will happen instantly (if not already in a presentation", " period) to fill the seat if removal means that the desired members are not met.", " This is effective immediately." @@ -1932,7 +1932,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the presentation duration. If there is currently a vote being presented for, will", " invoke `finalise_vote`." ] @@ -1945,7 +1945,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the presentation duration. If there is current a vote being presented for, will", " invoke `finalise_vote`." ] @@ -1958,7 +1958,7 @@ "AccountId", "AccountId" ], - "docs": [ + "documentation": [ " reaped voter, reaper" ] }, @@ -1967,7 +1967,7 @@ "args": [ "AccountId" ], - "docs": [ + "documentation": [ " slashed reaper" ] }, @@ -1976,7 +1976,7 @@ "args": [ "u32" ], - "docs": [ + "documentation": [ " A tally (for approval votes of council seat(s)) has started." ] }, @@ -1986,7 +1986,7 @@ "Vec", "Vec" ], - "docs": [ + "documentation": [ " A tally (for approval votes of council seat(s)) has ended (with one or more new members)." ] } @@ -2003,7 +2003,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [] + "documentation": [] }, { "name": "VotingPeriod", @@ -2012,7 +2012,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0300000000000000", - "docs": [] + "documentation": [] }, { "name": "EnactDelayPeriod", @@ -2021,7 +2021,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " Number of blocks by which to delay enactment of successful, non-unanimous-council-instigated referendum proposals." ] }, @@ -2032,7 +2032,7 @@ "PlainType": "Vec<(BlockNumber,Hash)>" }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "ProposalOf", @@ -2044,7 +2044,7 @@ } }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "ProposalVoters", @@ -2056,7 +2056,7 @@ } }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "CouncilVoteOf", @@ -2068,7 +2068,7 @@ } }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "VetoedProposal", @@ -2080,7 +2080,7 @@ } }, "fallback": "0x00", - "docs": [] + "documentation": [] } ], "calls": [ @@ -2092,7 +2092,7 @@ "type": "Proposal" } ], - "docs": [] + "documentation": [] }, { "name": "vote", @@ -2106,7 +2106,7 @@ "type": "bool" } ], - "docs": [] + "documentation": [] }, { "name": "veto", @@ -2116,7 +2116,7 @@ "type": "Hash" } ], - "docs": [] + "documentation": [] }, { "name": "set_cooloff_period", @@ -2126,7 +2126,7 @@ "type": "Compact" } ], - "docs": [] + "documentation": [] }, { "name": "set_voting_period", @@ -2136,7 +2136,7 @@ "type": "Compact" } ], - "docs": [] + "documentation": [] } ], "events": [ @@ -2148,7 +2148,7 @@ "u32", "u32" ], - "docs": [ + "documentation": [ " A voting tally has happened for a referendum cancellation vote.", " Last three are yes, no, abstain counts." ] @@ -2161,7 +2161,7 @@ "u32", "u32" ], - "docs": [ + "documentation": [ " A voting tally has happened for a referendum vote.", " Last three are yes, no, abstain counts." ] @@ -2179,7 +2179,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The (hashes of) the active proposals." ] }, @@ -2193,7 +2193,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Actual proposal for a given hash, if it's current." ] }, @@ -2207,7 +2207,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Votes for a given proposal: (required_yes_votes, yes_voters, no_voters)." ] }, @@ -2218,7 +2218,7 @@ "PlainType": "u32" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " Proposals so far." ] } @@ -2236,7 +2236,7 @@ "type": "Proposal" } ], - "docs": [] + "documentation": [] }, { "name": "vote", @@ -2254,7 +2254,7 @@ "type": "bool" } ], - "docs": [] + "documentation": [] } ], "events": [ @@ -2266,7 +2266,7 @@ "Hash", "u32" ], - "docs": [ + "documentation": [ " A motion (given hash) has been proposed (by given account) with a threshold (given u32)." ] }, @@ -2279,7 +2279,7 @@ "u32", "u32" ], - "docs": [ + "documentation": [ " A motion (given hash) has been voted on by given account, leaving", " a tally (yes votes and no votes given as u32s respectively)." ] @@ -2289,7 +2289,7 @@ "args": [ "Hash" ], - "docs": [ + "documentation": [ " A motion was approved by the required threshold." ] }, @@ -2298,7 +2298,7 @@ "args": [ "Hash" ], - "docs": [ + "documentation": [ " A motion was not approved by the required threshold." ] }, @@ -2308,7 +2308,7 @@ "Hash", "bool" ], - "docs": [ + "documentation": [ " A motion was executed; `bool` is true if returned without error." ] } @@ -2327,7 +2327,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Hint that the author of this block thinks the best finalized", " block is the given number." ] @@ -2346,7 +2346,7 @@ "PlainType": "StoredPendingChange" }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "NextForced", @@ -2355,7 +2355,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x00", - "docs": [] + "documentation": [] } ], "calls": [ @@ -2367,7 +2367,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Report some misbehaviour." ] } @@ -2378,7 +2378,7 @@ "args": [ "Vec<(SessionKey,u64)>" ], - "docs": [ + "documentation": [ " New authority set has been applied." ] } @@ -2395,7 +2395,7 @@ "PlainType": "Permill" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " Proportion of funds that should be bonded in order to place a proposal. An accepted", " proposal gets these back. A rejected proposal doesn't." ] @@ -2407,7 +2407,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " Minimum amount of funds that should be placed in a deposit for making a proposal." ] }, @@ -2418,7 +2418,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0100000000000000", - "docs": [ + "documentation": [ " Period between successive spends." ] }, @@ -2429,7 +2429,7 @@ "PlainType": "Permill" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " Percentage of spare funds (if any) that are burnt per spend period." ] }, @@ -2440,7 +2440,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " Total funds available to this module for spending." ] }, @@ -2451,7 +2451,7 @@ "PlainType": "ProposalIndex" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " Number of proposals that have been made." ] }, @@ -2465,7 +2465,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Proposals that have been made." ] }, @@ -2476,7 +2476,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Proposal indices that have been approved but not yet awarded." ] } @@ -2494,7 +2494,7 @@ "type": "Address" } ], - "docs": [ + "documentation": [ " Put forward a suggestion for spending. A deposit proportional to the value", " is reserved and slashed if the proposal is rejected. It is returned once the", " proposal is awarded." @@ -2508,7 +2508,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the balance of funds available to spend." ] }, @@ -2532,7 +2532,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " (Re-)configure this module." ] }, @@ -2544,7 +2544,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Reject a proposed spend. The original deposit will be slashed." ] }, @@ -2556,7 +2556,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Approve a proposal. At a later time, the proposal will be allocated to the beneficiary", " and the original deposit will be returned." ] @@ -2568,7 +2568,7 @@ "args": [ "ProposalIndex" ], - "docs": [ + "documentation": [ " New proposal." ] }, @@ -2577,7 +2577,7 @@ "args": [ "Balance" ], - "docs": [ + "documentation": [ " We have ended a spend period and will now allocate funds." ] }, @@ -2588,7 +2588,7 @@ "Balance", "AccountId" ], - "docs": [ + "documentation": [ " Some funds have been allocated." ] }, @@ -2597,7 +2597,7 @@ "args": [ "Balance" ], - "docs": [ + "documentation": [ " Some of our funds have been burnt." ] }, @@ -2606,7 +2606,7 @@ "args": [ "Balance" ], - "docs": [ + "documentation": [ " Spending has finished; this is the amount that rolls over until next spend." ] } @@ -2623,7 +2623,7 @@ "PlainType": "Balance" }, "fallback": "0x15000000000000000000000000000000", - "docs": [ + "documentation": [ " The fee required to create a contract. At least as big as staking's ReclaimRebate." ] }, @@ -2634,7 +2634,7 @@ "PlainType": "Gas" }, "fallback": "0x8700000000000000", - "docs": [ + "documentation": [ " The fee charged for a call into a contract." ] }, @@ -2645,7 +2645,7 @@ "PlainType": "Gas" }, "fallback": "0xaf00000000000000", - "docs": [ + "documentation": [ " The fee charged for a create of a contract." ] }, @@ -2656,7 +2656,7 @@ "PlainType": "Balance" }, "fallback": "0x01000000000000000000000000000000", - "docs": [ + "documentation": [ " The price of one unit of gas." ] }, @@ -2667,7 +2667,7 @@ "PlainType": "u32" }, "fallback": "0x64000000", - "docs": [ + "documentation": [ " The maximum nesting level of a call/create stack." ] }, @@ -2678,7 +2678,7 @@ "PlainType": "Gas" }, "fallback": "0x40420f0000000000", - "docs": [ + "documentation": [ " The maximum amount of gas that could be expended per block." ] }, @@ -2689,7 +2689,7 @@ "PlainType": "Gas" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " Gas spent so far in this block." ] }, @@ -2700,7 +2700,7 @@ "PlainType": "Schedule" }, "fallback": "0x000000000100000000000000010000000000000001000000000000000100000000000000010000000000000001000000000000000000010010000000", - "docs": [ + "documentation": [ " Current cost schedule for contracts." ] }, @@ -2714,7 +2714,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The code associated with a given account." ] }, @@ -2728,7 +2728,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " A mapping from an original code hash to the original code, untouched by instrumentation." ] }, @@ -2742,7 +2742,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " A mapping between an original code hash and instrumented wasm code, ready for the execution." ] } @@ -2756,7 +2756,7 @@ "type": "Schedule" } ], - "docs": [ + "documentation": [ " Updates the schedule for metering contracts.", "", " The schedule must have a greater version than the stored schedule." @@ -2774,7 +2774,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Stores code in the storage. You can instantiate contracts only with stored code." ] }, @@ -2798,7 +2798,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Make a call to a specified account, optionally transferring some balance." ] }, @@ -2822,7 +2822,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Create a new contract, optionally transfering some balance to the created account.", "", " Creation is executed as follows:", @@ -2843,7 +2843,7 @@ "AccountId", "Balance" ], - "docs": [ + "documentation": [ " Transfer happened `from` -> `to` with given `value` as part of a `message-call` or `create`." ] }, @@ -2853,7 +2853,7 @@ "AccountId", "AccountId" ], - "docs": [ + "documentation": [ " Contract deployed by address at the specified address." ] }, @@ -2862,7 +2862,7 @@ "args": [ "Hash" ], - "docs": [ + "documentation": [ " Code with the specified hash has been stored." ] }, @@ -2871,7 +2871,7 @@ "args": [ "u32" ], - "docs": [ + "documentation": [ " Triggered when the current schedule is updated." ] }, @@ -2881,7 +2881,7 @@ "AccountId", "bool" ], - "docs": [ + "documentation": [ " A call was dispatched from the given account. The bool signals whether it was", " successful execution or not." ] @@ -2899,7 +2899,7 @@ "PlainType": "AccountId" }, "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", - "docs": [] + "documentation": [] } ], "calls": [ @@ -2911,7 +2911,7 @@ "type": "Proposal" } ], - "docs": [] + "documentation": [] }, { "name": "set_key", @@ -2921,7 +2921,7 @@ "type": "Address" } ], - "docs": [] + "documentation": [] } ], "events": [ @@ -2930,7 +2930,7 @@ "args": [ "bool" ], - "docs": [ + "documentation": [ " A sudo just took place." ] }, @@ -2939,7 +2939,7 @@ "args": [ "AccountId" ], - "docs": [ + "documentation": [ " The sudoer just switched identity; the old key is supplied." ] } @@ -2956,7 +2956,7 @@ "PlainType": "AssetOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The fee to be paid for making a transaction; the base." ] }, @@ -2967,7 +2967,7 @@ "PlainType": "AssetOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The fee to be paid for making a transaction; the per-byte portion." ] }, @@ -2981,7 +2981,7 @@ } }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The `extrinsic_index => accumulated_fees` map, containing records to", " track the overall charged fees for each transaction.", "", @@ -2997,7 +2997,7 @@ "u32", "Amount" ], - "docs": [ + "documentation": [ " Fee charged (extrinsic_index, fee_amount)" ] } diff --git a/packages/types/src/Metadata/v1/toV0.ts b/packages/types/src/Metadata/v1/toV0.ts index 8e2f4dc1d0..c427e2c4f6 100644 --- a/packages/types/src/Metadata/v1/toV0.ts +++ b/packages/types/src/Metadata/v1/toV0.ts @@ -4,7 +4,8 @@ import { OuterDispatchCall, OuterDispatchMetadata } from '../v0/Calls'; import { EventMetadata, OuterEventMetadata, OuterEventMetadataEvent } from '../v0/Events'; -import { CallMetadata, FunctionMetadata, RuntimeModuleMetadata, ModuleMetadata, StorageFunctionMetadata, StorageMetadata, StorageFunctionType } from '../v0/Modules'; +import { CallMetadata, FunctionMetadata, RuntimeModuleMetadata, ModuleMetadata } from '../v0/Modules'; +import { StorageFunctionMetadata, StorageMetadata, StorageFunctionType } from '../v0/Storage'; import MetadataV0 from '../v0/Metadata'; import MetadataV1, { MetadataModuleV1 } from '.'; @@ -16,13 +17,13 @@ function storageV0 (mod: MetadataModuleV1): StorageMetadata | null { return new StorageMetadata({ prefix: mod.prefix, - functions: mod.storage.unwrap().map(({ docs, fallback, modifier, name, type }) => + functions: mod.storage.unwrap().map(({ documentation, fallback, modifier, name, type }) => new StorageFunctionMetadata({ name, modifier: modifier.toNumber(), type: new StorageFunctionType(type), - default: fallback, - documentation: docs + fallback, + documentation }) ) }); @@ -35,12 +36,12 @@ function moduleV0 (mod: MetadataModuleV1): ModuleMetadata { name: 'Call', functions: mod.calls.isNone ? [] - : mod.calls.unwrap().map(({ args, docs, name }, id) => + : mod.calls.unwrap().map(({ args, documentation, name }, id) => new FunctionMetadata({ id, name, arguments: args, - documentation: docs + documentation }) ) }) @@ -81,11 +82,11 @@ function outerEventV0 (v1: MetadataV1): OuterEventMetadata { .map((mod) => new OuterEventMetadataEvent([ mod.name, - mod.events.unwrap().map(({ args, docs, name }) => + mod.events.unwrap().map(({ args, documentation, name }) => new EventMetadata({ name, arguments: args, - documentation: docs + documentation }) ) ]) diff --git a/packages/types/src/Metadata/v2/Metadata.ts b/packages/types/src/Metadata/v2/Metadata.ts index ebdb43ae05..3a8d1d63c7 100644 --- a/packages/types/src/Metadata/v2/Metadata.ts +++ b/packages/types/src/Metadata/v2/Metadata.ts @@ -12,7 +12,7 @@ import { flattenUniq, validateTypes } from '../util'; import { MetadataCall } from '../v1/Calls'; import { MetadataEvent } from '../v1/Events'; -import { MetadataStorage } from './Storage'; +import { StorageFunctionMetadata } from './Storage'; /** * @name MetadataModule @@ -24,7 +24,7 @@ export class MetadataModule extends Struct { super({ name: Text, prefix: Text, - storage: Option.with(Vector.with(MetadataStorage)), + storage: Option.with(Vector.with(StorageFunctionMetadata)), calls: Option.with(Vector.with(MetadataCall)), events: Option.with(Vector.with(MetadataEvent)) }, value); @@ -61,8 +61,8 @@ export class MetadataModule extends Struct { /** * @description the associated module storage */ - get storage (): Option> { - return this.get('storage') as Option>; + get storage (): Option> { + return this.get('storage') as Option>; } } diff --git a/packages/types/src/Metadata/v2/Storage.ts b/packages/types/src/Metadata/v2/Storage.ts index d1db771db3..10e02cd37a 100644 --- a/packages/types/src/Metadata/v2/Storage.ts +++ b/packages/types/src/Metadata/v2/Storage.ts @@ -2,20 +2,22 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +import { AnyNumber } from '../../types'; + import EnumType from '../../codec/EnumType'; import Struct from '../../codec/Struct'; import Vector from '../../codec/Vector'; import Bool from '../../primitive/Bool'; import Bytes from '../../primitive/Bytes'; -import Null from '../../primitive/Null'; import Text from '../../primitive/Text'; import Type from '../../primitive/Type'; -import { MetadataStorageModifier } from '../v1/Storage'; -import { DoubleMapType } from '../v0/Modules'; +import { PlainType, StorageFunctionModifier } from '../v1/Storage'; -export class Default extends Null {} - -export class Optional extends Null {} +// Re-export classes that haven't changed between V1 and V2 +export { + PlainType, + StorageFunctionModifier +}; export class MapType extends Struct { constructor (value?: any) { @@ -48,25 +50,14 @@ export class MapType extends Struct { } } -export class PlainType extends Type { -} - -export class MetadataStorageType extends EnumType { +export class StorageFunctionType extends EnumType { constructor (value?: any, index?: number) { super({ PlainType, - MapType, - DoubleMapType + MapType }, value, index); } - /** - * @description `true` if the storage entry is a doublemap - */ - get isDoubleMap (): boolean { - return this.toNumber() === 2; - } - /** * @description `true` if the storage entry is a map */ @@ -74,13 +65,6 @@ export class MetadataStorageType extends EnumType | Array +}; + /** * @name MetadataModule * @description * The definition of a storage function */ -export class MetadataStorage extends Struct { - constructor (value?: any) { +export class StorageFunctionMetadata extends Struct { + constructor (value?: StorageFunctionMetadataValue | Uint8Array) { super({ name: Text, - modifier: MetadataStorageModifier, - type: MetadataStorageType, + modifier: StorageFunctionModifier, + type: StorageFunctionType, fallback: Bytes, - docs: Vector.with(Text) + documentation: Vector.with(Text) }, value); } + /** + * @description The default value of the storage function + * @deprecated Use `.fallback` instead. + */ + get default (): Bytes { + return this.fallback; + } + /** * @description The [[Text]] documentation */ + get documentation (): Vector { + return this.get('documentation') as Vector; + } + + /** + * @description The [[Text]] documentation + * @deprecated Use `.documentation` instead. + */ get docs (): Vector { - return this.get('docs') as Vector; + return this.documentation; } /** @@ -142,8 +146,8 @@ export class MetadataStorage extends Struct { /** * @description The [[MetadataArgument]] for arguments */ - get modifier (): MetadataStorageModifier { - return this.get('modifier') as MetadataStorageModifier; + get modifier (): StorageFunctionModifier { + return this.get('modifier') as StorageFunctionModifier; } /** @@ -154,9 +158,9 @@ export class MetadataStorage extends Struct { } /** - * @description The [[MetadataStorageType]] + * @description The [[StorageFunctionType]] */ - get type (): MetadataStorageType { - return this.get('type') as MetadataStorageType; + get type (): StorageFunctionType { + return this.get('type') as StorageFunctionType; } } diff --git a/packages/types/src/Metadata/v2/latest.substrate.v2.json b/packages/types/src/Metadata/v2/latest.substrate.v2.json index 888cd8e20e..3d9ff2c725 100644 --- a/packages/types/src/Metadata/v2/latest.substrate.v2.json +++ b/packages/types/src/Metadata/v2/latest.substrate.v2.json @@ -18,7 +18,7 @@ } }, "fallback": "0x0000000000000000", - "docs": [] + "documentation": [] }, { "name": "ExtrinsicCount", @@ -27,7 +27,7 @@ "PlainType": "u32" }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "AllExtrinsicsLen", @@ -36,7 +36,7 @@ "PlainType": "u32" }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "BlockHash", @@ -49,7 +49,7 @@ } }, "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", - "docs": [] + "documentation": [] }, { "name": "ExtrinsicData", @@ -62,7 +62,7 @@ } }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "RandomSeed", @@ -71,7 +71,7 @@ "PlainType": "Hash" }, "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", - "docs": [] + "documentation": [] }, { "name": "Number", @@ -80,7 +80,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " The current block number being processed. Set by `execute_block`." ] }, @@ -91,7 +91,7 @@ "PlainType": "Hash" }, "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", - "docs": [] + "documentation": [] }, { "name": "ExtrinsicsRoot", @@ -100,7 +100,7 @@ "PlainType": "Hash" }, "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", - "docs": [] + "documentation": [] }, { "name": "Digest", @@ -109,7 +109,7 @@ "PlainType": "Digest" }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "Events", @@ -118,7 +118,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [] + "documentation": [] } ], "calls": null, @@ -126,14 +126,14 @@ { "name": "ExtrinsicSuccess", "args": [], - "docs": [ + "documentation": [ " An extrinsic completed successfully." ] }, { "name": "ExtrinsicFailed", "args": [], - "docs": [ + "documentation": [ " An extrinsic failed." ] } @@ -157,7 +157,7 @@ "PlainType": "Moment" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " Current time for the current block." ] }, @@ -168,7 +168,7 @@ "PlainType": "Moment" }, "fallback": "0x0500000000000000", - "docs": [ + "documentation": [ " The minimum (and advised) period between blocks." ] }, @@ -179,7 +179,7 @@ "PlainType": "bool" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Did the timestamp get updated in this block?" ] } @@ -193,7 +193,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the current time.", "", " This call should be invoked exactly once per block. It will panic at the finalization phase,", @@ -218,7 +218,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [] + "documentation": [] } ], "calls": [ @@ -230,7 +230,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Report some misbehaviour." ] }, @@ -242,7 +242,7 @@ "type": "InherentOfflineReport" } ], - "docs": [ + "documentation": [ " Note the previous block's validator missed their opportunity to propose a block." ] }, @@ -254,7 +254,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Make some on-chain remark." ] }, @@ -266,7 +266,7 @@ "type": "u64" } ], - "docs": [ + "documentation": [ " Set the number of pages in the WebAssembly environment's heap." ] }, @@ -278,7 +278,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Set the new code." ] }, @@ -290,7 +290,7 @@ "type": "Vec" } ], - "docs": [ + "documentation": [ " Set some items of storage." ] } @@ -308,7 +308,7 @@ "PlainType": "AccountIndex" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The next free enumeration set." ] }, @@ -323,7 +323,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The enumeration sets." ] } @@ -336,7 +336,7 @@ "AccountId", "AccountIndex" ], - "docs": [ + "documentation": [ " A new account index was assigned.", "", " This event is not triggered when an existing index is reassigned", @@ -356,7 +356,7 @@ "PlainType": "Balance" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The total amount of stake on the system." ] }, @@ -367,7 +367,7 @@ "PlainType": "Balance" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The minimum amount allowed to keep an account open." ] }, @@ -378,7 +378,7 @@ "PlainType": "Balance" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The fee required to make a transfer." ] }, @@ -389,7 +389,7 @@ "PlainType": "Balance" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The fee required to create an account. At least as big as ReclaimRebate." ] }, @@ -400,7 +400,7 @@ "PlainType": "Balance" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The fee to be paid for making a transaction; the base." ] }, @@ -411,7 +411,7 @@ "PlainType": "Balance" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The fee to be paid for making a transaction; the per-byte portion." ] }, @@ -426,7 +426,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Information regarding the vesting of a given account." ] }, @@ -441,7 +441,7 @@ } }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The 'free' balance of a given account.", "", " This is the only balance that matters in terms of most operations on tokens. It is", @@ -466,7 +466,7 @@ } }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The amount of the balance of a given account that is externally reserved; this can still get", " slashed, but gets slashed last of all.", "", @@ -492,7 +492,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Any liquidity locks on some account balances." ] } @@ -510,7 +510,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Transfer some liquid free balance to another staker." ] }, @@ -530,7 +530,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the balances of a given account." ] } @@ -542,7 +542,7 @@ "AccountId", "Balance" ], - "docs": [ + "documentation": [ " A new account was created." ] }, @@ -551,7 +551,7 @@ "args": [ "AccountId" ], - "docs": [ + "documentation": [ " An account was reaped." ] }, @@ -563,7 +563,7 @@ "Balance", "Balance" ], - "docs": [ + "documentation": [ " Transfer succeeded (from, to, value, fees)." ] } @@ -580,7 +580,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The current set of validators." ] }, @@ -591,7 +591,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " Current length of the session." ] }, @@ -602,7 +602,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " Current index of the session." ] }, @@ -613,7 +613,7 @@ "PlainType": "Moment" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " Timestamp when current session started." ] }, @@ -624,7 +624,7 @@ "PlainType": "bool" }, "fallback": "0x00", - "docs": [ + "documentation": [ " New session is being forced is this entry exists; in which case, the boolean value is whether", " the new session should be considered a normal rotation (rewardable) or exceptional (slashable)." ] @@ -636,7 +636,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Block at which the session length last changed." ] }, @@ -651,7 +651,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The next key for a given validator." ] }, @@ -662,7 +662,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The next session length." ] } @@ -676,7 +676,7 @@ "type": "SessionKey" } ], - "docs": [ + "documentation": [ " Sets the session key of `_validator` to `_key`. This doesn't take effect until the next", " session." ] @@ -689,7 +689,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set a new session length. Won't kick in until the next session change (at current length)." ] }, @@ -701,7 +701,7 @@ "type": "bool" } ], - "docs": [ + "documentation": [ " Forces a new session." ] } @@ -712,7 +712,7 @@ "args": [ "BlockNumber" ], - "docs": [ + "documentation": [ " New session has happened. Note that the argument is the session index, not the block", " number as the type might suggest." ] @@ -730,7 +730,7 @@ "PlainType": "u32" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The ideal number of staking participants." ] }, @@ -741,7 +741,7 @@ "PlainType": "u32" }, "fallback": "0x04000000", - "docs": [ + "documentation": [ " Minimum number of staking participants before emergency conditions are imposed." ] }, @@ -752,7 +752,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " The length of a staking era in sessions." ] }, @@ -763,7 +763,7 @@ "PlainType": "Perbill" }, "fallback": "0x3c000000", - "docs": [ + "documentation": [ " Maximum reward, per validator, that is provided per acceptable session." ] }, @@ -774,7 +774,7 @@ "PlainType": "Perbill" }, "fallback": "0x40420f00", - "docs": [ + "documentation": [ " Slash, per validator that is taken for the first time they are found to be offline." ] }, @@ -785,7 +785,7 @@ "PlainType": "u32" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " Number of instances of offline reports before slashing begins for validators." ] }, @@ -796,7 +796,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " The length of the bonding duration in blocks." ] }, @@ -807,7 +807,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Any validators that may never be slashed or forcibly kicked. It's a Vec since they're easy to initialise", " and the performance hit is minimal (we expect no more than four invulnerables) and restricted to testnets." ] @@ -823,7 +823,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Map from all locked \"stash\" accounts to the controller account." ] }, @@ -838,7 +838,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Map from all (unlocked) \"controller\" accounts to the info regarding the staking." ] }, @@ -853,7 +853,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Where the reward payment should be made. Keyed by stash." ] }, @@ -868,7 +868,7 @@ } }, "fallback": "0x0c00", - "docs": [ + "documentation": [ " The map from (wannabe) validator stash key to the preferences of that validator." ] }, @@ -883,7 +883,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The map from nominator stash key to the set of stash keys of all validators to nominate." ] }, @@ -898,7 +898,7 @@ } }, "fallback": "0x000000", - "docs": [ + "documentation": [ " Nominators for a particular account that is in action right now. You can't iterate through validators here,", " but you can find them in the `sessions` module.", "", @@ -912,7 +912,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The currently elected validator set keyed by stash account ID." ] }, @@ -923,7 +923,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " The current era index." ] }, @@ -934,7 +934,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " Maximum reward, per validator, that is provided per acceptable session." ] }, @@ -945,7 +945,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The accumulated reward for the current era. Reset to zero at the beginning of the era and", " increased for every successfully finished session." ] @@ -957,7 +957,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The next value of sessions per era." ] }, @@ -968,7 +968,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " The session index at which the era length last changed." ] }, @@ -979,7 +979,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The amount of balance actively at stake for each validator slot, currently.", "", " This is used to derive rewards and punishments." @@ -996,7 +996,7 @@ } }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The number of times a given validator has been reported offline. This gets decremented by one each era that passes." ] }, @@ -1007,7 +1007,7 @@ "PlainType": "Null" }, "fallback": "0x00", - "docs": [ + "documentation": [ " We are forcing a new era." ] }, @@ -1018,7 +1018,7 @@ "PlainType": "Vec<(AccountId,BlockNumber,u32)>" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Most recent `RECENT_OFFLINE_COUNT` instances. (who it was, when it was reported, how many instances they were offline for)." ] } @@ -1040,7 +1040,7 @@ "type": "RewardDestination" } ], - "docs": [ + "documentation": [ " Take the origin account as a stash and lock up `value` of its balance. `controller` will be the", " account that controls it.", "", @@ -1055,7 +1055,7 @@ "type": "BalanceOf" } ], - "docs": [ + "documentation": [ " Add some extra amount that have appeared in the stash `free_balance` into the balance up for", " staking.", "", @@ -1072,7 +1072,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Schedule a portion of the stash to be unlocked ready for transfer out after the bond", " period ends. If this leaves an amount actively bonded less than", " T::Currency::existential_deposit(), then it is increased to the full amount.", @@ -1088,7 +1088,7 @@ { "name": "withdraw_unbonded", "args": [], - "docs": [ + "documentation": [ " Remove any unlocked chunks from the `unlocking` queue from our management.", "", " This essentially frees up that balance to be used by the stash account to do", @@ -1107,7 +1107,7 @@ "type": "ValidatorPrefs" } ], - "docs": [ + "documentation": [ " Declare the desire to validate for the origin controller.", "", " Effects will be felt at the beginning of the next era.", @@ -1123,7 +1123,7 @@ "type": "Vec
" } ], - "docs": [ + "documentation": [ " Declare the desire to nominate `targets` for the origin controller.", "", " Effects will be felt at the beginning of the next era.", @@ -1134,7 +1134,7 @@ { "name": "chill", "args": [], - "docs": [ + "documentation": [ " Declare no desire to either validate or nominate.", "", " Effects will be felt at the beginning of the next era.", @@ -1150,7 +1150,7 @@ "type": "RewardDestination" } ], - "docs": [ + "documentation": [ " (Re-)set the payment target for a controller.", "", " Effects will be felt at the beginning of the next era.", @@ -1166,7 +1166,7 @@ "type": "Address" } ], - "docs": [ + "documentation": [ " (Re-)set the payment target for a controller.", "", " Effects will be felt at the beginning of the next era.", @@ -1182,7 +1182,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the number of sessions in an era." ] }, @@ -1194,7 +1194,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " The length of the bonding duration in eras." ] }, @@ -1206,7 +1206,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " The ideal number of validators." ] }, @@ -1218,7 +1218,7 @@ "type": "bool" } ], - "docs": [ + "documentation": [ " Force there to be a new era. This also forces a new session immediately after.", " `apply_rewards` should be true for validators to get the session reward." ] @@ -1231,7 +1231,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the offline slash grace period." ] }, @@ -1243,7 +1243,7 @@ "type": "Vec" } ], - "docs": [ + "documentation": [ " Set the validators who cannot be slashed (if any)." ] } @@ -1254,7 +1254,7 @@ "args": [ "Balance" ], - "docs": [ + "documentation": [ " All validators have been rewarded by the given balance." ] }, @@ -1264,7 +1264,7 @@ "AccountId", "u32" ], - "docs": [ + "documentation": [ " One validator (and their nominators) has been given a offline-warning (they're still", " within their grace). The accrued number of slashes is recorded, too." ] @@ -1275,7 +1275,7 @@ "AccountId", "Balance" ], - "docs": [ + "documentation": [ " One validator (and their nominators) has been slashed by the given amount." ] } @@ -1292,7 +1292,7 @@ "PlainType": "PropIndex" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The number of (public) proposals that have been made so far." ] }, @@ -1303,7 +1303,7 @@ "PlainType": "Vec<(PropIndex,Proposal,AccountId)>" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The public proposals. Unsorted." ] }, @@ -1318,7 +1318,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Those who have locked a deposit." ] }, @@ -1329,7 +1329,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " How often (in blocks) new public referenda are launched." ] }, @@ -1340,7 +1340,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The minimum amount to be used as a deposit for a public referendum proposal." ] }, @@ -1351,7 +1351,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " The delay before enactment for all public referenda." ] }, @@ -1362,7 +1362,7 @@ "PlainType": "LockPeriods" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The maximum number of additional lock periods a voter may offer to strengthen their vote. Multiples of `PublicDelay`." ] }, @@ -1373,7 +1373,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " How often (in blocks) to check for new votes." ] }, @@ -1384,7 +1384,7 @@ "PlainType": "ReferendumIndex" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The next free referendum index, aka the number of referendums started so far." ] }, @@ -1395,7 +1395,7 @@ "PlainType": "ReferendumIndex" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The next referendum index that should be tallied." ] }, @@ -1410,7 +1410,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Information concerning any given referendum." ] }, @@ -1425,7 +1425,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Queue of successful referenda to be dispatched." ] }, @@ -1440,7 +1440,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Get the voters for the current proposal." ] }, @@ -1455,7 +1455,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Get the vote in a given referendum of a particular voter. The result is meaningful only if `voters_for` includes the", " voter when called with the referendum (you'll get the default `Vote` value otherwise). If you don't want to check", " `voters_for`, then you can also check for simple existence with `VoteOf::exists` first." @@ -1472,7 +1472,7 @@ } }, "fallback": "0x000000000000000000000000000000000000000000000000000000000000000000", - "docs": [ + "documentation": [ " Get the account (and lock periods) to which another account is delegating vote." ] } @@ -1490,7 +1490,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Propose a sensitive action to be taken." ] }, @@ -1502,7 +1502,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Propose a sensitive action to be taken." ] }, @@ -1518,7 +1518,7 @@ "type": "Vote" } ], - "docs": [ + "documentation": [ " Vote in a referendum. If `vote.is_aye()`, the vote is to enact the proposal;", " otherwise it is a vote to keep the status quo." ] @@ -1539,7 +1539,7 @@ "type": "BlockNumber" } ], - "docs": [ + "documentation": [ " Start a referendum." ] }, @@ -1551,7 +1551,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Remove a referendum." ] }, @@ -1567,7 +1567,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Cancel a proposal queued for enactment." ] }, @@ -1583,14 +1583,14 @@ "type": "LockPeriods" } ], - "docs": [ + "documentation": [ " Delegate vote." ] }, { "name": "undelegate", "args": [], - "docs": [ + "documentation": [ " Undelegate vote." ] } @@ -1602,7 +1602,7 @@ "PropIndex", "Balance" ], - "docs": [] + "documentation": [] }, { "name": "Tabled", @@ -1611,7 +1611,7 @@ "Balance", "Vec" ], - "docs": [] + "documentation": [] }, { "name": "Started", @@ -1619,28 +1619,28 @@ "ReferendumIndex", "VoteThreshold" ], - "docs": [] + "documentation": [] }, { "name": "Passed", "args": [ "ReferendumIndex" ], - "docs": [] + "documentation": [] }, { "name": "NotPassed", "args": [ "ReferendumIndex" ], - "docs": [] + "documentation": [] }, { "name": "Cancelled", "args": [ "ReferendumIndex" ], - "docs": [] + "documentation": [] }, { "name": "Executed", @@ -1648,7 +1648,7 @@ "ReferendumIndex", "bool" ], - "docs": [] + "documentation": [] }, { "name": "Delegated", @@ -1656,14 +1656,14 @@ "AccountId", "AccountId" ], - "docs": [] + "documentation": [] }, { "name": "Undelegated", "args": [ "AccountId" ], - "docs": [] + "documentation": [] } ] }, @@ -1678,7 +1678,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x09000000000000000000000000000000", - "docs": [ + "documentation": [ " How much should be locked up in order to submit one's candidacy." ] }, @@ -1689,7 +1689,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " How much should be locked up in order to be able to submit votes." ] }, @@ -1700,7 +1700,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x01000000000000000000000000000000", - "docs": [ + "documentation": [ " The punishment, per voter, if you provide an invalid presentation." ] }, @@ -1711,7 +1711,7 @@ "PlainType": "u32" }, "fallback": "0x02000000", - "docs": [ + "documentation": [ " How many runners-up should have their approvals persist until the next vote." ] }, @@ -1722,7 +1722,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " How long to give each top candidate to present themselves after the vote ends." ] }, @@ -1733,7 +1733,7 @@ "PlainType": "VoteIndex" }, "fallback": "0x01000000", - "docs": [ + "documentation": [ " How many vote indexes need to go by after a target voter's last vote before they can be reaped if their", " approvals are moot." ] @@ -1745,7 +1745,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " How often (in blocks) to check for new votes." ] }, @@ -1756,7 +1756,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0500000000000000", - "docs": [ + "documentation": [ " How long each position is active for." ] }, @@ -1767,7 +1767,7 @@ "PlainType": "u32" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " Number of accounts that should be sitting on the council." ] }, @@ -1778,7 +1778,7 @@ "PlainType": "Vec<(AccountId,BlockNumber)>" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The current council. When there's a vote going on, this should still be used for executive", " matters. The block number (second element in the tuple) is the block that their position is", " active until (calculated by the sum of the block number when the council member was elected", @@ -1792,7 +1792,7 @@ "PlainType": "VoteIndex" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The total number of votes that have happened or are in progress." ] }, @@ -1807,7 +1807,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " A list of votes for each voter, respecting the last cleared vote index that this voter was", " last active at." ] @@ -1823,7 +1823,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The vote index and list slot that the candidate `who` was registered or `None` if they are not", " currently registered." ] @@ -1839,7 +1839,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The last cleared vote index that this voter was last active at." ] }, @@ -1850,7 +1850,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The present voter list." ] }, @@ -1861,7 +1861,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The present candidate list." ] }, @@ -1872,7 +1872,7 @@ "PlainType": "u32" }, "fallback": "0x00000000", - "docs": [] + "documentation": [] }, { "name": "NextFinalise", @@ -1881,7 +1881,7 @@ "PlainType": "(BlockNumber,u32,Vec)" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The accounts holding the seats that will become free on the next tally." ] }, @@ -1892,7 +1892,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The stakes as they were at the point that the vote ended." ] }, @@ -1903,7 +1903,7 @@ "PlainType": "Vec<(BalanceOf,AccountId)>" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Get the leaderboard if we;re in the presentation phase." ] } @@ -1921,7 +1921,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set candidate approvals. Approval slots stay valid as long as candidates in those slots", " are registered." ] @@ -1946,7 +1946,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Remove a voter. For it not to be a bond-consuming no-op, all approved candidate indices", " must now be either unregistered or registered to a candidate that registered the slot after", " the voter gave their last approval set.", @@ -1962,7 +1962,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Remove a voter. All votes are cancelled and the voter deposit is returned." ] }, @@ -1974,7 +1974,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Submit oneself for candidacy.", "", " Account must have enough transferrable funds in it to pay the bond." @@ -1996,7 +1996,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Claim that `signed` is one of the top Self::carry_count() + current_vote().1 candidates.", " Only works if the `block_number >= current_vote().0` and `< current_vote().0 + presentation_duration()``", " `signed` should have at least" @@ -2010,7 +2010,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the desired member count; if lower than the current count, then seats will not be up", " election when they expire. If more, then a new vote will be started if one is not already", " in progress." @@ -2024,7 +2024,7 @@ "type": "Address" } ], - "docs": [ + "documentation": [ " Remove a particular member. A tally will happen instantly (if not already in a presentation", " period) to fill the seat if removal means that the desired members are not met.", " This is effective immediately." @@ -2038,7 +2038,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the presentation duration. If there is currently a vote being presented for, will", " invoke `finalise_vote`." ] @@ -2051,7 +2051,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the presentation duration. If there is current a vote being presented for, will", " invoke `finalise_vote`." ] @@ -2064,7 +2064,7 @@ "AccountId", "AccountId" ], - "docs": [ + "documentation": [ " reaped voter, reaper" ] }, @@ -2073,7 +2073,7 @@ "args": [ "AccountId" ], - "docs": [ + "documentation": [ " slashed reaper" ] }, @@ -2082,7 +2082,7 @@ "args": [ "u32" ], - "docs": [ + "documentation": [ " A tally (for approval votes of council seat(s)) has started." ] }, @@ -2092,7 +2092,7 @@ "Vec", "Vec" ], - "docs": [ + "documentation": [ " A tally (for approval votes of council seat(s)) has ended (with one or more new members)." ] } @@ -2109,7 +2109,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [] + "documentation": [] }, { "name": "VotingPeriod", @@ -2118,7 +2118,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0300000000000000", - "docs": [] + "documentation": [] }, { "name": "EnactDelayPeriod", @@ -2127,7 +2127,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " Number of blocks by which to delay enactment of successful, non-unanimous-council-instigated referendum proposals." ] }, @@ -2138,7 +2138,7 @@ "PlainType": "Vec<(BlockNumber,Hash)>" }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "ProposalOf", @@ -2151,7 +2151,7 @@ } }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "ProposalVoters", @@ -2164,7 +2164,7 @@ } }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "CouncilVoteOf", @@ -2177,7 +2177,7 @@ } }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "VetoedProposal", @@ -2190,7 +2190,7 @@ } }, "fallback": "0x00", - "docs": [] + "documentation": [] } ], "calls": [ @@ -2202,7 +2202,7 @@ "type": "Proposal" } ], - "docs": [] + "documentation": [] }, { "name": "vote", @@ -2216,7 +2216,7 @@ "type": "bool" } ], - "docs": [] + "documentation": [] }, { "name": "veto", @@ -2226,7 +2226,7 @@ "type": "Hash" } ], - "docs": [] + "documentation": [] }, { "name": "set_cooloff_period", @@ -2236,7 +2236,7 @@ "type": "Compact" } ], - "docs": [] + "documentation": [] }, { "name": "set_voting_period", @@ -2246,7 +2246,7 @@ "type": "Compact" } ], - "docs": [] + "documentation": [] } ], "events": [ @@ -2258,7 +2258,7 @@ "u32", "u32" ], - "docs": [ + "documentation": [ " A voting tally has happened for a referendum cancellation vote.", " Last three are yes, no, abstain counts." ] @@ -2271,7 +2271,7 @@ "u32", "u32" ], - "docs": [ + "documentation": [ " A voting tally has happened for a referendum vote.", " Last three are yes, no, abstain counts." ] @@ -2289,7 +2289,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The (hashes of) the active proposals." ] }, @@ -2304,7 +2304,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Actual proposal for a given hash, if it's current." ] }, @@ -2319,7 +2319,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Votes for a given proposal: (required_yes_votes, yes_voters, no_voters)." ] }, @@ -2330,7 +2330,7 @@ "PlainType": "u32" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " Proposals so far." ] } @@ -2348,7 +2348,7 @@ "type": "Proposal" } ], - "docs": [] + "documentation": [] }, { "name": "vote", @@ -2366,7 +2366,7 @@ "type": "bool" } ], - "docs": [] + "documentation": [] } ], "events": [ @@ -2378,7 +2378,7 @@ "Hash", "u32" ], - "docs": [ + "documentation": [ " A motion (given hash) has been proposed (by given account) with a threshold (given u32)." ] }, @@ -2391,7 +2391,7 @@ "u32", "u32" ], - "docs": [ + "documentation": [ " A motion (given hash) has been voted on by given account, leaving", " a tally (yes votes and no votes given as u32s respectively)." ] @@ -2401,7 +2401,7 @@ "args": [ "Hash" ], - "docs": [ + "documentation": [ " A motion was approved by the required threshold." ] }, @@ -2410,7 +2410,7 @@ "args": [ "Hash" ], - "docs": [ + "documentation": [ " A motion was not approved by the required threshold." ] }, @@ -2420,7 +2420,7 @@ "Hash", "bool" ], - "docs": [ + "documentation": [ " A motion was executed; `bool` is true if returned without error." ] } @@ -2439,7 +2439,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Hint that the author of this block thinks the best finalized", " block is the given number." ] @@ -2458,7 +2458,7 @@ "PlainType": "StoredPendingChange" }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "NextForced", @@ -2467,7 +2467,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x00", - "docs": [] + "documentation": [] } ], "calls": [ @@ -2479,7 +2479,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Report some misbehaviour." ] } @@ -2490,7 +2490,7 @@ "args": [ "Vec<(SessionKey,u64)>" ], - "docs": [ + "documentation": [ " New authority set has been applied." ] } @@ -2507,7 +2507,7 @@ "PlainType": "Permill" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " Proportion of funds that should be bonded in order to place a proposal. An accepted", " proposal gets these back. A rejected proposal doesn't." ] @@ -2519,7 +2519,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " Minimum amount of funds that should be placed in a deposit for making a proposal." ] }, @@ -2530,7 +2530,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0100000000000000", - "docs": [ + "documentation": [ " Period between successive spends." ] }, @@ -2541,7 +2541,7 @@ "PlainType": "Permill" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " Percentage of spare funds (if any) that are burnt per spend period." ] }, @@ -2552,7 +2552,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " Total funds available to this module for spending." ] }, @@ -2563,7 +2563,7 @@ "PlainType": "ProposalIndex" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " Number of proposals that have been made." ] }, @@ -2578,7 +2578,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Proposals that have been made." ] }, @@ -2589,7 +2589,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Proposal indices that have been approved but not yet awarded." ] } @@ -2607,7 +2607,7 @@ "type": "Address" } ], - "docs": [ + "documentation": [ " Put forward a suggestion for spending. A deposit proportional to the value", " is reserved and slashed if the proposal is rejected. It is returned once the", " proposal is awarded." @@ -2621,7 +2621,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the balance of funds available to spend." ] }, @@ -2645,7 +2645,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " (Re-)configure this module." ] }, @@ -2657,7 +2657,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Reject a proposed spend. The original deposit will be slashed." ] }, @@ -2669,7 +2669,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Approve a proposal. At a later time, the proposal will be allocated to the beneficiary", " and the original deposit will be returned." ] @@ -2681,7 +2681,7 @@ "args": [ "ProposalIndex" ], - "docs": [ + "documentation": [ " New proposal." ] }, @@ -2690,7 +2690,7 @@ "args": [ "Balance" ], - "docs": [ + "documentation": [ " We have ended a spend period and will now allocate funds." ] }, @@ -2701,7 +2701,7 @@ "Balance", "AccountId" ], - "docs": [ + "documentation": [ " Some funds have been allocated." ] }, @@ -2710,7 +2710,7 @@ "args": [ "Balance" ], - "docs": [ + "documentation": [ " Some of our funds have been burnt." ] }, @@ -2719,7 +2719,7 @@ "args": [ "Balance" ], - "docs": [ + "documentation": [ " Spending has finished; this is the amount that rolls over until next spend." ] } @@ -2736,7 +2736,7 @@ "PlainType": "Balance" }, "fallback": "0x15000000000000000000000000000000", - "docs": [ + "documentation": [ " The fee required to create a contract. At least as big as staking's ReclaimRebate." ] }, @@ -2747,7 +2747,7 @@ "PlainType": "Gas" }, "fallback": "0x8700000000000000", - "docs": [ + "documentation": [ " The fee charged for a call into a contract." ] }, @@ -2758,7 +2758,7 @@ "PlainType": "Gas" }, "fallback": "0xaf00000000000000", - "docs": [ + "documentation": [ " The fee charged for a create of a contract." ] }, @@ -2769,7 +2769,7 @@ "PlainType": "Balance" }, "fallback": "0x01000000000000000000000000000000", - "docs": [ + "documentation": [ " The price of one unit of gas." ] }, @@ -2780,7 +2780,7 @@ "PlainType": "u32" }, "fallback": "0x64000000", - "docs": [ + "documentation": [ " The maximum nesting level of a call/create stack." ] }, @@ -2791,7 +2791,7 @@ "PlainType": "Gas" }, "fallback": "0x40420f0000000000", - "docs": [ + "documentation": [ " The maximum amount of gas that could be expended per block." ] }, @@ -2802,7 +2802,7 @@ "PlainType": "Gas" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " Gas spent so far in this block." ] }, @@ -2813,7 +2813,7 @@ "PlainType": "Schedule" }, "fallback": "0x000000000100000000000000010000000000000001000000000000000100000000000000010000000000000001000000000000000000010010000000", - "docs": [ + "documentation": [ " Current cost schedule for contracts." ] }, @@ -2828,7 +2828,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The code associated with a given account." ] }, @@ -2843,7 +2843,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " A mapping from an original code hash to the original code, untouched by instrumentation." ] }, @@ -2858,7 +2858,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " A mapping between an original code hash and instrumented wasm code, ready for the execution." ] }, @@ -2869,7 +2869,7 @@ "PlainType": "u64" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " The subtrie counter" ] }, @@ -2884,7 +2884,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The code associated with a given account." ] } @@ -2898,7 +2898,7 @@ "type": "Schedule" } ], - "docs": [ + "documentation": [ " Updates the schedule for metering contracts.", "", " The schedule must have a greater version than the stored schedule." @@ -2916,7 +2916,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Stores code in the storage. You can instantiate contracts only with stored code." ] }, @@ -2940,7 +2940,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Make a call to a specified account, optionally transferring some balance." ] }, @@ -2964,7 +2964,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Create a new contract, optionally transferring some balance to the created account.", "", " Creation is executed as follows:", @@ -2985,7 +2985,7 @@ "AccountId", "Balance" ], - "docs": [ + "documentation": [ " Transfer happened `from` -> `to` with given `value` as part of a `message-call` or `create`." ] }, @@ -2995,7 +2995,7 @@ "AccountId", "AccountId" ], - "docs": [ + "documentation": [ " Contract deployed by address at the specified address." ] }, @@ -3004,7 +3004,7 @@ "args": [ "Hash" ], - "docs": [ + "documentation": [ " Code with the specified hash has been stored." ] }, @@ -3013,7 +3013,7 @@ "args": [ "u32" ], - "docs": [ + "documentation": [ " Triggered when the current schedule is updated." ] }, @@ -3023,7 +3023,7 @@ "AccountId", "bool" ], - "docs": [ + "documentation": [ " A call was dispatched from the given account. The bool signals whether it was", " successful execution or not." ] @@ -3041,7 +3041,7 @@ "PlainType": "AccountId" }, "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", - "docs": [] + "documentation": [] } ], "calls": [ @@ -3053,7 +3053,7 @@ "type": "Proposal" } ], - "docs": [] + "documentation": [] }, { "name": "set_key", @@ -3063,7 +3063,7 @@ "type": "Address" } ], - "docs": [] + "documentation": [] } ], "events": [ @@ -3072,7 +3072,7 @@ "args": [ "bool" ], - "docs": [ + "documentation": [ " A sudo just took place." ] }, @@ -3081,7 +3081,7 @@ "args": [ "AccountId" ], - "docs": [ + "documentation": [ " The sudoer just switched identity; the old key is supplied." ] } diff --git a/packages/types/src/Metadata/v3/Metadata.ts b/packages/types/src/Metadata/v3/Metadata.ts index ec65474759..5f2409703b 100644 --- a/packages/types/src/Metadata/v3/Metadata.ts +++ b/packages/types/src/Metadata/v3/Metadata.ts @@ -12,7 +12,7 @@ import { flattenUniq, validateTypes } from '../util'; import { MetadataCall } from '../v1/Calls'; import { MetadataEvent } from '../v1/Events'; -import { MetadataStorage } from './Storage'; +import { StorageFunctionMetadata } from './Storage'; /** * @name MetadataModule @@ -24,7 +24,7 @@ export class MetadataModule extends Struct { super({ name: Text, prefix: Text, - storage: Option.with(Vector.with(MetadataStorage)), + storage: Option.with(Vector.with(StorageFunctionMetadata)), calls: Option.with(Vector.with(MetadataCall)), events: Option.with(Vector.with(MetadataEvent)) }, value); @@ -61,8 +61,8 @@ export class MetadataModule extends Struct { /** * @description the associated module storage */ - get storage (): Option> { - return this.get('storage') as Option>; + get storage (): Option> { + return this.get('storage') as Option>; } } diff --git a/packages/types/src/Metadata/v3/Storage.ts b/packages/types/src/Metadata/v3/Storage.ts index 926ef94628..5537aceb6d 100644 --- a/packages/types/src/Metadata/v3/Storage.ts +++ b/packages/types/src/Metadata/v3/Storage.ts @@ -2,34 +2,168 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +import { AnyNumber } from '../../types'; + +import EnumType from '../../codec/EnumType'; import Struct from '../../codec/Struct'; import Vector from '../../codec/Vector'; import Bytes from '../../primitive/Bytes'; import Text from '../../primitive/Text'; -import { MetadataStorageModifier } from '../v1/Storage'; -import { MetadataStorageType } from '../v2/Storage'; +import { + MapType, + PlainType, + StorageFunctionModifier +} from '../v2/Storage'; + +// Re-export classes that haven't changed between V2 and V3 +export { + MapType, + PlainType, + StorageFunctionModifier +}; + +export class DoubleMapType extends Struct { + constructor (value?: any) { + super({ + key1: Text, + key2: Text, + value: Text, + key2Hasher: Text + }, value); + } + + /** + * @description The mapped key as [[Text]] + */ + get key1 (): Text { + return this.get('key1') as Text; + } + + /** + * @description The mapped key as [[Text]] + */ + get key2 (): Text { + return this.get('key2') as Text; + } + + /** + * @description The hashing algorithm used to hash key2, as [[Text]] + */ + get key2Hasher (): Text { + return this.get('key2Hasher') as Text; + } + + /** + * @description The mapped key as [[Text]] + */ + get value (): Text { + return this.get('value') as Text; + } +} + +export class StorageFunctionType extends EnumType { + constructor (value?: any, index?: number) { + super({ + PlainType, + MapType, + DoubleMapType + }, value, index); + } + + /** + * @description The value as a mapped value + */ + get asDoubleMap (): DoubleMapType { + return this.value as DoubleMapType; + } + + /** + * @description The value as a mapped value + */ + get asMap (): MapType { + return this.value as MapType; + } + + /** + * @description The value as a [[Type]] value + */ + get asType (): PlainType { + return this.value as PlainType; + } + + /** + * @description `true` if the storage entry is a doublemap + */ + get isDoubleMap (): boolean { + return this.toNumber() === 2; + } + + /** + * @description `true` if the storage entry is a map + */ + get isMap (): boolean { + return this.toNumber() === 1; + } + + /** + * @description Returns the string representation of the value + */ + toString (): string { + if (this.isDoubleMap) { + return this.asDoubleMap.toString(); + } + + return this.isMap + ? this.asMap.value.toString() + : this.asType.toString(); + } +} + +export type StorageFunctionMetadataValue = { + name: string | Text, + modifier: StorageFunctionModifier | AnyNumber, + type: StorageFunctionType, + fallback: Bytes, + documentation: Vector | Array +}; /** - * @name MetadataModule + * @name StorageFunctionMetadata * @description * The definition of a storage function */ -export class MetadataStorage extends Struct { - constructor (value?: any) { +export class StorageFunctionMetadata extends Struct { + constructor (value?: StorageFunctionMetadataValue | Uint8Array) { super({ name: Text, - modifier: MetadataStorageModifier, - type: MetadataStorageType, + modifier: StorageFunctionModifier, + type: StorageFunctionType, fallback: Bytes, - docs: Vector.with(Text) + documentation: Vector.with(Text) }, value); } + /** + * @description The default value of the storage function + * @deprecated Use `.fallback` instead. + */ + get default (): Bytes { + return this.fallback; + } + /** * @description The [[Text]] documentation */ + get documentation (): Vector { + return this.get('documentation') as Vector; + } + + /** + * @description The [[Text]] documentation + * @deprecated Use `.documentation` instead. + */ get docs (): Vector { - return this.get('docs') as Vector; + return this.documentation; } /** @@ -42,8 +176,8 @@ export class MetadataStorage extends Struct { /** * @description The [[MetadataArgument]] for arguments */ - get modifier (): MetadataStorageModifier { - return this.get('modifier') as MetadataStorageModifier; + get modifier (): StorageFunctionModifier { + return this.get('modifier') as StorageFunctionModifier; } /** @@ -54,9 +188,9 @@ export class MetadataStorage extends Struct { } /** - * @description The [[MetadataStorageType]] + * @description The [[StorageFunctionType]] */ - get type (): MetadataStorageType { - return this.get('type') as MetadataStorageType; + get type (): StorageFunctionType { + return this.get('type') as StorageFunctionType; } } diff --git a/packages/types/src/Metadata/v3/latest.substrate.v3.json b/packages/types/src/Metadata/v3/latest.substrate.v3.json index 792928382e..661634df24 100644 --- a/packages/types/src/Metadata/v3/latest.substrate.v3.json +++ b/packages/types/src/Metadata/v3/latest.substrate.v3.json @@ -18,7 +18,7 @@ } }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " Extrinsics nonce for accounts." ] }, @@ -29,7 +29,7 @@ "PlainType": "u32" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Total extrinsics count for the current block." ] }, @@ -40,7 +40,7 @@ "PlainType": "u32" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Total length in bytes for all extrinsics put together, for the current block." ] }, @@ -55,7 +55,7 @@ } }, "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", - "docs": [ + "documentation": [ " Map of block numbers to block hashes." ] }, @@ -70,7 +70,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Extrinsics data for the current block (maps extrinsic's index to its data)." ] }, @@ -81,7 +81,7 @@ "PlainType": "Hash" }, "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", - "docs": [ + "documentation": [ " Random seed of the current block." ] }, @@ -92,7 +92,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " The current block number being processed. Set by `execute_block`." ] }, @@ -103,7 +103,7 @@ "PlainType": "Hash" }, "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", - "docs": [ + "documentation": [ " Hash of the previous block." ] }, @@ -114,7 +114,7 @@ "PlainType": "Hash" }, "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", - "docs": [ + "documentation": [ " Extrinsics root of the current block, also part of the block header." ] }, @@ -125,7 +125,7 @@ "PlainType": "Digest" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Digest of the current block, also part of the block header." ] }, @@ -136,7 +136,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Events deposited for the current block." ] } @@ -146,14 +146,14 @@ { "name": "ExtrinsicSuccess", "args": [], - "docs": [ + "documentation": [ " An extrinsic completed successfully." ] }, { "name": "ExtrinsicFailed", "args": [], - "docs": [ + "documentation": [ " An extrinsic failed." ] } @@ -177,7 +177,7 @@ "PlainType": "Moment" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " Current time for the current block." ] }, @@ -188,7 +188,7 @@ "PlainType": "Moment" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Old storage item provided for compatibility. Remove after all networks upgraded." ] }, @@ -199,7 +199,7 @@ "PlainType": "Moment" }, "fallback": "0x0300000000000000", - "docs": [ + "documentation": [ " The minimum period between blocks. Beware that this is different to the *expected* period", " that the block production apparatus provides. Your chosen consensus system will generally", " work with this to determine a sensible block time. e.g. For Aura, it will be double this", @@ -213,7 +213,7 @@ "PlainType": "bool" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Did the timestamp get updated in this block?" ] } @@ -227,7 +227,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the current time.", "", " This call should be invoked exactly once per block. It will panic at the finalization phase,", @@ -252,7 +252,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [] + "documentation": [] } ], "calls": [ @@ -264,7 +264,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Report some misbehavior." ] }, @@ -276,7 +276,7 @@ "type": "InherentOfflineReport" } ], - "docs": [ + "documentation": [ " Note the previous block's validator missed their opportunity to propose a block." ] }, @@ -288,7 +288,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Make some on-chain remark." ] }, @@ -300,7 +300,7 @@ "type": "u64" } ], - "docs": [ + "documentation": [ " Set the number of pages in the WebAssembly environment's heap." ] }, @@ -312,7 +312,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Set the new code." ] }, @@ -324,7 +324,7 @@ "type": "Vec" } ], - "docs": [ + "documentation": [ " Set some items of storage." ] }, @@ -336,7 +336,7 @@ "type": "Vec" } ], - "docs": [ + "documentation": [ " Kill some items from storage." ] } @@ -354,7 +354,7 @@ "PlainType": "AccountIndex" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The next free enumeration set." ] }, @@ -369,7 +369,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The enumeration sets." ] } @@ -382,7 +382,7 @@ "AccountId", "AccountIndex" ], - "docs": [ + "documentation": [ " A new account index was assigned.", "", " This event is not triggered when an existing index is reassigned", @@ -402,7 +402,7 @@ "PlainType": "Balance" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The total units issued in the system." ] }, @@ -413,7 +413,7 @@ "PlainType": "Balance" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The minimum amount required to keep an account open." ] }, @@ -424,7 +424,7 @@ "PlainType": "Balance" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The fee required to make a transfer." ] }, @@ -435,7 +435,7 @@ "PlainType": "Balance" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The fee required to create an account." ] }, @@ -446,7 +446,7 @@ "PlainType": "Balance" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The fee to be paid for making a transaction; the base." ] }, @@ -457,7 +457,7 @@ "PlainType": "Balance" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The fee to be paid for making a transaction; the per-byte portion." ] }, @@ -472,7 +472,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Information regarding the vesting of a given account." ] }, @@ -487,7 +487,7 @@ } }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The 'free' balance of a given account.", "", " This is the only balance that matters in terms of most operations on tokens. It", @@ -512,7 +512,7 @@ } }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The amount of the balance of a given account that is externally reserved; this can still get", " slashed, but gets slashed last of all.", "", @@ -537,7 +537,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Any liquidity locks on some account balances." ] } @@ -555,7 +555,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Transfer some liquid free balance to another account.", "", " `transfer` will set the `FreeBalance` of the sender and receiver.", @@ -582,7 +582,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the balances of a given account.", "", " This will alter `FreeBalance` and `ReservedBalance` in storage.", @@ -601,7 +601,7 @@ "AccountId", "Balance" ], - "docs": [ + "documentation": [ " A new account was created." ] }, @@ -610,7 +610,7 @@ "args": [ "AccountId" ], - "docs": [ + "documentation": [ " An account was reaped." ] }, @@ -622,7 +622,7 @@ "Balance", "Balance" ], - "docs": [ + "documentation": [ " Transfer succeeded (from, to, value, fees)." ] } @@ -639,7 +639,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The current set of validators." ] }, @@ -650,7 +650,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " Current length of the session." ] }, @@ -661,7 +661,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " Current index of the session." ] }, @@ -672,7 +672,7 @@ "PlainType": "Moment" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " Timestamp when current session started." ] }, @@ -683,7 +683,7 @@ "PlainType": "bool" }, "fallback": "0x00", - "docs": [ + "documentation": [ " New session is being forced is this entry exists; in which case, the boolean value is whether", " the new session should be considered a normal rotation (rewardable) or exceptional (slashable)." ] @@ -695,7 +695,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Block at which the session length last changed." ] }, @@ -710,7 +710,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The next key for a given validator." ] }, @@ -721,7 +721,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The next session length." ] } @@ -735,7 +735,7 @@ "type": "SessionKey" } ], - "docs": [ + "documentation": [ " Sets the session key of `_validator` to `_key`. This doesn't take effect until the next", " session." ] @@ -748,7 +748,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set a new session length. Won't kick in until the next session change (at current length)." ] }, @@ -760,7 +760,7 @@ "type": "bool" } ], - "docs": [ + "documentation": [ " Forces a new session." ] } @@ -771,7 +771,7 @@ "args": [ "BlockNumber" ], - "docs": [ + "documentation": [ " New session has happened. Note that the argument is the session index, not the block", " number as the type might suggest." ] @@ -789,7 +789,7 @@ "PlainType": "u32" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The ideal number of staking participants." ] }, @@ -800,7 +800,7 @@ "PlainType": "u32" }, "fallback": "0x04000000", - "docs": [ + "documentation": [ " Minimum number of staking participants before emergency conditions are imposed." ] }, @@ -811,7 +811,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " The length of a staking era in sessions." ] }, @@ -822,7 +822,7 @@ "PlainType": "Perbill" }, "fallback": "0x3c000000", - "docs": [ + "documentation": [ " Maximum reward, per validator, that is provided per acceptable session." ] }, @@ -833,7 +833,7 @@ "PlainType": "Perbill" }, "fallback": "0x40420f00", - "docs": [ + "documentation": [ " Slash, per validator that is taken for the first time they are found to be offline." ] }, @@ -844,7 +844,7 @@ "PlainType": "u32" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " Number of instances of offline reports before slashing begins for validators." ] }, @@ -855,7 +855,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " The length of the bonding duration in blocks." ] }, @@ -866,7 +866,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Any validators that may never be slashed or forcibly kicked. It's a Vec since they're easy to initialize", " and the performance hit is minimal (we expect no more than four invulnerables) and restricted to testnets." ] @@ -882,7 +882,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Map from all locked \"stash\" accounts to the controller account." ] }, @@ -897,7 +897,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Map from all (unlocked) \"controller\" accounts to the info regarding the staking." ] }, @@ -912,7 +912,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Where the reward payment should be made. Keyed by stash." ] }, @@ -927,7 +927,7 @@ } }, "fallback": "0x0c00", - "docs": [ + "documentation": [ " The map from (wannabe) validator stash key to the preferences of that validator." ] }, @@ -942,7 +942,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The map from nominator stash key to the set of stash keys of all validators to nominate." ] }, @@ -957,7 +957,7 @@ } }, "fallback": "0x000000", - "docs": [ + "documentation": [ " Nominators for a particular account that is in action right now. You can't iterate through validators here,", " but you can find them in the `sessions` module.", "", @@ -971,7 +971,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The currently elected validator set keyed by stash account ID." ] }, @@ -982,7 +982,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " The current era index." ] }, @@ -993,7 +993,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " Maximum reward, per validator, that is provided per acceptable session." ] }, @@ -1004,7 +1004,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The accumulated reward for the current era. Reset to zero at the beginning of the era and", " increased for every successfully finished session." ] @@ -1016,7 +1016,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The next value of sessions per era." ] }, @@ -1027,7 +1027,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " The session index at which the era length last changed." ] }, @@ -1038,7 +1038,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The amount of balance actively at stake for each validator slot, currently.", "", " This is used to derive rewards and punishments." @@ -1055,7 +1055,7 @@ } }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The number of times a given validator has been reported offline. This gets decremented by one each era that passes." ] }, @@ -1066,7 +1066,7 @@ "PlainType": "Null" }, "fallback": "0x00", - "docs": [ + "documentation": [ " We are forcing a new era." ] }, @@ -1077,7 +1077,7 @@ "PlainType": "Vec<(AccountId,BlockNumber,u32)>" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Most recent `RECENT_OFFLINE_COUNT` instances. (who it was, when it was reported, how many instances they were offline for)." ] } @@ -1099,7 +1099,7 @@ "type": "RewardDestination" } ], - "docs": [ + "documentation": [ " Take the origin account as a stash and lock up `value` of its balance. `controller` will be the", " account that controls it.", "", @@ -1114,7 +1114,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Add some extra amount that have appeared in the stash `free_balance` into the balance up for", " staking.", "", @@ -1131,7 +1131,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Schedule a portion of the stash to be unlocked ready for transfer out after the bond", " period ends. If this leaves an amount actively bonded less than", " T::Currency::existential_deposit(), then it is increased to the full amount.", @@ -1147,7 +1147,7 @@ { "name": "withdraw_unbonded", "args": [], - "docs": [ + "documentation": [ " Remove any unlocked chunks from the `unlocking` queue from our management.", "", " This essentially frees up that balance to be used by the stash account to do", @@ -1166,7 +1166,7 @@ "type": "ValidatorPrefs" } ], - "docs": [ + "documentation": [ " Declare the desire to validate for the origin controller.", "", " Effects will be felt at the beginning of the next era.", @@ -1182,7 +1182,7 @@ "type": "Vec
" } ], - "docs": [ + "documentation": [ " Declare the desire to nominate `targets` for the origin controller.", "", " Effects will be felt at the beginning of the next era.", @@ -1193,7 +1193,7 @@ { "name": "chill", "args": [], - "docs": [ + "documentation": [ " Declare no desire to either validate or nominate.", "", " Effects will be felt at the beginning of the next era.", @@ -1209,7 +1209,7 @@ "type": "RewardDestination" } ], - "docs": [ + "documentation": [ " (Re-)set the payment target for a controller.", "", " Effects will be felt at the beginning of the next era.", @@ -1225,7 +1225,7 @@ "type": "Address" } ], - "docs": [ + "documentation": [ " (Re-)set the payment target for a controller.", "", " Effects will be felt at the beginning of the next era.", @@ -1241,7 +1241,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the number of sessions in an era." ] }, @@ -1253,7 +1253,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " The length of the bonding duration in eras." ] }, @@ -1265,7 +1265,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " The ideal number of validators." ] }, @@ -1277,7 +1277,7 @@ "type": "bool" } ], - "docs": [ + "documentation": [ " Force there to be a new era. This also forces a new session immediately after.", " `apply_rewards` should be true for validators to get the session reward." ] @@ -1290,7 +1290,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the offline slash grace period." ] }, @@ -1302,7 +1302,7 @@ "type": "Vec" } ], - "docs": [ + "documentation": [ " Set the validators who cannot be slashed (if any)." ] } @@ -1313,7 +1313,7 @@ "args": [ "Balance" ], - "docs": [ + "documentation": [ " All validators have been rewarded by the given balance." ] }, @@ -1323,7 +1323,7 @@ "AccountId", "u32" ], - "docs": [ + "documentation": [ " One validator (and their nominators) has been given a offline-warning (they're still", " within their grace). The accrued number of slashes is recorded, too." ] @@ -1334,7 +1334,7 @@ "AccountId", "Balance" ], - "docs": [ + "documentation": [ " One validator (and their nominators) has been slashed by the given amount." ] } @@ -1351,7 +1351,7 @@ "PlainType": "PropIndex" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The number of (public) proposals that have been made so far." ] }, @@ -1362,7 +1362,7 @@ "PlainType": "Vec<(PropIndex,Proposal,AccountId)>" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The public proposals. Unsorted." ] }, @@ -1377,7 +1377,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Those who have locked a deposit." ] }, @@ -1388,7 +1388,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " How often (in blocks) new public referenda are launched." ] }, @@ -1399,7 +1399,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The minimum amount to be used as a deposit for a public referendum proposal." ] }, @@ -1410,7 +1410,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " The delay before enactment for all public referenda." ] }, @@ -1421,7 +1421,7 @@ "PlainType": "LockPeriods" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The maximum number of additional lock periods a voter may offer to strengthen their vote. Multiples of `PublicDelay`." ] }, @@ -1432,7 +1432,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " How often (in blocks) to check for new votes." ] }, @@ -1443,7 +1443,7 @@ "PlainType": "ReferendumIndex" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The next free referendum index, aka the number of referendums started so far." ] }, @@ -1454,7 +1454,7 @@ "PlainType": "ReferendumIndex" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The next referendum index that should be tallied." ] }, @@ -1469,7 +1469,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Information concerning any given referendum." ] }, @@ -1484,7 +1484,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Queue of successful referenda to be dispatched." ] }, @@ -1499,7 +1499,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Get the voters for the current proposal." ] }, @@ -1514,7 +1514,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Get the vote in a given referendum of a particular voter. The result is meaningful only if `voters_for` includes the", " voter when called with the referendum (you'll get the default `Vote` value otherwise). If you don't want to check", " `voters_for`, then you can also check for simple existence with `VoteOf::exists` first." @@ -1531,7 +1531,7 @@ } }, "fallback": "0x000000000000000000000000000000000000000000000000000000000000000000", - "docs": [ + "documentation": [ " Get the account (and lock periods) to which another account is delegating vote." ] } @@ -1549,7 +1549,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Propose a sensitive action to be taken." ] }, @@ -1561,7 +1561,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Propose a sensitive action to be taken." ] }, @@ -1577,7 +1577,7 @@ "type": "Vote" } ], - "docs": [ + "documentation": [ " Vote in a referendum. If `vote.is_aye()`, the vote is to enact the proposal;", " otherwise it is a vote to keep the status quo." ] @@ -1598,7 +1598,7 @@ "type": "BlockNumber" } ], - "docs": [ + "documentation": [ " Start a referendum." ] }, @@ -1610,7 +1610,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Remove a referendum." ] }, @@ -1626,7 +1626,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Cancel a proposal queued for enactment." ] }, @@ -1642,14 +1642,14 @@ "type": "LockPeriods" } ], - "docs": [ + "documentation": [ " Delegate vote." ] }, { "name": "undelegate", "args": [], - "docs": [ + "documentation": [ " Undelegate vote." ] } @@ -1661,7 +1661,7 @@ "PropIndex", "Balance" ], - "docs": [] + "documentation": [] }, { "name": "Tabled", @@ -1670,7 +1670,7 @@ "Balance", "Vec" ], - "docs": [] + "documentation": [] }, { "name": "Started", @@ -1678,28 +1678,28 @@ "ReferendumIndex", "VoteThreshold" ], - "docs": [] + "documentation": [] }, { "name": "Passed", "args": [ "ReferendumIndex" ], - "docs": [] + "documentation": [] }, { "name": "NotPassed", "args": [ "ReferendumIndex" ], - "docs": [] + "documentation": [] }, { "name": "Cancelled", "args": [ "ReferendumIndex" ], - "docs": [] + "documentation": [] }, { "name": "Executed", @@ -1707,7 +1707,7 @@ "ReferendumIndex", "bool" ], - "docs": [] + "documentation": [] }, { "name": "Delegated", @@ -1715,14 +1715,14 @@ "AccountId", "AccountId" ], - "docs": [] + "documentation": [] }, { "name": "Undelegated", "args": [ "AccountId" ], - "docs": [] + "documentation": [] } ] }, @@ -1737,7 +1737,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x09000000000000000000000000000000", - "docs": [ + "documentation": [ " How much should be locked up in order to submit one's candidacy." ] }, @@ -1748,7 +1748,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " How much should be locked up in order to be able to submit votes." ] }, @@ -1759,7 +1759,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x01000000000000000000000000000000", - "docs": [ + "documentation": [ " The punishment, per voter, if you provide an invalid presentation." ] }, @@ -1770,7 +1770,7 @@ "PlainType": "u32" }, "fallback": "0x02000000", - "docs": [ + "documentation": [ " How many runners-up should have their approvals persist until the next vote." ] }, @@ -1781,7 +1781,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " How long to give each top candidate to present themselves after the vote ends." ] }, @@ -1792,7 +1792,7 @@ "PlainType": "VoteIndex" }, "fallback": "0x01000000", - "docs": [ + "documentation": [ " How many vote indexes need to go by after a target voter's last vote before they can be reaped if their", " approvals are moot." ] @@ -1804,7 +1804,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [ + "documentation": [ " How often (in blocks) to check for new votes." ] }, @@ -1815,7 +1815,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0500000000000000", - "docs": [ + "documentation": [ " How long each position is active for." ] }, @@ -1826,7 +1826,7 @@ "PlainType": "u32" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " Number of accounts that should be sitting on the council." ] }, @@ -1837,7 +1837,7 @@ "PlainType": "Vec<(AccountId,BlockNumber)>" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The current council. When there's a vote going on, this should still be used for executive", " matters. The block number (second element in the tuple) is the block that their position is", " active until (calculated by the sum of the block number when the council member was elected", @@ -1851,7 +1851,7 @@ "PlainType": "VoteIndex" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " The total number of votes that have happened or are in progress." ] }, @@ -1866,7 +1866,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " A list of votes for each voter, respecting the last cleared vote index that this voter was", " last active at." ] @@ -1882,7 +1882,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The vote index and list slot that the candidate `who` was registered or `None` if they are not", " currently registered." ] @@ -1898,7 +1898,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The last cleared vote index that this voter was last active at." ] }, @@ -1909,7 +1909,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The present voter list." ] }, @@ -1920,7 +1920,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The present candidate list." ] }, @@ -1931,7 +1931,7 @@ "PlainType": "u32" }, "fallback": "0x00000000", - "docs": [] + "documentation": [] }, { "name": "NextFinalize", @@ -1940,7 +1940,7 @@ "PlainType": "(BlockNumber,u32,Vec)" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The accounts holding the seats that will become free on the next tally." ] }, @@ -1951,7 +1951,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The stakes as they were at the point that the vote ended." ] }, @@ -1962,7 +1962,7 @@ "PlainType": "Vec<(BalanceOf,AccountId)>" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Get the leaderboard if we;re in the presentation phase." ] } @@ -1980,7 +1980,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set candidate approvals. Approval slots stay valid as long as candidates in those slots", " are registered." ] @@ -2005,7 +2005,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Remove a voter. For it not to be a bond-consuming no-op, all approved candidate indices", " must now be either unregistered or registered to a candidate that registered the slot after", " the voter gave their last approval set.", @@ -2021,7 +2021,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Remove a voter. All votes are cancelled and the voter deposit is returned." ] }, @@ -2033,7 +2033,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Submit oneself for candidacy.", "", " Account must have enough transferrable funds in it to pay the bond." @@ -2055,7 +2055,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Claim that `signed` is one of the top Self::carry_count() + current_vote().1 candidates.", " Only works if the `block_number >= current_vote().0` and `< current_vote().0 + presentation_duration()``", " `signed` should have at least" @@ -2069,7 +2069,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the desired member count; if lower than the current count, then seats will not be up", " election when they expire. If more, then a new vote will be started if one is not already", " in progress." @@ -2083,7 +2083,7 @@ "type": "Address" } ], - "docs": [ + "documentation": [ " Remove a particular member. A tally will happen instantly (if not already in a presentation", " period) to fill the seat if removal means that the desired members are not met.", " This is effective immediately." @@ -2097,7 +2097,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the presentation duration. If there is currently a vote being presented for, will", " invoke `finalize_vote`." ] @@ -2110,7 +2110,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the presentation duration. If there is current a vote being presented for, will", " invoke `finalize_vote`." ] @@ -2123,7 +2123,7 @@ "AccountId", "AccountId" ], - "docs": [ + "documentation": [ " reaped voter, reaper" ] }, @@ -2132,7 +2132,7 @@ "args": [ "AccountId" ], - "docs": [ + "documentation": [ " slashed reaper" ] }, @@ -2141,7 +2141,7 @@ "args": [ "u32" ], - "docs": [ + "documentation": [ " A tally (for approval votes of council seat(s)) has started." ] }, @@ -2151,7 +2151,7 @@ "Vec", "Vec" ], - "docs": [ + "documentation": [ " A tally (for approval votes of council seat(s)) has ended (with one or more new members)." ] } @@ -2168,7 +2168,7 @@ "PlainType": "BlockNumber" }, "fallback": "0xe803000000000000", - "docs": [] + "documentation": [] }, { "name": "VotingPeriod", @@ -2177,7 +2177,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0300000000000000", - "docs": [] + "documentation": [] }, { "name": "EnactDelayPeriod", @@ -2186,7 +2186,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " Number of blocks by which to delay enactment of successful, non-unanimous-council-instigated referendum proposals." ] }, @@ -2197,7 +2197,7 @@ "PlainType": "Vec<(BlockNumber,Hash)>" }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "ProposalOf", @@ -2210,7 +2210,7 @@ } }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "ProposalVoters", @@ -2223,7 +2223,7 @@ } }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "CouncilVoteOf", @@ -2236,7 +2236,7 @@ } }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "VetoedProposal", @@ -2249,7 +2249,7 @@ } }, "fallback": "0x00", - "docs": [] + "documentation": [] } ], "calls": [ @@ -2261,7 +2261,7 @@ "type": "Proposal" } ], - "docs": [] + "documentation": [] }, { "name": "vote", @@ -2275,7 +2275,7 @@ "type": "bool" } ], - "docs": [] + "documentation": [] }, { "name": "veto", @@ -2285,7 +2285,7 @@ "type": "Hash" } ], - "docs": [] + "documentation": [] }, { "name": "set_cooloff_period", @@ -2295,7 +2295,7 @@ "type": "Compact" } ], - "docs": [] + "documentation": [] }, { "name": "set_voting_period", @@ -2305,7 +2305,7 @@ "type": "Compact" } ], - "docs": [] + "documentation": [] } ], "events": [ @@ -2317,7 +2317,7 @@ "u32", "u32" ], - "docs": [ + "documentation": [ " A voting tally has happened for a referendum cancellation vote.", " Last three are yes, no, abstain counts." ] @@ -2330,7 +2330,7 @@ "u32", "u32" ], - "docs": [ + "documentation": [ " A voting tally has happened for a referendum vote.", " Last three are yes, no, abstain counts." ] @@ -2348,7 +2348,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " The (hashes of) the active proposals." ] }, @@ -2363,7 +2363,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Actual proposal for a given hash, if it's current." ] }, @@ -2378,7 +2378,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Votes for a given proposal: (required_yes_votes, yes_voters, no_voters)." ] }, @@ -2389,7 +2389,7 @@ "PlainType": "u32" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " Proposals so far." ] } @@ -2407,7 +2407,7 @@ "type": "Proposal" } ], - "docs": [] + "documentation": [] }, { "name": "vote", @@ -2425,7 +2425,7 @@ "type": "bool" } ], - "docs": [] + "documentation": [] } ], "events": [ @@ -2437,7 +2437,7 @@ "Hash", "u32" ], - "docs": [ + "documentation": [ " A motion (given hash) has been proposed (by given account) with a threshold (given u32)." ] }, @@ -2450,7 +2450,7 @@ "u32", "u32" ], - "docs": [ + "documentation": [ " A motion (given hash) has been voted on by given account, leaving", " a tally (yes votes and no votes given as u32s respectively)." ] @@ -2460,7 +2460,7 @@ "args": [ "Hash" ], - "docs": [ + "documentation": [ " A motion was approved by the required threshold." ] }, @@ -2469,7 +2469,7 @@ "args": [ "Hash" ], - "docs": [ + "documentation": [ " A motion was not approved by the required threshold." ] }, @@ -2479,7 +2479,7 @@ "Hash", "bool" ], - "docs": [ + "documentation": [ " A motion was executed; `bool` is true if returned without error." ] } @@ -2498,7 +2498,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Hint that the author of this block thinks the best finalized", " block is the given number." ] @@ -2517,7 +2517,7 @@ "PlainType": "StoredPendingChange" }, "fallback": "0x00", - "docs": [] + "documentation": [] }, { "name": "NextForced", @@ -2526,7 +2526,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x00", - "docs": [] + "documentation": [] } ], "calls": [ @@ -2538,7 +2538,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Report some misbehavior." ] } @@ -2549,7 +2549,7 @@ "args": [ "Vec<(SessionKey,u64)>" ], - "docs": [ + "documentation": [ " New authority set has been applied." ] } @@ -2566,7 +2566,7 @@ "PlainType": "Permill" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " Proportion of funds that should be bonded in order to place a proposal. An accepted", " proposal gets these back. A rejected proposal doesn't." ] @@ -2578,7 +2578,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " Minimum amount of funds that should be placed in a deposit for making a proposal." ] }, @@ -2589,7 +2589,7 @@ "PlainType": "BlockNumber" }, "fallback": "0x0100000000000000", - "docs": [ + "documentation": [ " Period between successive spends." ] }, @@ -2600,7 +2600,7 @@ "PlainType": "Permill" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " Percentage of spare funds (if any) that are burnt per spend period." ] }, @@ -2611,7 +2611,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " Total funds available to this module for spending." ] }, @@ -2622,7 +2622,7 @@ "PlainType": "ProposalIndex" }, "fallback": "0x00000000", - "docs": [ + "documentation": [ " Number of proposals that have been made." ] }, @@ -2637,7 +2637,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " Proposals that have been made." ] }, @@ -2648,7 +2648,7 @@ "PlainType": "Vec" }, "fallback": "0x00", - "docs": [ + "documentation": [ " Proposal indices that have been approved but not yet awarded." ] } @@ -2666,7 +2666,7 @@ "type": "Address" } ], - "docs": [ + "documentation": [ " Put forward a suggestion for spending. A deposit proportional to the value", " is reserved and slashed if the proposal is rejected. It is returned once the", " proposal is awarded." @@ -2680,7 +2680,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Set the balance of funds available to spend." ] }, @@ -2704,7 +2704,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " (Re-)configure this module." ] }, @@ -2716,7 +2716,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Reject a proposed spend. The original deposit will be slashed." ] }, @@ -2728,7 +2728,7 @@ "type": "Compact" } ], - "docs": [ + "documentation": [ " Approve a proposal. At a later time, the proposal will be allocated to the beneficiary", " and the original deposit will be returned." ] @@ -2740,7 +2740,7 @@ "args": [ "ProposalIndex" ], - "docs": [ + "documentation": [ " New proposal." ] }, @@ -2749,7 +2749,7 @@ "args": [ "Balance" ], - "docs": [ + "documentation": [ " We have ended a spend period and will now allocate funds." ] }, @@ -2760,7 +2760,7 @@ "Balance", "AccountId" ], - "docs": [ + "documentation": [ " Some funds have been allocated." ] }, @@ -2769,7 +2769,7 @@ "args": [ "Balance" ], - "docs": [ + "documentation": [ " Some of our funds have been burnt." ] }, @@ -2778,7 +2778,7 @@ "args": [ "Balance" ], - "docs": [ + "documentation": [ " Spending has finished; this is the amount that rolls over until next spend." ] } @@ -2795,7 +2795,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The fee required to make a transfer." ] }, @@ -2806,7 +2806,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The fee required to create an account." ] }, @@ -2817,7 +2817,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The fee to be paid for making a transaction; the base." ] }, @@ -2828,7 +2828,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x00000000000000000000000000000000", - "docs": [ + "documentation": [ " The fee to be paid for making a transaction; the per-byte portion." ] }, @@ -2839,7 +2839,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x15000000000000000000000000000000", - "docs": [ + "documentation": [ " The fee required to create a contract instance." ] }, @@ -2850,7 +2850,7 @@ "PlainType": "Gas" }, "fallback": "0x8700000000000000", - "docs": [ + "documentation": [ " The base fee charged for calling into a contract." ] }, @@ -2861,7 +2861,7 @@ "PlainType": "Gas" }, "fallback": "0xaf00000000000000", - "docs": [ + "documentation": [ " The base fee charged for creating a contract." ] }, @@ -2872,7 +2872,7 @@ "PlainType": "BalanceOf" }, "fallback": "0x01000000000000000000000000000000", - "docs": [ + "documentation": [ " The price of one unit of gas." ] }, @@ -2883,7 +2883,7 @@ "PlainType": "u32" }, "fallback": "0x64000000", - "docs": [ + "documentation": [ " The maximum nesting level of a call/create stack." ] }, @@ -2894,7 +2894,7 @@ "PlainType": "Gas" }, "fallback": "0x40420f0000000000", - "docs": [ + "documentation": [ " The maximum amount of gas that could be expended per block." ] }, @@ -2905,7 +2905,7 @@ "PlainType": "Gas" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " Gas spent so far in this block." ] }, @@ -2916,7 +2916,7 @@ "PlainType": "Schedule" }, "fallback": "0x000000000100000000000000010000000000000001000000000000000100000000000000010000000000000001000000000000000000010010000000", - "docs": [ + "documentation": [ " Current cost schedule for contracts." ] }, @@ -2931,7 +2931,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The code associated with a given account." ] }, @@ -2946,7 +2946,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " A mapping from an original code hash to the original code, untouched by instrumentation." ] }, @@ -2961,7 +2961,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " A mapping between an original code hash and instrumented wasm code, ready for the execution." ] }, @@ -2972,7 +2972,7 @@ "PlainType": "u64" }, "fallback": "0x0000000000000000", - "docs": [ + "documentation": [ " The subtrie counter" ] }, @@ -2987,7 +2987,7 @@ } }, "fallback": "0x00", - "docs": [ + "documentation": [ " The code associated with a given account." ] } @@ -3001,7 +3001,7 @@ "type": "Schedule" } ], - "docs": [ + "documentation": [ " Updates the schedule for metering contracts.", "", " The schedule must have a greater version than the stored schedule." @@ -3019,7 +3019,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Stores the given binary Wasm code into the chains storage and returns its `codehash`.", " You can instantiate contracts only with stored code." ] @@ -3044,7 +3044,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Makes a call to an account, optionally transferring some balance.", "", " * If the account is a smart-contract account, the associated code will be", @@ -3074,7 +3074,7 @@ "type": "Bytes" } ], - "docs": [ + "documentation": [ " Creates a new contract from the `codehash` generated by `put_code`, optionally transferring some balance.", "", " Creation is executed as follows:", @@ -3096,7 +3096,7 @@ "AccountId", "Balance" ], - "docs": [ + "documentation": [ " Transfer happened `from` to `to` with given `value` as part of a `call` or `create`." ] }, @@ -3106,7 +3106,7 @@ "AccountId", "AccountId" ], - "docs": [ + "documentation": [ " Contract deployed by address at the specified address." ] }, @@ -3115,7 +3115,7 @@ "args": [ "Hash" ], - "docs": [ + "documentation": [ " Code with the specified hash has been stored." ] }, @@ -3124,7 +3124,7 @@ "args": [ "u32" ], - "docs": [ + "documentation": [ " Triggered when the current schedule is updated." ] }, @@ -3134,7 +3134,7 @@ "AccountId", "bool" ], - "docs": [ + "documentation": [ " A call was dispatched from the given account. The bool signals whether it was", " successful execution or not." ] @@ -3152,7 +3152,7 @@ "PlainType": "AccountId" }, "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", - "docs": [] + "documentation": [] } ], "calls": [ @@ -3164,7 +3164,7 @@ "type": "Proposal" } ], - "docs": [] + "documentation": [] }, { "name": "set_key", @@ -3174,7 +3174,7 @@ "type": "Address" } ], - "docs": [] + "documentation": [] } ], "events": [ @@ -3183,7 +3183,7 @@ "args": [ "bool" ], - "docs": [ + "documentation": [ " A sudo just took place." ] }, @@ -3192,7 +3192,7 @@ "args": [ "AccountId" ], - "docs": [ + "documentation": [ " The sudoer just switched identity; the old key is supplied." ] } diff --git a/packages/types/src/Metadata/v4/Metadata.spec.ts b/packages/types/src/Metadata/v4/Metadata.spec.ts new file mode 100644 index 0000000000..331f90be60 --- /dev/null +++ b/packages/types/src/Metadata/v4/Metadata.spec.ts @@ -0,0 +1,22 @@ +// Copyright 2017-2019 @polkadot/types authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import Metadata from '../Metadata'; +import latestParsed from './latest.substrate.v4.json'; +import rpcData from './static'; + +describe('MetadataV4', () => { + const metadata = new Metadata(rpcData); + + it('decodes latest properly', () => { + const str = JSON.stringify(metadata.toJSON()); + + console.error(str); + console.error(metadata.getUniqTypes(true)); + + expect(metadata.version).toBe(4); + expect(metadata.asV4.modules.length).not.toBe(0); + expect(str).toEqual(JSON.stringify(latestParsed)); + }); +}); diff --git a/packages/types/src/Metadata/v4/Metadata.ts b/packages/types/src/Metadata/v4/Metadata.ts new file mode 100644 index 0000000000..c8dc530212 --- /dev/null +++ b/packages/types/src/Metadata/v4/Metadata.ts @@ -0,0 +1,130 @@ +// Copyright 2017-2019 @polkadot/types authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import { MetadataInterface } from '../types'; + +import Option from '../../codec/Option'; +import Struct from '../../codec/Struct'; +import Vector from '../../codec/Vector'; +import Text from '../../primitive/Text'; +import { flattenUniq, validateTypes } from '../util'; + +import { MetadataCall } from '../v1/Calls'; +import { MetadataEvent } from '../v1/Events'; +import { StorageFunctionMetadata } from './Storage'; + +/** + * @name MetadataModule + * @description + * The definition of a module in the system + */ +export class MetadataModule extends Struct { + constructor (value?: any) { + super({ + name: Text, + prefix: Text, + storage: Option.with(Vector.with(StorageFunctionMetadata)), + calls: Option.with(Vector.with(MetadataCall)), + events: Option.with(Vector.with(MetadataEvent)) + }, value); + } + + /** + * @description the module calls + */ + get calls (): Option> { + return this.get('calls') as Option>; + } + + /** + * @description the module events + */ + get events (): Option> { + return this.get('events') as Option>; + } + + /** + * @description the module name + */ + get name (): Text { + return this.get('name') as Text; + } + + /** + * @description the module prefix + */ + get prefix (): Text { + return this.get('prefix') as Text; + } + + /** + * @description the associated module storage + */ + get storage (): Option> { + return this.get('storage') as Option>; + } +} + +/** + * @name MetadataV4 + * @description + * The runtime metadata as a decoded structure + */ +export default class MetadataV4 extends Struct implements MetadataInterface { + constructor (value?: any) { + super({ + modules: Vector.with(MetadataModule) + }, value); + } + + /** + * @description The associated modules for this structure + */ + get modules (): Vector { + return this.get('modules') as Vector; + } + + private get callNames () { + return this.modules.map((mod) => + mod.calls.isNone + ? [] + : mod.calls.unwrap().map((fn) => + fn.args.map((arg) => arg.type.toString()) + ) + ); + } + + private get eventNames () { + return this.modules.map((mod) => + mod.events.isNone + ? [] + : mod.events.unwrap().map((event) => + event.args.map((arg) => arg.toString()) + ) + ); + } + + private get storageNames () { + return this.modules.map((mod) => + mod.storage.isNone + ? [] + : mod.storage.unwrap().map((fn) => + fn.type.isMap + ? [fn.type.asMap.key.toString(), fn.type.asMap.value.toString()] + : [fn.type.asType.toString()] + ) + ); + } + + /** + * @description Helper to retrieve a list of all type that are found, sorted and de-deuplicated + */ + getUniqTypes (throwError: boolean): Array { + const types = flattenUniq([this.callNames, this.eventNames, this.storageNames]); + + validateTypes(types, throwError); + + return types; + } +} diff --git a/packages/types/src/Metadata/v4/Storage.ts b/packages/types/src/Metadata/v4/Storage.ts new file mode 100644 index 0000000000..b1ad9183b0 --- /dev/null +++ b/packages/types/src/Metadata/v4/Storage.ts @@ -0,0 +1,290 @@ +// Copyright 2017-2019 @polkadot/types authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import { AnyNumber } from '../../types'; + +import Enum from '../../codec/Enum'; +import EnumType from '../../codec/EnumType'; +import Struct from '../../codec/Struct'; +import Vector from '../../codec/Vector'; +import Bool from '../../primitive/Bool'; +import Bytes from '../../primitive/Bytes'; +import Text from '../../primitive/Text'; +import Type from '../../primitive/Type'; +import { + PlainType, + StorageFunctionModifier +} from '../v3/Storage'; + +// Re-export classes that haven't changed between V3 and V4 +export { + PlainType, + StorageFunctionModifier +}; + +export class StorageHasher extends Enum { + constructor (value?: any) { + super(['Blake2_128', 'Blake2_256', 'Twox128', 'Twox256', 'Twox128Concat'], value); + } + + /** + * @description Is the enum Blake2_128? + */ + get isBlake2128 (): boolean { + return this.toNumber() === 0; + } + + /** + * @description Is the enum Blake2_256? + */ + get isBlake2256 (): boolean { + return this.toNumber() === 1; + } + + /** + * @description Is the enum Twox128? + */ + get isTwox128 (): boolean { + return this.toNumber() === 2; + } + + /** + * @description Is the enum Twox256? + */ + get isTwox256 (): boolean { + return this.toNumber() === 3; + } + + /** + * @description Is the enum isTwox128Concat? + */ + get isTwox128Concat (): boolean { + return this.toNumber() === 4; + } + + toJSON (): any { + // This looks prettier in the generated JSON + return this.toString(); + } +} + +export class MapType extends Struct { + constructor (value?: any) { + super({ + hasher: StorageHasher, + key: Type, + value: Type, + isLinked: Bool + }, value); + } + + /** + * @description The hash algorithm used to hash keys, as [[StorageHasher]] + */ + get hasher (): StorageHasher { + return this.get('hasher') as StorageHasher; + } + + /** + * @description Is this an enumerable linked map + */ + get isLinked (): boolean { + return (this.get('isLinked') as Bool).valueOf(); + } + + /** + * @description The mapped key as [[Type]] + */ + get key (): Type { + return this.get('key') as Type; + } + + /** + * @description The mapped value as [[Type]] + */ + get value (): Type { + return this.get('value') as Type; + } +} + +export class DoubleMapType extends Struct { + constructor (value?: any) { + super({ + hasher: StorageHasher, + key1: Text, + key2: Text, + value: Text, + key2Hasher: Text + }, value); + } + + /** + * @description The hashing algorithm used to hash keys, as [[Text]] + */ + get hasher (): Text { + return this.get('hasher') as Text; + } + + /** + * @description The mapped key as [[Text]] + */ + get key1 (): Text { + return this.get('key1') as Text; + } + + /** + * @description The mapped key as [[Text]] + */ + get key2 (): Text { + return this.get('key2') as Text; + } + + /** + * @description The hashing algorithm used to hash key2, as [[Text]] + */ + get key2Hasher (): Text { + return this.get('key2Hasher') as Text; + } + + /** + * @description The mapped key as [[Text]] + */ + get value (): Text { + return this.get('value') as Text; + } +} + +export class StorageFunctionType extends EnumType { + constructor (value?: any, index?: number) { + super({ + PlainType, + MapType, + DoubleMapType + }, value, index); + } + + /** + * @description The value as a mapped value + */ + get asDoubleMap (): DoubleMapType { + return this.value as DoubleMapType; + } + + /** + * @description The value as a mapped value + */ + get asMap (): MapType { + return this.value as MapType; + } + + /** + * @description The value as a [[Type]] value + */ + get asType (): PlainType { + return this.value as PlainType; + } + + /** + * @description `true` if the storage entry is a doublemap + */ + get isDoubleMap (): boolean { + return this.toNumber() === 2; + } + + /** + * @description `true` if the storage entry is a map + */ + get isMap (): boolean { + return this.toNumber() === 1; + } + + /** + * @description Returns the string representation of the value + */ + toString (): string { + if (this.isDoubleMap) { + return this.asDoubleMap.toString(); + } + + return this.isMap + ? this.asMap.value.toString() + : this.asType.toString(); + } +} + +export type StorageFunctionMetadataValue = { + name: string | Text, + modifier: StorageFunctionModifier | AnyNumber, + type: StorageFunctionType, + fallback: Bytes, + documentation: Vector | Array +}; + +/** + * @name StorageFunctionMetadata + * @description + * The definition of a storage function + */ +export class StorageFunctionMetadata extends Struct { + constructor (value?: StorageFunctionMetadataValue | Uint8Array) { + super({ + name: Text, + modifier: StorageFunctionModifier, + type: StorageFunctionType, + fallback: Bytes, + documentation: Vector.with(Text) + }, value); + } + + /** + * @description The default value of the storage function + * @deprecated Use `.fallback` instead. + */ + get default (): Bytes { + return this.fallback; + } + + /** + * @description The default value of the storage function + */ + get fallback (): Bytes { + return this.get('fallback') as Bytes; + } + + /** + * @description The [[Text]] documentation + */ + get documentation (): Vector { + return this.get('documentation') as Vector; + } + + /** + * @description The [[Text]] documentation + * @deprecated Use `.documentation` instead. + */ + get docs (): Vector { + return this.documentation; + } + + /** + * @description The key name + */ + get name (): Text { + return this.get('name') as Text; + } + + /** + * @description The modifier + */ + get modifier (): StorageFunctionModifier { + return this.get('modifier') as StorageFunctionModifier; + } + + /** + * @description The [[StorageFunctionType]] + */ + get type (): StorageFunctionType { + return this.get('type') as StorageFunctionType; + } +} diff --git a/packages/types/src/Metadata/v4/index.ts b/packages/types/src/Metadata/v4/index.ts new file mode 100644 index 0000000000..172f878da1 --- /dev/null +++ b/packages/types/src/Metadata/v4/index.ts @@ -0,0 +1,11 @@ +// Copyright 2017-2019 @polkadot/types authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import { default as MetadataV4, MetadataModule as MetadataModuleV4 } from './Metadata'; + +export default MetadataV4; + +export { + MetadataModuleV4 +}; diff --git a/packages/types/src/Metadata/v4/latest.substrate.v4.json b/packages/types/src/Metadata/v4/latest.substrate.v4.json new file mode 100644 index 0000000000..390dba9b0d --- /dev/null +++ b/packages/types/src/Metadata/v4/latest.substrate.v4.json @@ -0,0 +1,3341 @@ +{ + "magicNumber": 1635018093, + "metadata": { + "MetadataV4": { + "modules": [ + { + "name": "system", + "prefix": "System", + "storage": [ + { + "name": "AccountNonce", + "modifier": "Default", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "Index", + "isLinked": false + } + }, + "fallback": "0x0000000000000000", + "documentation": [ + " Extrinsics nonce for accounts." + ] + }, + { + "name": "ExtrinsicCount", + "modifier": "Optional", + "type": { + "PlainType": "u32" + }, + "fallback": "0x00", + "documentation": [ + " Total extrinsics count for the current block." + ] + }, + { + "name": "AllExtrinsicsLen", + "modifier": "Optional", + "type": { + "PlainType": "u32" + }, + "fallback": "0x00", + "documentation": [ + " Total length in bytes for all extrinsics put together, for the current block." + ] + }, + { + "name": "BlockHash", + "modifier": "Default", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "BlockNumber", + "value": "Hash", + "isLinked": false + } + }, + "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", + "documentation": [ + " Map of block numbers to block hashes." + ] + }, + { + "name": "ExtrinsicData", + "modifier": "Default", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "u32", + "value": "Bytes", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " Extrinsics data for the current block (maps extrinsic's index to its data)." + ] + }, + { + "name": "RandomSeed", + "modifier": "Default", + "type": { + "PlainType": "Hash" + }, + "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", + "documentation": [ + " Random seed of the current block." + ] + }, + { + "name": "Number", + "modifier": "Default", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0x0000000000000000", + "documentation": [ + " The current block number being processed. Set by `execute_block`." + ] + }, + { + "name": "ParentHash", + "modifier": "Default", + "type": { + "PlainType": "Hash" + }, + "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", + "documentation": [ + " Hash of the previous block." + ] + }, + { + "name": "ExtrinsicsRoot", + "modifier": "Default", + "type": { + "PlainType": "Hash" + }, + "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", + "documentation": [ + " Extrinsics root of the current block, also part of the block header." + ] + }, + { + "name": "Digest", + "modifier": "Default", + "type": { + "PlainType": "Digest" + }, + "fallback": "0x00", + "documentation": [ + " Digest of the current block, also part of the block header." + ] + }, + { + "name": "Events", + "modifier": "Default", + "type": { + "PlainType": "Vec" + }, + "fallback": "0x00", + "documentation": [ + " Events deposited for the current block." + ] + } + ], + "calls": null, + "events": [ + { + "name": "ExtrinsicSuccess", + "args": [], + "documentation": [ + " An extrinsic completed successfully." + ] + }, + { + "name": "ExtrinsicFailed", + "args": [], + "documentation": [ + " An extrinsic failed." + ] + } + ] + }, + { + "name": "aura", + "prefix": "", + "storage": null, + "calls": null, + "events": null + }, + { + "name": "timestamp", + "prefix": "Timestamp", + "storage": [ + { + "name": "Now", + "modifier": "Default", + "type": { + "PlainType": "Moment" + }, + "fallback": "0x0000000000000000", + "documentation": [ + " Current time for the current block." + ] + }, + { + "name": "BlockPeriod", + "modifier": "Optional", + "type": { + "PlainType": "Moment" + }, + "fallback": "0x00", + "documentation": [ + " Old storage item provided for compatibility. Remove after all networks upgraded." + ] + }, + { + "name": "MinimumPeriod", + "modifier": "Default", + "type": { + "PlainType": "Moment" + }, + "fallback": "0x0300000000000000", + "documentation": [ + " The minimum period between blocks. Beware that this is different to the *expected* period", + " that the block production apparatus provides. Your chosen consensus system will generally", + " work with this to determine a sensible block time. e.g. For Aura, it will be double this", + " period on default settings." + ] + }, + { + "name": "DidUpdate", + "modifier": "Default", + "type": { + "PlainType": "bool" + }, + "fallback": "0x00", + "documentation": [ + " Did the timestamp get updated in this block?" + ] + } + ], + "calls": [ + { + "name": "set", + "args": [ + { + "name": "now", + "type": "Compact" + } + ], + "documentation": [ + " Set the current time.", + "", + " This call should be invoked exactly once per block. It will panic at the finalization phase,", + " if this call hasn't been invoked by that time.", + "", + " The timestamp should be greater than the previous one by the amount specified by `minimum_period`.", + "", + " The dispatch origin for this call must be `Inherent`." + ] + } + ], + "events": null + }, + { + "name": "consensus", + "prefix": "Consensus", + "storage": [ + { + "name": "OriginalAuthorities", + "modifier": "Optional", + "type": { + "PlainType": "Vec" + }, + "fallback": "0x00", + "documentation": [] + } + ], + "calls": [ + { + "name": "report_misbehavior", + "args": [ + { + "name": "_report", + "type": "Bytes" + } + ], + "documentation": [ + " Report some misbehavior." + ] + }, + { + "name": "note_offline", + "args": [ + { + "name": "offline", + "type": "InherentOfflineReport" + } + ], + "documentation": [ + " Note that the previous block's validator missed its opportunity to propose a block." + ] + }, + { + "name": "remark", + "args": [ + { + "name": "_remark", + "type": "Bytes" + } + ], + "documentation": [ + " Make some on-chain remark." + ] + }, + { + "name": "set_heap_pages", + "args": [ + { + "name": "pages", + "type": "u64" + } + ], + "documentation": [ + " Set the number of pages in the WebAssembly environment's heap." + ] + }, + { + "name": "set_code", + "args": [ + { + "name": "new", + "type": "Bytes" + } + ], + "documentation": [ + " Set the new code." + ] + }, + { + "name": "set_storage", + "args": [ + { + "name": "items", + "type": "Vec" + } + ], + "documentation": [ + " Set some items of storage." + ] + }, + { + "name": "kill_storage", + "args": [ + { + "name": "keys", + "type": "Vec" + } + ], + "documentation": [ + " Kill some items from storage." + ] + } + ], + "events": null + }, + { + "name": "indices", + "prefix": "Indices", + "storage": [ + { + "name": "NextEnumSet", + "modifier": "Default", + "type": { + "PlainType": "AccountIndex" + }, + "fallback": "0x00000000", + "documentation": [ + " The next free enumeration set." + ] + }, + { + "name": "EnumSet", + "modifier": "Default", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountIndex", + "value": "Vec", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " The enumeration sets." + ] + } + ], + "calls": [], + "events": [ + { + "name": "NewAccountIndex", + "args": [ + "AccountId", + "AccountIndex" + ], + "documentation": [ + " A new account index was assigned.", + "", + " This event is not triggered when an existing index is reassigned", + " to another `AccountId`." + ] + } + ] + }, + { + "name": "balances", + "prefix": "Balances", + "storage": [ + { + "name": "TotalIssuance", + "modifier": "Default", + "type": { + "PlainType": "Balance" + }, + "fallback": "0x00000000000000000000000000000000", + "documentation": [ + " The total units issued in the system." + ] + }, + { + "name": "ExistentialDeposit", + "modifier": "Default", + "type": { + "PlainType": "Balance" + }, + "fallback": "0x00000000000000000000000000000000", + "documentation": [ + " The minimum amount required to keep an account open." + ] + }, + { + "name": "TransferFee", + "modifier": "Default", + "type": { + "PlainType": "Balance" + }, + "fallback": "0x00000000000000000000000000000000", + "documentation": [ + " The fee required to make a transfer." + ] + }, + { + "name": "CreationFee", + "modifier": "Default", + "type": { + "PlainType": "Balance" + }, + "fallback": "0x00000000000000000000000000000000", + "documentation": [ + " The fee required to create an account." + ] + }, + { + "name": "TransactionBaseFee", + "modifier": "Default", + "type": { + "PlainType": "Balance" + }, + "fallback": "0x00000000000000000000000000000000", + "documentation": [ + " The fee to be paid for making a transaction; the base." + ] + }, + { + "name": "TransactionByteFee", + "modifier": "Default", + "type": { + "PlainType": "Balance" + }, + "fallback": "0x00000000000000000000000000000000", + "documentation": [ + " The fee to be paid for making a transaction; the per-byte portion." + ] + }, + { + "name": "Vesting", + "modifier": "Optional", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "VestingSchedule", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " Information regarding the vesting of a given account." + ] + }, + { + "name": "FreeBalance", + "modifier": "Default", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "Balance", + "isLinked": false + } + }, + "fallback": "0x00000000000000000000000000000000", + "documentation": [ + " The 'free' balance of a given account.", + "", + " This is the only balance that matters in terms of most operations on tokens. It", + " alone is used to determine the balance when in the contract execution environment. When this", + " balance falls below the value of `ExistentialDeposit`, then the 'current account' is", + " deleted: specifically `FreeBalance`. Further, the `OnFreeBalanceZero` callback", + " is invoked, giving a chance to external modules to clean up data associated with", + " the deleted account.", + "", + " `system::AccountNonce` is also deleted if `ReservedBalance` is also zero (it also gets", + " collapsed to zero if it ever becomes less than `ExistentialDeposit`." + ] + }, + { + "name": "ReservedBalance", + "modifier": "Default", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "Balance", + "isLinked": false + } + }, + "fallback": "0x00000000000000000000000000000000", + "documentation": [ + " The amount of the balance of a given account that is externally reserved; this can still get", + " slashed, but gets slashed last of all.", + "", + " This balance is a 'reserve' balance that other subsystems use in order to set aside tokens", + " that are still 'owned' by the account holder, but which are suspendable.", + "", + " When this balance falls below the value of `ExistentialDeposit`, then this 'reserve account'", + " is deleted: specifically, `ReservedBalance`.", + "", + " `system::AccountNonce` is also deleted if `FreeBalance` is also zero (it also gets", + " collapsed to zero if it ever becomes less than `ExistentialDeposit`.)" + ] + }, + { + "name": "Locks", + "modifier": "Default", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "Vec", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " Any liquidity locks on some account balances." + ] + } + ], + "calls": [ + { + "name": "transfer", + "args": [ + { + "name": "dest", + "type": "Address" + }, + { + "name": "value", + "type": "Compact" + } + ], + "documentation": [ + " Transfer some liquid free balance to another account.", + "", + " `transfer` will set the `FreeBalance` of the sender and receiver.", + " It will decrease the total issuance of the system by the `TransferFee`.", + " If the sender's account is below the existential deposit as a result", + " of the transfer, the account will be reaped.", + "", + " The dispatch origin for this call must be `Signed` by the transactor." + ] + }, + { + "name": "set_balance", + "args": [ + { + "name": "who", + "type": "Address" + }, + { + "name": "free", + "type": "Compact" + }, + { + "name": "reserved", + "type": "Compact" + } + ], + "documentation": [ + " Set the balances of a given account.", + "", + " This will alter `FreeBalance` and `ReservedBalance` in storage.", + " If the new free or reserved balance is below the existential deposit,", + " it will also decrease the total issuance of the system (`TotalIssuance`)", + " and reset the account nonce (`system::AccountNonce`).", + "", + " The dispatch origin for this call is `root`." + ] + } + ], + "events": [ + { + "name": "NewAccount", + "args": [ + "AccountId", + "Balance" + ], + "documentation": [ + " A new account was created." + ] + }, + { + "name": "ReapedAccount", + "args": [ + "AccountId" + ], + "documentation": [ + " An account was reaped." + ] + }, + { + "name": "Transfer", + "args": [ + "AccountId", + "AccountId", + "Balance", + "Balance" + ], + "documentation": [ + " Transfer succeeded (from, to, value, fees)." + ] + } + ] + }, + { + "name": "session", + "prefix": "Session", + "storage": [ + { + "name": "Validators", + "modifier": "Default", + "type": { + "PlainType": "Vec" + }, + "fallback": "0x00", + "documentation": [ + " The current set of validators." + ] + }, + { + "name": "SessionLength", + "modifier": "Default", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0xe803000000000000", + "documentation": [ + " Current length of the session." + ] + }, + { + "name": "CurrentIndex", + "modifier": "Default", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0x0000000000000000", + "documentation": [ + " Current index of the session." + ] + }, + { + "name": "CurrentStart", + "modifier": "Default", + "type": { + "PlainType": "Moment" + }, + "fallback": "0x0000000000000000", + "documentation": [ + " Timestamp when current session started." + ] + }, + { + "name": "ForcingNewSession", + "modifier": "Optional", + "type": { + "PlainType": "bool" + }, + "fallback": "0x00", + "documentation": [ + " New session is being forced if this entry exists; in which case, the boolean value is whether", + " the new session should be considered a normal rotation (rewardable) or exceptional (slashable)." + ] + }, + { + "name": "LastLengthChange", + "modifier": "Optional", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0x00", + "documentation": [ + " Block at which the session length last changed." + ] + }, + { + "name": "NextKeyFor", + "modifier": "Optional", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "SessionKey", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " The next key for a given validator." + ] + }, + { + "name": "NextSessionLength", + "modifier": "Optional", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0x00", + "documentation": [ + " The next session length." + ] + } + ], + "calls": [ + { + "name": "set_key", + "args": [ + { + "name": "key", + "type": "SessionKey" + } + ], + "documentation": [ + " Sets the session key of `_validator` to `_key`. This doesn't take effect until the next", + " session." + ] + }, + { + "name": "set_length", + "args": [ + { + "name": "new", + "type": "Compact" + } + ], + "documentation": [ + " Set a new session length. Won't kick in until the next session change (at current length)." + ] + }, + { + "name": "force_new_session", + "args": [ + { + "name": "apply_rewards", + "type": "bool" + } + ], + "documentation": [ + " Forces a new session." + ] + } + ], + "events": [ + { + "name": "NewSession", + "args": [ + "BlockNumber" + ], + "documentation": [ + " New session has happened. Note that the argument is the session index, not the block", + " number as the type might suggest." + ] + } + ] + }, + { + "name": "staking", + "prefix": "Staking", + "storage": [ + { + "name": "ValidatorCount", + "modifier": "Default", + "type": { + "PlainType": "u32" + }, + "fallback": "0x00000000", + "documentation": [ + " The ideal number of staking participants." + ] + }, + { + "name": "MinimumValidatorCount", + "modifier": "Default", + "type": { + "PlainType": "u32" + }, + "fallback": "0x04000000", + "documentation": [ + " Minimum number of staking participants before emergency conditions are imposed." + ] + }, + { + "name": "SessionsPerEra", + "modifier": "Default", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0xe803000000000000", + "documentation": [ + " The length of a staking era in sessions." + ] + }, + { + "name": "SessionReward", + "modifier": "Default", + "type": { + "PlainType": "Perbill" + }, + "fallback": "0x3c000000", + "documentation": [ + " Maximum reward, per validator, that is provided per acceptable session." + ] + }, + { + "name": "OfflineSlash", + "modifier": "Default", + "type": { + "PlainType": "Perbill" + }, + "fallback": "0x40420f00", + "documentation": [ + " Slash, per validator that is taken for the first time they are found to be offline." + ] + }, + { + "name": "OfflineSlashGrace", + "modifier": "Default", + "type": { + "PlainType": "u32" + }, + "fallback": "0x00000000", + "documentation": [ + " Number of instances of offline reports before slashing begins for validators." + ] + }, + { + "name": "BondingDuration", + "modifier": "Default", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0xe803000000000000", + "documentation": [ + " The length of the bonding duration in blocks." + ] + }, + { + "name": "Invulnerables", + "modifier": "Default", + "type": { + "PlainType": "Vec" + }, + "fallback": "0x00", + "documentation": [ + " Any validators that may never be slashed or forcibly kicked. It's a Vec since they're easy to initialize", + " and the performance hit is minimal (we expect no more than four invulnerables) and restricted to testnets." + ] + }, + { + "name": "Bonded", + "modifier": "Optional", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "AccountId", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " Map from all locked \"stash\" accounts to the controller account." + ] + }, + { + "name": "Ledger", + "modifier": "Optional", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "StakingLedger", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " Map from all (unlocked) \"controller\" accounts to the info regarding the staking." + ] + }, + { + "name": "Payee", + "modifier": "Default", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "RewardDestination", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " Where the reward payment should be made. Keyed by stash." + ] + }, + { + "name": "Validators", + "modifier": "Default", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "ValidatorPrefs", + "isLinked": true + } + }, + "fallback": "0x0c00", + "documentation": [ + " The map from (wannabe) validator stash key to the preferences of that validator." + ] + }, + { + "name": "Nominators", + "modifier": "Default", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "Vec", + "isLinked": true + } + }, + "fallback": "0x00", + "documentation": [ + " The map from nominator stash key to the set of stash keys of all validators to nominate." + ] + }, + { + "name": "Stakers", + "modifier": "Default", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "Exposure", + "isLinked": false + } + }, + "fallback": "0x000000", + "documentation": [ + " Nominators for a particular account that is in action right now. You can't iterate through validators here,", + " but you can find them in the `sessions` module.", + "", + " This is keyed by the stash account." + ] + }, + { + "name": "CurrentElected", + "modifier": "Default", + "type": { + "PlainType": "Vec" + }, + "fallback": "0x00", + "documentation": [ + " The currently elected validator set keyed by stash account ID." + ] + }, + { + "name": "CurrentEra", + "modifier": "Default", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0x0000000000000000", + "documentation": [ + " The current era index." + ] + }, + { + "name": "CurrentSessionReward", + "modifier": "Default", + "type": { + "PlainType": "BalanceOf" + }, + "fallback": "0x00000000000000000000000000000000", + "documentation": [ + " Maximum reward, per validator, that is provided per acceptable session." + ] + }, + { + "name": "CurrentEraReward", + "modifier": "Default", + "type": { + "PlainType": "BalanceOf" + }, + "fallback": "0x00000000000000000000000000000000", + "documentation": [ + " The accumulated reward for the current era. Reset to zero at the beginning of the era and", + " increased for every successfully finished session." + ] + }, + { + "name": "NextSessionsPerEra", + "modifier": "Optional", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0x00", + "documentation": [ + " The next value of sessions per era." + ] + }, + { + "name": "LastEraLengthChange", + "modifier": "Default", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0x0000000000000000", + "documentation": [ + " The session index at which the era length last changed." + ] + }, + { + "name": "SlotStake", + "modifier": "Default", + "type": { + "PlainType": "BalanceOf" + }, + "fallback": "0x00000000000000000000000000000000", + "documentation": [ + " The amount of balance actively at stake for each validator slot, currently.", + "", + " This is used to derive rewards and punishments." + ] + }, + { + "name": "SlashCount", + "modifier": "Default", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "u32", + "isLinked": false + } + }, + "fallback": "0x00000000", + "documentation": [ + " The number of times a given validator has been reported offline. This gets decremented by one each era that passes." + ] + }, + { + "name": "ForcingNewEra", + "modifier": "Optional", + "type": { + "PlainType": "Null" + }, + "fallback": "0x00", + "documentation": [ + " We are forcing a new era." + ] + }, + { + "name": "RecentlyOffline", + "modifier": "Default", + "type": { + "PlainType": "Vec<(AccountId,BlockNumber,u32)>" + }, + "fallback": "0x00", + "documentation": [ + " Most recent `RECENT_OFFLINE_COUNT` instances. (who it was, when it was reported, how many instances they were offline for)." + ] + } + ], + "calls": [ + { + "name": "bond", + "args": [ + { + "name": "controller", + "type": "Address" + }, + { + "name": "value", + "type": "Compact" + }, + { + "name": "payee", + "type": "RewardDestination" + } + ], + "documentation": [ + " Take the origin account as a stash and lock up `value` of its balance. `controller` will be the", + " account that controls it.", + "", + " The dispatch origin for this call must be _Signed_ by the stash account." + ] + }, + { + "name": "bond_extra", + "args": [ + { + "name": "max_additional", + "type": "Compact" + } + ], + "documentation": [ + " Add some extra amount that have appeared in the stash `free_balance` into the balance up for", + " staking.", + "", + " Use this if there are additional funds in your stash account that you wish to bond.", + "", + " The dispatch origin for this call must be _Signed_ by the stash, not the controller." + ] + }, + { + "name": "unbond", + "args": [ + { + "name": "value", + "type": "Compact" + } + ], + "documentation": [ + " Schedule a portion of the stash to be unlocked ready for transfer out after the bond", + " period ends. If this leaves an amount actively bonded less than", + " T::Currency::existential_deposit(), then it is increased to the full amount.", + "", + " Once the unlock period is done, you can call `withdraw_unbonded` to actually move", + " the funds out of management ready for transfer.", + "", + " The dispatch origin for this call must be _Signed_ by the controller, not the stash.", + "", + " See also [`Call::withdraw_unbonded`]." + ] + }, + { + "name": "withdraw_unbonded", + "args": [], + "documentation": [ + " Remove any unlocked chunks from the `unlocking` queue from our management.", + "", + " This essentially frees up that balance to be used by the stash account to do", + " whatever it wants.", + "", + " The dispatch origin for this call must be _Signed_ by the controller, not the stash.", + "", + " See also [`Call::unbond`]." + ] + }, + { + "name": "validate", + "args": [ + { + "name": "prefs", + "type": "ValidatorPrefs" + } + ], + "documentation": [ + " Declare the desire to validate for the origin controller.", + "", + " Effects will be felt at the beginning of the next era.", + "", + " The dispatch origin for this call must be _Signed_ by the controller, not the stash." + ] + }, + { + "name": "nominate", + "args": [ + { + "name": "targets", + "type": "Vec
" + } + ], + "documentation": [ + " Declare the desire to nominate `targets` for the origin controller.", + "", + " Effects will be felt at the beginning of the next era.", + "", + " The dispatch origin for this call must be _Signed_ by the controller, not the stash." + ] + }, + { + "name": "chill", + "args": [], + "documentation": [ + " Declare no desire to either validate or nominate.", + "", + " Effects will be felt at the beginning of the next era.", + "", + " The dispatch origin for this call must be _Signed_ by the controller, not the stash." + ] + }, + { + "name": "set_payee", + "args": [ + { + "name": "payee", + "type": "RewardDestination" + } + ], + "documentation": [ + " (Re-)set the payment target for a controller.", + "", + " Effects will be felt at the beginning of the next era.", + "", + " The dispatch origin for this call must be _Signed_ by the controller, not the stash." + ] + }, + { + "name": "set_controller", + "args": [ + { + "name": "controller", + "type": "Address" + } + ], + "documentation": [ + " (Re-)set the payment target for a controller.", + "", + " Effects will be felt at the beginning of the next era.", + "", + " The dispatch origin for this call must be _Signed_ by the stash, not the controller." + ] + }, + { + "name": "set_sessions_per_era", + "args": [ + { + "name": "new", + "type": "Compact" + } + ], + "documentation": [ + " Set the number of sessions in an era." + ] + }, + { + "name": "set_bonding_duration", + "args": [ + { + "name": "new", + "type": "Compact" + } + ], + "documentation": [ + " The length of the bonding duration in eras." + ] + }, + { + "name": "set_validator_count", + "args": [ + { + "name": "new", + "type": "Compact" + } + ], + "documentation": [ + " The ideal number of validators." + ] + }, + { + "name": "force_new_era", + "args": [ + { + "name": "apply_rewards", + "type": "bool" + } + ], + "documentation": [ + " Force there to be a new era. This also forces a new session immediately after.", + " `apply_rewards` should be true for validators to get the session reward." + ] + }, + { + "name": "set_offline_slash_grace", + "args": [ + { + "name": "new", + "type": "Compact" + } + ], + "documentation": [ + " Set the offline slash grace period." + ] + }, + { + "name": "set_invulnerables", + "args": [ + { + "name": "validators", + "type": "Vec" + } + ], + "documentation": [ + " Set the validators who cannot be slashed (if any)." + ] + } + ], + "events": [ + { + "name": "Reward", + "args": [ + "Balance" + ], + "documentation": [ + " All validators have been rewarded by the given balance." + ] + }, + { + "name": "OfflineWarning", + "args": [ + "AccountId", + "u32" + ], + "documentation": [ + " One validator (and their nominators) has been given a offline-warning (they're still", + " within their grace). The accrued number of slashes is recorded, too." + ] + }, + { + "name": "OfflineSlash", + "args": [ + "AccountId", + "Balance" + ], + "documentation": [ + " One validator (and their nominators) has been slashed by the given amount." + ] + } + ] + }, + { + "name": "democracy", + "prefix": "Democracy", + "storage": [ + { + "name": "PublicPropCount", + "modifier": "Default", + "type": { + "PlainType": "PropIndex" + }, + "fallback": "0x00000000", + "documentation": [ + " The number of (public) proposals that have been made so far." + ] + }, + { + "name": "PublicProps", + "modifier": "Default", + "type": { + "PlainType": "Vec<(PropIndex,Proposal,AccountId)>" + }, + "fallback": "0x00", + "documentation": [ + " The public proposals. Unsorted." + ] + }, + { + "name": "DepositOf", + "modifier": "Optional", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "PropIndex", + "value": "(BalanceOf,Vec)", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " Those who have locked a deposit." + ] + }, + { + "name": "LaunchPeriod", + "modifier": "Default", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0xe803000000000000", + "documentation": [ + " How often (in blocks) new public referenda are launched." + ] + }, + { + "name": "MinimumDeposit", + "modifier": "Default", + "type": { + "PlainType": "BalanceOf" + }, + "fallback": "0x00000000000000000000000000000000", + "documentation": [ + " The minimum amount to be used as a deposit for a public referendum proposal." + ] + }, + { + "name": "PublicDelay", + "modifier": "Default", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0x0000000000000000", + "documentation": [ + " The delay before enactment for all public referenda." + ] + }, + { + "name": "MaxLockPeriods", + "modifier": "Default", + "type": { + "PlainType": "LockPeriods" + }, + "fallback": "0x00", + "documentation": [ + " The maximum number of additional lock periods a voter may offer to strengthen their vote. Multiples of `PublicDelay`." + ] + }, + { + "name": "VotingPeriod", + "modifier": "Default", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0xe803000000000000", + "documentation": [ + " How often (in blocks) to check for new votes." + ] + }, + { + "name": "ReferendumCount", + "modifier": "Default", + "type": { + "PlainType": "ReferendumIndex" + }, + "fallback": "0x00000000", + "documentation": [ + " The next free referendum index, aka the number of referendums started so far." + ] + }, + { + "name": "NextTally", + "modifier": "Default", + "type": { + "PlainType": "ReferendumIndex" + }, + "fallback": "0x00000000", + "documentation": [ + " The next referendum index that should be tallied." + ] + }, + { + "name": "ReferendumInfoOf", + "modifier": "Optional", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "ReferendumIndex", + "value": "ReferendumInfo", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " Information concerning any given referendum." + ] + }, + { + "name": "DispatchQueue", + "modifier": "Default", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "BlockNumber", + "value": "Vec>", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " Queue of successful referenda to be dispatched." + ] + }, + { + "name": "VotersFor", + "modifier": "Default", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "ReferendumIndex", + "value": "Vec", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " Get the voters for the current proposal." + ] + }, + { + "name": "VoteOf", + "modifier": "Default", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "(ReferendumIndex,AccountId)", + "value": "Vote", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " Get the vote in a given referendum of a particular voter. The result is meaningful only if `voters_for` includes the", + " voter when called with the referendum (you'll get the default `Vote` value otherwise). If you don't want to check", + " `voters_for`, then you can also check for simple existence with `VoteOf::exists` first." + ] + }, + { + "name": "Proxy", + "modifier": "Optional", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "AccountId", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " Who is able to vote for whom. Value is the fund-holding account, key is the vote-transaction-sending account." + ] + }, + { + "name": "Delegations", + "modifier": "Default", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "(AccountId,LockPeriods)", + "isLinked": true + } + }, + "fallback": "0x000000000000000000000000000000000000000000000000000000000000000000", + "documentation": [ + " Get the account (and lock periods) to which another account is delegating vote." + ] + } + ], + "calls": [ + { + "name": "propose", + "args": [ + { + "name": "proposal", + "type": "Proposal" + }, + { + "name": "value", + "type": "Compact" + } + ], + "documentation": [ + " Propose a sensitive action to be taken." + ] + }, + { + "name": "second", + "args": [ + { + "name": "proposal", + "type": "Compact" + } + ], + "documentation": [ + " Propose a sensitive action to be taken." + ] + }, + { + "name": "vote", + "args": [ + { + "name": "ref_index", + "type": "Compact" + }, + { + "name": "vote", + "type": "Vote" + } + ], + "documentation": [ + " Vote in a referendum. If `vote.is_aye()`, the vote is to enact the proposal;", + " otherwise it is a vote to keep the status quo." + ] + }, + { + "name": "proxy_vote", + "args": [ + { + "name": "ref_index", + "type": "Compact" + }, + { + "name": "vote", + "type": "Vote" + } + ], + "documentation": [ + " Vote in a referendum on behalf of a stash. If `vote.is_aye()`, the vote is to enact the proposal;", + " otherwise it is a vote to keep the status quo." + ] + }, + { + "name": "start_referendum", + "args": [ + { + "name": "proposal", + "type": "Proposal" + }, + { + "name": "threshold", + "type": "VoteThreshold" + }, + { + "name": "delay", + "type": "BlockNumber" + } + ], + "documentation": [ + " Start a referendum." + ] + }, + { + "name": "cancel_referendum", + "args": [ + { + "name": "ref_index", + "type": "Compact" + } + ], + "documentation": [ + " Remove a referendum." + ] + }, + { + "name": "cancel_queued", + "args": [ + { + "name": "when", + "type": "Compact" + }, + { + "name": "which", + "type": "Compact" + } + ], + "documentation": [ + " Cancel a proposal queued for enactment." + ] + }, + { + "name": "set_proxy", + "args": [ + { + "name": "proxy", + "type": "AccountId" + } + ], + "documentation": [ + " Specify a proxy. Called by the stash." + ] + }, + { + "name": "resign_proxy", + "args": [], + "documentation": [ + " Clear the proxy. Called by the proxy." + ] + }, + { + "name": "remove_proxy", + "args": [ + { + "name": "proxy", + "type": "AccountId" + } + ], + "documentation": [ + " Clear the proxy. Called by the stash." + ] + }, + { + "name": "delegate", + "args": [ + { + "name": "to", + "type": "AccountId" + }, + { + "name": "lock_periods", + "type": "LockPeriods" + } + ], + "documentation": [ + " Delegate vote." + ] + }, + { + "name": "undelegate", + "args": [], + "documentation": [ + " Undelegate vote." + ] + } + ], + "events": [ + { + "name": "Proposed", + "args": [ + "PropIndex", + "Balance" + ], + "documentation": [] + }, + { + "name": "Tabled", + "args": [ + "PropIndex", + "Balance", + "Vec" + ], + "documentation": [] + }, + { + "name": "Started", + "args": [ + "ReferendumIndex", + "VoteThreshold" + ], + "documentation": [] + }, + { + "name": "Passed", + "args": [ + "ReferendumIndex" + ], + "documentation": [] + }, + { + "name": "NotPassed", + "args": [ + "ReferendumIndex" + ], + "documentation": [] + }, + { + "name": "Cancelled", + "args": [ + "ReferendumIndex" + ], + "documentation": [] + }, + { + "name": "Executed", + "args": [ + "ReferendumIndex", + "bool" + ], + "documentation": [] + }, + { + "name": "Delegated", + "args": [ + "AccountId", + "AccountId" + ], + "documentation": [] + }, + { + "name": "Undelegated", + "args": [ + "AccountId" + ], + "documentation": [] + } + ] + }, + { + "name": "council", + "prefix": "Council", + "storage": [ + { + "name": "CandidacyBond", + "modifier": "Default", + "type": { + "PlainType": "BalanceOf" + }, + "fallback": "0x09000000000000000000000000000000", + "documentation": [ + " How much should be locked up in order to submit one's candidacy." + ] + }, + { + "name": "VotingBond", + "modifier": "Default", + "type": { + "PlainType": "BalanceOf" + }, + "fallback": "0x00000000000000000000000000000000", + "documentation": [ + " How much should be locked up in order to be able to submit votes." + ] + }, + { + "name": "PresentSlashPerVoter", + "modifier": "Default", + "type": { + "PlainType": "BalanceOf" + }, + "fallback": "0x01000000000000000000000000000000", + "documentation": [ + " The punishment, per voter, if you provide an invalid presentation." + ] + }, + { + "name": "CarryCount", + "modifier": "Default", + "type": { + "PlainType": "u32" + }, + "fallback": "0x02000000", + "documentation": [ + " How many runners-up should have their approvals persist until the next vote." + ] + }, + { + "name": "PresentationDuration", + "modifier": "Default", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0xe803000000000000", + "documentation": [ + " How long to give each top candidate to present themselves after the vote ends." + ] + }, + { + "name": "InactiveGracePeriod", + "modifier": "Default", + "type": { + "PlainType": "VoteIndex" + }, + "fallback": "0x01000000", + "documentation": [ + " How many vote indexes need to go by after a target voter's last vote before they can be reaped if their", + " approvals are moot." + ] + }, + { + "name": "VotingPeriod", + "modifier": "Default", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0xe803000000000000", + "documentation": [ + " How often (in blocks) to check for new votes." + ] + }, + { + "name": "TermDuration", + "modifier": "Default", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0x0500000000000000", + "documentation": [ + " How long each position is active for." + ] + }, + { + "name": "DesiredSeats", + "modifier": "Default", + "type": { + "PlainType": "u32" + }, + "fallback": "0x00000000", + "documentation": [ + " Number of accounts that should be sitting on the council." + ] + }, + { + "name": "ActiveCouncil", + "modifier": "Default", + "type": { + "PlainType": "Vec<(AccountId,BlockNumber)>" + }, + "fallback": "0x00", + "documentation": [ + " The current council. When there's a vote going on, this should still be used for executive", + " matters. The block number (second element in the tuple) is the block that their position is", + " active until (calculated by the sum of the block number when the council member was elected", + " and their term duration)." + ] + }, + { + "name": "VoteCount", + "modifier": "Default", + "type": { + "PlainType": "VoteIndex" + }, + "fallback": "0x00000000", + "documentation": [ + " The total number of votes that have happened or are in progress." + ] + }, + { + "name": "ApprovalsOf", + "modifier": "Default", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "Vec", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " A list of votes for each voter, respecting the last cleared vote index that this voter was", + " last active at." + ] + }, + { + "name": "RegisterInfoOf", + "modifier": "Optional", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "(VoteIndex,u32)", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " The vote index and list slot that the candidate `who` was registered or `None` if they are not", + " currently registered." + ] + }, + { + "name": "LastActiveOf", + "modifier": "Optional", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "VoteIndex", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " The last cleared vote index that this voter was last active at." + ] + }, + { + "name": "Voters", + "modifier": "Default", + "type": { + "PlainType": "Vec" + }, + "fallback": "0x00", + "documentation": [ + " The present voter list." + ] + }, + { + "name": "Candidates", + "modifier": "Default", + "type": { + "PlainType": "Vec" + }, + "fallback": "0x00", + "documentation": [ + " The present candidate list." + ] + }, + { + "name": "CandidateCount", + "modifier": "Default", + "type": { + "PlainType": "u32" + }, + "fallback": "0x00000000", + "documentation": [] + }, + { + "name": "NextFinalize", + "modifier": "Optional", + "type": { + "PlainType": "(BlockNumber,u32,Vec)" + }, + "fallback": "0x00", + "documentation": [ + " The accounts holding the seats that will become free on the next tally." + ] + }, + { + "name": "SnapshotedStakes", + "modifier": "Default", + "type": { + "PlainType": "Vec" + }, + "fallback": "0x00", + "documentation": [ + " The stakes as they were at the point that the vote ended." + ] + }, + { + "name": "Leaderboard", + "modifier": "Optional", + "type": { + "PlainType": "Vec<(BalanceOf,AccountId)>" + }, + "fallback": "0x00", + "documentation": [ + " Get the leaderboard if we're in the presentation phase." + ] + } + ], + "calls": [ + { + "name": "set_approvals", + "args": [ + { + "name": "votes", + "type": "Vec" + }, + { + "name": "index", + "type": "Compact" + } + ], + "documentation": [ + " Set candidate approvals. Approval slots stay valid as long as candidates in those slots", + " are registered." + ] + }, + { + "name": "proxy_set_approvals", + "args": [ + { + "name": "votes", + "type": "Vec" + }, + { + "name": "index", + "type": "Compact" + } + ], + "documentation": [ + " Set candidate approvals from a proxy. Approval slots stay valid as long as candidates in those slots", + " are registered." + ] + }, + { + "name": "reap_inactive_voter", + "args": [ + { + "name": "reporter_index", + "type": "Compact" + }, + { + "name": "who", + "type": "Address" + }, + { + "name": "who_index", + "type": "Compact" + }, + { + "name": "assumed_vote_index", + "type": "Compact" + } + ], + "documentation": [ + " Remove a voter. For it not to be a bond-consuming no-op, all approved candidate indices", + " must now be either unregistered or registered to a candidate that registered the slot after", + " the voter gave their last approval set.", + "", + " May be called by anyone. Returns the voter deposit to `signed`." + ] + }, + { + "name": "retract_voter", + "args": [ + { + "name": "index", + "type": "Compact" + } + ], + "documentation": [ + " Remove a voter. All votes are cancelled and the voter deposit is returned." + ] + }, + { + "name": "submit_candidacy", + "args": [ + { + "name": "slot", + "type": "Compact" + } + ], + "documentation": [ + " Submit oneself for candidacy.", + "", + " Account must have enough transferrable funds in it to pay the bond." + ] + }, + { + "name": "present_winner", + "args": [ + { + "name": "candidate", + "type": "Address" + }, + { + "name": "total", + "type": "Compact" + }, + { + "name": "index", + "type": "Compact" + } + ], + "documentation": [ + " Claim that `signed` is one of the top Self::carry_count() + current_vote().1 candidates.", + " Only works if the `block_number >= current_vote().0` and `< current_vote().0 + presentation_duration()``", + " `signed` should have at least" + ] + }, + { + "name": "set_desired_seats", + "args": [ + { + "name": "count", + "type": "Compact" + } + ], + "documentation": [ + " Set the desired member count; if lower than the current count, then seats will not be up", + " election when they expire. If more, then a new vote will be started if one is not already", + " in progress." + ] + }, + { + "name": "remove_member", + "args": [ + { + "name": "who", + "type": "Address" + } + ], + "documentation": [ + " Remove a particular member. A tally will happen instantly (if not already in a presentation", + " period) to fill the seat if removal means that the desired members are not met.", + " This is effective immediately." + ] + }, + { + "name": "set_presentation_duration", + "args": [ + { + "name": "count", + "type": "Compact" + } + ], + "documentation": [ + " Set the presentation duration. If there is currently a vote being presented for, will", + " invoke `finalize_vote`." + ] + }, + { + "name": "set_term_duration", + "args": [ + { + "name": "count", + "type": "Compact" + } + ], + "documentation": [ + " Set the presentation duration. If there is current a vote being presented for, will", + " invoke `finalize_vote`." + ] + } + ], + "events": [ + { + "name": "VoterReaped", + "args": [ + "AccountId", + "AccountId" + ], + "documentation": [ + " reaped voter, reaper" + ] + }, + { + "name": "BadReaperSlashed", + "args": [ + "AccountId" + ], + "documentation": [ + " slashed reaper" + ] + }, + { + "name": "TallyStarted", + "args": [ + "u32" + ], + "documentation": [ + " A tally (for approval votes of council seat(s)) has started." + ] + }, + { + "name": "TallyFinalized", + "args": [ + "Vec", + "Vec" + ], + "documentation": [ + " A tally (for approval votes of council seat(s)) has ended (with one or more new members)." + ] + } + ] + }, + { + "name": "council_voting", + "prefix": "CouncilVoting", + "storage": [ + { + "name": "CooloffPeriod", + "modifier": "Default", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0xe803000000000000", + "documentation": [] + }, + { + "name": "VotingPeriod", + "modifier": "Default", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0x0300000000000000", + "documentation": [] + }, + { + "name": "EnactDelayPeriod", + "modifier": "Default", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0x0000000000000000", + "documentation": [ + " Number of blocks by which to delay enactment of successful, non-unanimous-council-instigated referendum proposals." + ] + }, + { + "name": "Proposals", + "modifier": "Default", + "type": { + "PlainType": "Vec<(BlockNumber,Hash)>" + }, + "fallback": "0x00", + "documentation": [] + }, + { + "name": "ProposalOf", + "modifier": "Optional", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "Hash", + "value": "Proposal", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [] + }, + { + "name": "ProposalVoters", + "modifier": "Default", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "Hash", + "value": "Vec", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [] + }, + { + "name": "CouncilVoteOf", + "modifier": "Optional", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "(Hash,AccountId)", + "value": "bool", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [] + }, + { + "name": "VetoedProposal", + "modifier": "Optional", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "Hash", + "value": "(BlockNumber,Vec)", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [] + } + ], + "calls": [ + { + "name": "propose", + "args": [ + { + "name": "proposal", + "type": "Proposal" + } + ], + "documentation": [] + }, + { + "name": "vote", + "args": [ + { + "name": "proposal", + "type": "Hash" + }, + { + "name": "approve", + "type": "bool" + } + ], + "documentation": [] + }, + { + "name": "veto", + "args": [ + { + "name": "proposal_hash", + "type": "Hash" + } + ], + "documentation": [] + }, + { + "name": "set_cooloff_period", + "args": [ + { + "name": "blocks", + "type": "Compact" + } + ], + "documentation": [] + }, + { + "name": "set_voting_period", + "args": [ + { + "name": "blocks", + "type": "Compact" + } + ], + "documentation": [] + } + ], + "events": [ + { + "name": "TallyCancelation", + "args": [ + "Hash", + "u32", + "u32", + "u32" + ], + "documentation": [ + " A voting tally has happened for a referendum cancellation vote.", + " Last three are yes, no, abstain counts." + ] + }, + { + "name": "TallyReferendum", + "args": [ + "Hash", + "u32", + "u32", + "u32" + ], + "documentation": [ + " A voting tally has happened for a referendum vote.", + " Last three are yes, no, abstain counts." + ] + } + ] + }, + { + "name": "council_motions", + "prefix": "CouncilMotions", + "storage": [ + { + "name": "Proposals", + "modifier": "Default", + "type": { + "PlainType": "Vec" + }, + "fallback": "0x00", + "documentation": [ + " The (hashes of) the active proposals." + ] + }, + { + "name": "ProposalOf", + "modifier": "Optional", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "Hash", + "value": "Proposal", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " Actual proposal for a given hash, if it's current." + ] + }, + { + "name": "Voting", + "modifier": "Optional", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "Hash", + "value": "(ProposalIndex,u32,Vec,Vec)", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " Votes for a given proposal: (required_yes_votes, yes_voters, no_voters)." + ] + }, + { + "name": "ProposalCount", + "modifier": "Default", + "type": { + "PlainType": "u32" + }, + "fallback": "0x00000000", + "documentation": [ + " Proposals so far." + ] + } + ], + "calls": [ + { + "name": "propose", + "args": [ + { + "name": "threshold", + "type": "Compact" + }, + { + "name": "proposal", + "type": "Proposal" + } + ], + "documentation": [] + }, + { + "name": "vote", + "args": [ + { + "name": "proposal", + "type": "Hash" + }, + { + "name": "index", + "type": "Compact" + }, + { + "name": "approve", + "type": "bool" + } + ], + "documentation": [] + } + ], + "events": [ + { + "name": "Proposed", + "args": [ + "AccountId", + "ProposalIndex", + "Hash", + "u32" + ], + "documentation": [ + " A motion (given hash) has been proposed (by given account) with a threshold (given u32)." + ] + }, + { + "name": "Voted", + "args": [ + "AccountId", + "Hash", + "bool", + "u32", + "u32" + ], + "documentation": [ + " A motion (given hash) has been voted on by given account, leaving", + " a tally (yes votes and no votes given as u32s respectively)." + ] + }, + { + "name": "Approved", + "args": [ + "Hash" + ], + "documentation": [ + " A motion was approved by the required threshold." + ] + }, + { + "name": "Disapproved", + "args": [ + "Hash" + ], + "documentation": [ + " A motion was not approved by the required threshold." + ] + }, + { + "name": "Executed", + "args": [ + "Hash", + "bool" + ], + "documentation": [ + " A motion was executed; `bool` is true if returned without error." + ] + } + ] + }, + { + "name": "finality_tracker", + "prefix": "", + "storage": null, + "calls": [ + { + "name": "final_hint", + "args": [ + { + "name": "hint", + "type": "Compact" + } + ], + "documentation": [ + " Hint that the author of this block thinks the best finalized", + " block is the given number." + ] + } + ], + "events": null + }, + { + "name": "grandpa", + "prefix": "GrandpaFinality", + "storage": [ + { + "name": "PendingChange", + "modifier": "Optional", + "type": { + "PlainType": "StoredPendingChange" + }, + "fallback": "0x00", + "documentation": [] + }, + { + "name": "NextForced", + "modifier": "Optional", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0x00", + "documentation": [] + } + ], + "calls": [ + { + "name": "report_misbehavior", + "args": [ + { + "name": "_report", + "type": "Bytes" + } + ], + "documentation": [ + " Report some misbehavior." + ] + } + ], + "events": [ + { + "name": "NewAuthorities", + "args": [ + "Vec<(SessionKey,u64)>" + ], + "documentation": [ + " New authority set has been applied." + ] + } + ] + }, + { + "name": "treasury", + "prefix": "Treasury", + "storage": [ + { + "name": "ProposalBond", + "modifier": "Default", + "type": { + "PlainType": "Permill" + }, + "fallback": "0x00000000", + "documentation": [ + " Proportion of funds that should be bonded in order to place a proposal. An accepted", + " proposal gets these back. A rejected proposal doesn't." + ] + }, + { + "name": "ProposalBondMinimum", + "modifier": "Default", + "type": { + "PlainType": "BalanceOf" + }, + "fallback": "0x00000000000000000000000000000000", + "documentation": [ + " Minimum amount of funds that should be placed in a deposit for making a proposal." + ] + }, + { + "name": "SpendPeriod", + "modifier": "Default", + "type": { + "PlainType": "BlockNumber" + }, + "fallback": "0x0100000000000000", + "documentation": [ + " Period between successive spends." + ] + }, + { + "name": "Burn", + "modifier": "Default", + "type": { + "PlainType": "Permill" + }, + "fallback": "0x00000000", + "documentation": [ + " Percentage of spare funds (if any) that are burnt per spend period." + ] + }, + { + "name": "Pot", + "modifier": "Default", + "type": { + "PlainType": "BalanceOf" + }, + "fallback": "0x00000000000000000000000000000000", + "documentation": [ + " Total funds available to this module for spending." + ] + }, + { + "name": "ProposalCount", + "modifier": "Default", + "type": { + "PlainType": "ProposalIndex" + }, + "fallback": "0x00000000", + "documentation": [ + " Number of proposals that have been made." + ] + }, + { + "name": "Proposals", + "modifier": "Optional", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "ProposalIndex", + "value": "TreasuryProposal", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " Proposals that have been made." + ] + }, + { + "name": "Approvals", + "modifier": "Default", + "type": { + "PlainType": "Vec" + }, + "fallback": "0x00", + "documentation": [ + " Proposal indices that have been approved but not yet awarded." + ] + } + ], + "calls": [ + { + "name": "propose_spend", + "args": [ + { + "name": "value", + "type": "Compact" + }, + { + "name": "beneficiary", + "type": "Address" + } + ], + "documentation": [ + " Put forward a suggestion for spending. A deposit proportional to the value", + " is reserved and slashed if the proposal is rejected. It is returned once the", + " proposal is awarded." + ] + }, + { + "name": "set_pot", + "args": [ + { + "name": "new_pot", + "type": "Compact" + } + ], + "documentation": [ + " Set the balance of funds available to spend." + ] + }, + { + "name": "configure", + "args": [ + { + "name": "proposal_bond", + "type": "Compact" + }, + { + "name": "proposal_bond_minimum", + "type": "Compact" + }, + { + "name": "spend_period", + "type": "Compact" + }, + { + "name": "burn", + "type": "Compact" + } + ], + "documentation": [ + " (Re-)configure this module." + ] + }, + { + "name": "reject_proposal", + "args": [ + { + "name": "proposal_id", + "type": "Compact" + } + ], + "documentation": [ + " Reject a proposed spend. The original deposit will be slashed." + ] + }, + { + "name": "approve_proposal", + "args": [ + { + "name": "proposal_id", + "type": "Compact" + } + ], + "documentation": [ + " Approve a proposal. At a later time, the proposal will be allocated to the beneficiary", + " and the original deposit will be returned." + ] + } + ], + "events": [ + { + "name": "Proposed", + "args": [ + "ProposalIndex" + ], + "documentation": [ + " New proposal." + ] + }, + { + "name": "Spending", + "args": [ + "Balance" + ], + "documentation": [ + " We have ended a spend period and will now allocate funds." + ] + }, + { + "name": "Awarded", + "args": [ + "ProposalIndex", + "Balance", + "AccountId" + ], + "documentation": [ + " Some funds have been allocated." + ] + }, + { + "name": "Burnt", + "args": [ + "Balance" + ], + "documentation": [ + " Some of our funds have been burnt." + ] + }, + { + "name": "Rollover", + "args": [ + "Balance" + ], + "documentation": [ + " Spending has finished; this is the amount that rolls over until next spend." + ] + } + ] + }, + { + "name": "contract", + "prefix": "Contract", + "storage": [ + { + "name": "TransferFee", + "modifier": "Default", + "type": { + "PlainType": "BalanceOf" + }, + "fallback": "0x00000000000000000000000000000000", + "documentation": [ + " The fee required to make a transfer." + ] + }, + { + "name": "CreationFee", + "modifier": "Default", + "type": { + "PlainType": "BalanceOf" + }, + "fallback": "0x00000000000000000000000000000000", + "documentation": [ + " The fee required to create an account." + ] + }, + { + "name": "TransactionBaseFee", + "modifier": "Default", + "type": { + "PlainType": "BalanceOf" + }, + "fallback": "0x00000000000000000000000000000000", + "documentation": [ + " The fee to be paid for making a transaction; the base." + ] + }, + { + "name": "TransactionByteFee", + "modifier": "Default", + "type": { + "PlainType": "BalanceOf" + }, + "fallback": "0x00000000000000000000000000000000", + "documentation": [ + " The fee to be paid for making a transaction; the per-byte portion." + ] + }, + { + "name": "ContractFee", + "modifier": "Default", + "type": { + "PlainType": "BalanceOf" + }, + "fallback": "0x15000000000000000000000000000000", + "documentation": [ + " The fee required to create a contract instance." + ] + }, + { + "name": "CallBaseFee", + "modifier": "Default", + "type": { + "PlainType": "Gas" + }, + "fallback": "0x8700000000000000", + "documentation": [ + " The base fee charged for calling into a contract." + ] + }, + { + "name": "CreateBaseFee", + "modifier": "Default", + "type": { + "PlainType": "Gas" + }, + "fallback": "0xaf00000000000000", + "documentation": [ + " The base fee charged for creating a contract." + ] + }, + { + "name": "GasPrice", + "modifier": "Default", + "type": { + "PlainType": "BalanceOf" + }, + "fallback": "0x01000000000000000000000000000000", + "documentation": [ + " The price of one unit of gas." + ] + }, + { + "name": "MaxDepth", + "modifier": "Default", + "type": { + "PlainType": "u32" + }, + "fallback": "0x64000000", + "documentation": [ + " The maximum nesting level of a call/create stack." + ] + }, + { + "name": "BlockGasLimit", + "modifier": "Default", + "type": { + "PlainType": "Gas" + }, + "fallback": "0x40420f0000000000", + "documentation": [ + " The maximum amount of gas that could be expended per block." + ] + }, + { + "name": "GasSpent", + "modifier": "Default", + "type": { + "PlainType": "Gas" + }, + "fallback": "0x0000000000000000", + "documentation": [ + " Gas spent so far in this block." + ] + }, + { + "name": "CurrentSchedule", + "modifier": "Default", + "type": { + "PlainType": "Schedule" + }, + "fallback": "0x0000000001000000000000000100000000000000010000000000000001000000000000000100000000000000010000000000000001000000000000000100000000000000000001001000000000", + "documentation": [ + " Current cost schedule for contracts." + ] + }, + { + "name": "CodeHashOf", + "modifier": "Optional", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "CodeHash", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " The code associated with a given account." + ] + }, + { + "name": "PristineCode", + "modifier": "Optional", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "CodeHash", + "value": "Bytes", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " A mapping from an original code hash to the original code, untouched by instrumentation." + ] + }, + { + "name": "CodeStorage", + "modifier": "Optional", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "CodeHash", + "value": "PrefabWasmModule", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " A mapping between an original code hash and instrumented wasm code, ready for the execution." + ] + }, + { + "name": "AccountCounter", + "modifier": "Default", + "type": { + "PlainType": "u64" + }, + "fallback": "0x0000000000000000", + "documentation": [ + " The subtrie counter" + ] + }, + { + "name": "AccountInfoOf", + "modifier": "Optional", + "type": { + "MapType": { + "hasher": "Blake2_256", + "key": "AccountId", + "value": "AccountInfo", + "isLinked": false + } + }, + "fallback": "0x00", + "documentation": [ + " The code associated with a given account." + ] + } + ], + "calls": [ + { + "name": "update_schedule", + "args": [ + { + "name": "schedule", + "type": "Schedule" + } + ], + "documentation": [ + " Updates the schedule for metering contracts.", + "", + " The schedule must have a greater version than the stored schedule." + ] + }, + { + "name": "put_code", + "args": [ + { + "name": "gas_limit", + "type": "Compact" + }, + { + "name": "code", + "type": "Bytes" + } + ], + "documentation": [ + " Stores the given binary Wasm code into the chains storage and returns its `codehash`.", + " You can instantiate contracts only with stored code." + ] + }, + { + "name": "call", + "args": [ + { + "name": "dest", + "type": "Address" + }, + { + "name": "value", + "type": "Compact" + }, + { + "name": "gas_limit", + "type": "Compact" + }, + { + "name": "data", + "type": "Bytes" + } + ], + "documentation": [ + " Makes a call to an account, optionally transferring some balance.", + "", + " * If the account is a smart-contract account, the associated code will be", + " executed and any value will be transferred.", + " * If the account is a regular account, any value will be transferred.", + " * If no account exists and the call value is not less than `existential_deposit`,", + " a regular account will be created and any value will be transferred." + ] + }, + { + "name": "create", + "args": [ + { + "name": "endowment", + "type": "Compact" + }, + { + "name": "gas_limit", + "type": "Compact" + }, + { + "name": "code_hash", + "type": "CodeHash" + }, + { + "name": "data", + "type": "Bytes" + } + ], + "documentation": [ + " Creates a new contract from the `codehash` generated by `put_code`, optionally transferring some balance.", + "", + " Creation is executed as follows:", + "", + " - the destination address is computed based on the sender and hash of the code.", + " - the smart-contract account is created at the computed address.", + " - the `ctor_code` is executed in the context of the newly created account. Buffer returned", + " after the execution is saved as the `code` of the account. That code will be invoked", + " upon any call received by this account.", + " - The contract is initialized." + ] + } + ], + "events": [ + { + "name": "Transfer", + "args": [ + "AccountId", + "AccountId", + "Balance" + ], + "documentation": [ + " Transfer happened `from` to `to` with given `value` as part of a `call` or `create`." + ] + }, + { + "name": "Instantiated", + "args": [ + "AccountId", + "AccountId" + ], + "documentation": [ + " Contract deployed by address at the specified address." + ] + }, + { + "name": "CodeStored", + "args": [ + "Hash" + ], + "documentation": [ + " Code with the specified hash has been stored." + ] + }, + { + "name": "ScheduleUpdated", + "args": [ + "u32" + ], + "documentation": [ + " Triggered when the current schedule is updated." + ] + }, + { + "name": "Dispatched", + "args": [ + "AccountId", + "bool" + ], + "documentation": [ + " A call was dispatched from the given account. The bool signals whether it was", + " successful execution or not." + ] + }, + { + "name": "Contract", + "args": [ + "AccountId", + "Bytes" + ], + "documentation": [ + " An event from contract of account." + ] + } + ] + }, + { + "name": "sudo", + "prefix": "Sudo", + "storage": [ + { + "name": "Key", + "modifier": "Default", + "type": { + "PlainType": "AccountId" + }, + "fallback": "0x0000000000000000000000000000000000000000000000000000000000000000", + "documentation": [ + " The `AccountId` of the sudo key." + ] + } + ], + "calls": [ + { + "name": "sudo", + "args": [ + { + "name": "proposal", + "type": "Proposal" + } + ], + "documentation": [ + " Authenticates the sudo key and dispatches a function call with `Root` origin.", + "", + " The dispatch origin for this call must be _Signed_." + ] + }, + { + "name": "set_key", + "args": [ + { + "name": "new", + "type": "Address" + } + ], + "documentation": [ + " Authenticates the current sudo key and sets the given AccountId (`new`) as the new sudo key.", + "", + " The dispatch origin for this call must be _Signed_." + ] + } + ], + "events": [ + { + "name": "Sudid", + "args": [ + "bool" + ], + "documentation": [ + " A sudo just took place." + ] + }, + { + "name": "KeyChanged", + "args": [ + "AccountId" + ], + "documentation": [ + " The sudoer just switched identity; the old key is supplied." + ] + } + ] + } + ] + } + } +} diff --git a/packages/types/src/Metadata/v4/static.ts b/packages/types/src/Metadata/v4/static.ts new file mode 100644 index 0000000000..d94537694e --- /dev/null +++ b/packages/types/src/Metadata/v4/static.ts @@ -0,0 +1,7 @@ +// Copyright 2017-2019 @polkadot/types authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +const meta = '0x6d65746104441873797374656d1853797374656d012c304163636f756e744e6f6e636501010130543a3a4163636f756e74496420543a3a496e64657800200000000000000000047c2045787472696e73696373206e6f6e636520666f72206163636f756e74732e3845787472696e736963436f756e7400000c753332040004b820546f74616c2065787472696e7369637320636f756e7420666f72207468652063757272656e7420626c6f636b2e40416c6c45787472696e736963734c656e00000c753332040004390120546f74616c206c656e67746820696e20627974657320666f7220616c6c2065787472696e736963732070757420746f6765746865722c20666f72207468652063757272656e7420626c6f636b2e24426c6f636b4861736801010138543a3a426c6f636b4e756d6265721c543a3a48617368008000000000000000000000000000000000000000000000000000000000000000000498204d6170206f6620626c6f636b206e756d6265727320746f20626c6f636b206861736865732e3445787472696e736963446174610101010c7533321c5665633c75383e0004000431012045787472696e73696373206461746120666f72207468652063757272656e7420626c6f636b20286d6170732065787472696e736963277320696e64657820746f206974732064617461292e2852616e646f6d5365656401001c543a3a4861736880000000000000000000000000000000000000000000000000000000000000000004882052616e646f6d2073656564206f66207468652063757272656e7420626c6f636b2e184e756d626572010038543a3a426c6f636b4e756d626572200000000000000000040901205468652063757272656e7420626c6f636b206e756d626572206265696e672070726f6365737365642e205365742062792060657865637574655f626c6f636b602e28506172656e744861736801001c543a3a4861736880000000000000000000000000000000000000000000000000000000000000000004702048617368206f66207468652070726576696f757320626c6f636b2e3845787472696e73696373526f6f7401001c543a3a486173688000000000000000000000000000000000000000000000000000000000000000000415012045787472696e7369637320726f6f74206f66207468652063757272656e7420626c6f636b2c20616c736f2070617274206f662074686520626c6f636b206865616465722e18446967657374010024543a3a446967657374040004f020446967657374206f66207468652063757272656e7420626c6f636b2c20616c736f2070617274206f662074686520626c6f636b206865616465722e184576656e74730100685665633c4576656e745265636f72643c543a3a4576656e743e3e040004a0204576656e7473206465706f736974656420666f72207468652063757272656e7420626c6f636b2e0001084045787472696e7369635375636365737300049420416e2065787472696e73696320636f6d706c65746564207375636365737366756c6c792e3c45787472696e7369634661696c656400045420416e2065787472696e736963206661696c65642e1061757261000000002474696d657374616d702454696d657374616d7001100c4e6f77010024543a3a4d6f6d656e7420000000000000000004902043757272656e742074696d6520666f72207468652063757272656e7420626c6f636b2e2c426c6f636b506572696f64000024543a3a4d6f6d656e740400044501204f6c642073746f72616765206974656d2070726f766964656420666f7220636f6d7061746962696c6974792e2052656d6f766520616674657220616c6c206e6574776f726b732075706772616465642e344d696e696d756d506572696f64010024543a3a4d6f6d656e7420030000000000000010690120546865206d696e696d756d20706572696f64206265747765656e20626c6f636b732e204265776172652074686174207468697320697320646966666572656e7420746f20746865202a65787065637465642a20706572696f64690120746861742074686520626c6f636b2070726f64756374696f6e206170706172617475732070726f76696465732e20596f75722063686f73656e20636f6e73656e7375732073797374656d2077696c6c2067656e6572616c6c79650120776f726b2077697468207468697320746f2064657465726d696e6520612073656e7369626c6520626c6f636b2074696d652e20652e672e20466f7220417572612c2069742077696c6c20626520646f75626c6520746869737020706572696f64206f6e2064656661756c742073657474696e67732e24446964557064617465010010626f6f6c040004b420446964207468652074696d657374616d7020676574207570646174656420696e207468697320626c6f636b3f01040c736574040c6e6f7748436f6d706163743c543a3a4d6f6d656e743e205820536574207468652063757272656e742074696d652e00750120546869732063616c6c2073686f756c6420626520696e766f6b65642065786163746c79206f6e63652070657220626c6f636b2e2049742077696c6c2070616e6963206174207468652066696e616c697a6174696f6e2070686173652cbc20696620746869732063616c6c206861736e2774206265656e20696e766f6b656420627920746861742074696d652e008d01205468652074696d657374616d702073686f756c642062652067726561746572207468616e207468652070726576696f7573206f6e652062792074686520616d6f756e742073706563696669656420627920606d696e696d756d5f706572696f64602e00d820546865206469737061746368206f726967696e20666f7220746869732063616c6c206d7573742062652060496e686572656e74602e0024636f6e73656e73757324436f6e73656e73757301044c4f726967696e616c417574686f7269746965730000485665633c543a3a53657373696f6e4b65793e040000011c487265706f72745f6d69736265686176696f72041c5f7265706f72741c5665633c75383e0464205265706f727420736f6d65206d69736265686176696f722e306e6f74655f6f66666c696e65041c6f66666c696e65f43c543a3a496e686572656e744f66666c696e655265706f727420617320496e686572656e744f66666c696e655265706f72743e3a3a496e686572656e74045101204e6f74652074686174207468652070726576696f757320626c6f636b27732076616c696461746f72206d697373656420697473206f70706f7274756e69747920746f2070726f706f7365206120626c6f636b2e1872656d61726b041c5f72656d61726b1c5665633c75383e046c204d616b6520736f6d65206f6e2d636861696e2072656d61726b2e387365745f686561705f7061676573041470616765730c75363404fc2053657420746865206e756d626572206f6620706167657320696e2074686520576562417373656d626c7920656e7669726f6e6d656e74277320686561702e207365745f636f6465040c6e65771c5665633c75383e04482053657420746865206e657720636f64652e2c7365745f73746f7261676504146974656d73345665633c4b657956616c75653e046c2053657420736f6d65206974656d73206f662073746f726167652e306b696c6c5f73746f7261676504106b657973205665633c4b65793e0478204b696c6c20736f6d65206974656d732066726f6d2073746f726167652e001c696e64696365731c496e646963657301082c4e657874456e756d53657401003c543a3a4163636f756e74496e6465781000000000047c20546865206e657874206672656520656e756d65726174696f6e207365742e1c456e756d5365740101013c543a3a4163636f756e74496e646578445665633c543a3a4163636f756e7449643e00040004582054686520656e756d65726174696f6e20736574732e010001043c4e65774163636f756e74496e64657808244163636f756e744964304163636f756e74496e64657810882041206e6577206163636f756e7420696e646578207761732061737369676e65642e0005012054686973206576656e74206973206e6f7420747269676765726564207768656e20616e206578697374696e6720696e64657820697320726561737369676e65646020746f20616e6f7468657220604163636f756e744964602e2062616c616e6365732042616c616e636573012834546f74616c49737375616e6365010028543a3a42616c616e6365400000000000000000000000000000000004982054686520746f74616c20756e6974732069737375656420696e207468652073797374656d2e484578697374656e7469616c4465706f736974010028543a3a42616c616e6365400000000000000000000000000000000004d420546865206d696e696d756d20616d6f756e7420726571756972656420746f206b65657020616e206163636f756e74206f70656e2e2c5472616e73666572466565010028543a3a42616c616e636540000000000000000000000000000000000494205468652066656520726571756972656420746f206d616b652061207472616e736665722e2c4372656174696f6e466565010028543a3a42616c616e63654000000000000000000000000000000000049c205468652066656520726571756972656420746f2063726561746520616e206163636f756e742e485472616e73616374696f6e42617365466565010028543a3a42616c616e6365400000000000000000000000000000000004dc205468652066656520746f206265207061696420666f72206d616b696e672061207472616e73616374696f6e3b2074686520626173652e485472616e73616374696f6e42797465466565010028543a3a42616c616e63654000000000000000000000000000000000040d01205468652066656520746f206265207061696420666f72206d616b696e672061207472616e73616374696f6e3b20746865207065722d6279746520706f7274696f6e2e1c56657374696e6700010130543a3a4163636f756e7449646c56657374696e675363686564756c653c543a3a42616c616e63653e00040004d820496e666f726d6174696f6e20726567617264696e67207468652076657374696e67206f66206120676976656e206163636f756e742e2c4672656542616c616e636501010130543a3a4163636f756e74496428543a3a42616c616e63650040000000000000000000000000000000002c9c20546865202766726565272062616c616e6365206f66206120676976656e206163636f756e742e004101205468697320697320746865206f6e6c792062616c616e63652074686174206d61747465727320696e207465726d73206f66206d6f7374206f7065726174696f6e73206f6e20746f6b656e732e204974750120616c6f6e65206973207573656420746f2064657465726d696e65207468652062616c616e6365207768656e20696e2074686520636f6e747261637420657865637574696f6e20656e7669726f6e6d656e742e205768656e207468697355012062616c616e63652066616c6c732062656c6f77207468652076616c7565206f6620604578697374656e7469616c4465706f736974602c207468656e20746865202763757272656e74206163636f756e74272069733d012064656c657465643a207370656369666963616c6c7920604672656542616c616e6365602e20467572746865722c2074686520604f6e4672656542616c616e63655a65726f602063616c6c6261636b450120697320696e766f6b65642c20676976696e672061206368616e636520746f2065787465726e616c206d6f64756c657320746f20636c65616e2075702064617461206173736f636961746564207769746854207468652064656c65746564206163636f756e742e005d01206073797374656d3a3a4163636f756e744e6f6e63656020697320616c736f2064656c657465642069662060526573657276656442616c616e63656020697320616c736f207a65726f2028697420616c736f2067657473150120636f6c6c617073656420746f207a65726f2069662069742065766572206265636f6d6573206c657373207468616e20604578697374656e7469616c4465706f736974602e3c526573657276656442616c616e636501010130543a3a4163636f756e74496428543a3a42616c616e63650040000000000000000000000000000000002c75012054686520616d6f756e74206f66207468652062616c616e6365206f66206120676976656e206163636f756e7420746861742069732065787465726e616c6c792072657365727665643b20746869732063616e207374696c6c206765749c20736c61736865642c20627574206765747320736c6173686564206c617374206f6620616c6c2e006d0120546869732062616c616e63652069732061202772657365727665272062616c616e63652074686174206f746865722073756273797374656d732075736520696e206f7264657220746f2073657420617369646520746f6b656e732501207468617420617265207374696c6c20276f776e65642720627920746865206163636f756e7420686f6c6465722c20627574207768696368206172652073757370656e6461626c652e007501205768656e20746869732062616c616e63652066616c6c732062656c6f77207468652076616c7565206f6620604578697374656e7469616c4465706f736974602c207468656e2074686973202772657365727665206163636f756e7427b42069732064656c657465643a207370656369666963616c6c792c2060526573657276656442616c616e6365602e004d01206073797374656d3a3a4163636f756e744e6f6e63656020697320616c736f2064656c6574656420696620604672656542616c616e63656020697320616c736f207a65726f2028697420616c736f2067657473190120636f6c6c617073656420746f207a65726f2069662069742065766572206265636f6d6573206c657373207468616e20604578697374656e7469616c4465706f736974602e29144c6f636b7301010130543a3a4163636f756e744964b05665633c42616c616e63654c6f636b3c543a3a42616c616e63652c20543a3a426c6f636b4e756d6265723e3e00040004b820416e79206c6971756964697479206c6f636b73206f6e20736f6d65206163636f756e742062616c616e6365732e0108207472616e736665720810646573748c3c543a3a4c6f6f6b7570206173205374617469634c6f6f6b75703e3a3a536f757263651476616c75654c436f6d706163743c543a3a42616c616e63653e20d8205472616e7366657220736f6d65206c697175696420667265652062616c616e636520746f20616e6f74686572206163636f756e742e00090120607472616e73666572602077696c6c207365742074686520604672656542616c616e636560206f66207468652073656e64657220616e642072656365697665722e21012049742077696c6c2064656372656173652074686520746f74616c2069737375616e6365206f66207468652073797374656d2062792074686520605472616e73666572466565602e1501204966207468652073656e6465722773206163636f756e742069732062656c6f7720746865206578697374656e7469616c206465706f736974206173206120726573756c74b4206f6620746865207472616e736665722c20746865206163636f756e742077696c6c206265207265617065642e00190120546865206469737061746368206f726967696e20666f7220746869732063616c6c206d75737420626520605369676e65646020627920746865207472616e736163746f722e2c7365745f62616c616e63650c0c77686f8c3c543a3a4c6f6f6b7570206173205374617469634c6f6f6b75703e3a3a536f7572636510667265654c436f6d706163743c543a3a42616c616e63653e2072657365727665644c436f6d706163743c543a3a42616c616e63653e209420536574207468652062616c616e636573206f66206120676976656e206163636f756e742e00010120546869732077696c6c20616c74657220604672656542616c616e63656020616e642060526573657276656442616c616e63656020696e2073746f726167652e190120496620746865206e65772066726565206f722072657365727665642062616c616e63652069732062656c6f7720746865206578697374656e7469616c206465706f7369742c25012069742077696c6c20616c736f2064656372656173652074686520746f74616c2069737375616e6365206f66207468652073797374656d202860546f74616c49737375616e63656029d820616e6420726573657420746865206163636f756e74206e6f6e636520286073797374656d3a3a4163636f756e744e6f6e636560292e00b420546865206469737061746368206f726967696e20666f7220746869732063616c6c2069732060726f6f74602e010c284e65774163636f756e7408244163636f756e7449641c42616c616e6365046c2041206e6577206163636f756e742077617320637265617465642e345265617065644163636f756e7404244163636f756e744964045c20416e206163636f756e7420776173207265617065642e205472616e7366657210244163636f756e744964244163636f756e7449641c42616c616e63651c42616c616e636504b0205472616e7366657220737563636565646564202866726f6d2c20746f2c2076616c75652c2066656573292e1c73657373696f6e1c53657373696f6e01202856616c696461746f72730100445665633c543a3a4163636f756e7449643e0400047c205468652063757272656e7420736574206f662076616c696461746f72732e3453657373696f6e4c656e677468010038543a3a426c6f636b4e756d62657220e803000000000000047c2043757272656e74206c656e677468206f66207468652073657373696f6e2e3043757272656e74496e646578010038543a3a426c6f636b4e756d62657220000000000000000004782043757272656e7420696e646578206f66207468652073657373696f6e2e3043757272656e745374617274010024543a3a4d6f6d656e7420000000000000000004a02054696d657374616d70207768656e2063757272656e742073657373696f6e20737461727465642e44466f7263696e674e657753657373696f6e000010626f6f6c0400087901204e65772073657373696f6e206973206265696e6720666f72636564206966207468697320656e747279206578697374733b20696e20776869636820636173652c2074686520626f6f6c65616e2076616c75652069732077686574686572810120746865206e65772073657373696f6e2073686f756c6420626520636f6e736964657265642061206e6f726d616c20726f746174696f6e202872657761726461626c6529206f7220657863657074696f6e616c2028736c61736861626c65292e404c6173744c656e6774684368616e6765000038543a3a426c6f636b4e756d626572040004c020426c6f636b206174207768696368207468652073657373696f6e206c656e677468206c617374206368616e6765642e284e6578744b6579466f7200010130543a3a4163636f756e74496434543a3a53657373696f6e4b6579000400049020546865206e657874206b657920666f72206120676976656e2076616c696461746f722e444e65787453657373696f6e4c656e677468000038543a3a426c6f636b4e756d6265720400046420546865206e6578742073657373696f6e206c656e6774682e010c1c7365745f6b6579040c6b657934543a3a53657373696f6e4b65790861012053657473207468652073657373696f6e206b6579206f6620605f76616c696461746f726020746f20605f6b6579602e205468697320646f65736e27742074616b652065666665637420756e74696c20746865206e657874242073657373696f6e2e287365745f6c656e677468040c6e65775c436f6d706163743c543a3a426c6f636b4e756d6265723e046d01205365742061206e65772073657373696f6e206c656e6774682e20576f6e2774206b69636b20696e20756e74696c20746865206e6578742073657373696f6e206368616e6765202861742063757272656e74206c656e677468292e44666f7263655f6e65775f73657373696f6e04346170706c795f7265776172647310626f6f6c045820466f726365732061206e65772073657373696f6e2e0104284e657753657373696f6e042c426c6f636b4e756d626572085501204e65772073657373696f6e206861732068617070656e65642e204e6f746520746861742074686520617267756d656e74206973207468652073657373696f6e20696e6465782c206e6f742074686520626c6f636b88206e756d626572206173207468652074797065206d6967687420737567676573742e1c7374616b696e671c5374616b696e6701603856616c696461746f72436f756e7401000c753332100000000004a82054686520696465616c206e756d626572206f66207374616b696e67207061727469636970616e74732e544d696e696d756d56616c696461746f72436f756e7401000c7533321004000000044101204d696e696d756d206e756d626572206f66207374616b696e67207061727469636970616e7473206265666f726520656d657267656e637920636f6e646974696f6e732061726520696d706f7365642e3853657373696f6e73506572457261010038543a3a426c6f636b4e756d62657220e80300000000000004a420546865206c656e677468206f662061207374616b696e672065726120696e2073657373696f6e732e3453657373696f6e52657761726401001c50657262696c6c103c000000042101204d6178696d756d207265776172642c207065722076616c696461746f722c20746861742069732070726f7669646564207065722061636365707461626c652073657373696f6e2e304f66666c696e65536c61736801001c50657262696c6c1040420f0004510120536c6173682c207065722076616c696461746f7220746861742069732074616b656e20666f72207468652066697273742074696d6520746865792061726520666f756e6420746f206265206f66666c696e652e444f66666c696e65536c617368477261636501000c7533321000000000043901204e756d626572206f6620696e7374616e636573206f66206f66666c696e65207265706f727473206265666f726520736c617368696e6720626567696e7320666f722076616c696461746f72732e3c426f6e64696e674475726174696f6e010038543a3a426c6f636b4e756d62657220e80300000000000004b820546865206c656e677468206f662074686520626f6e64696e67206475726174696f6e20696e20626c6f636b732e34496e76756c6e657261626c65730100445665633c543a3a4163636f756e7449643e040008a50120416e792076616c696461746f72732074686174206d6179206e6576657220626520736c6173686564206f7220666f726369626c79206b69636b65642e20497427732061205665632073696e63652074686579277265206561737920746f20696e697469616c697a65ad0120616e642074686520706572666f726d616e636520686974206973206d696e696d616c2028776520657870656374206e6f206d6f7265207468616e20666f757220696e76756c6e657261626c65732920616e64207265737472696374656420746f20746573746e6574732e18426f6e64656400010130543a3a4163636f756e74496430543a3a4163636f756e744964000400040101204d61702066726f6d20616c6c206c6f636b65642022737461736822206163636f756e747320746f2074686520636f6e74726f6c6c6572206163636f756e742e184c656467657200010130543a3a4163636f756e744964e45374616b696e674c65646765723c543a3a4163636f756e7449642c2042616c616e63654f663c543e2c20543a3a426c6f636b4e756d6265723e000400044501204d61702066726f6d20616c6c2028756e6c6f636b6564292022636f6e74726f6c6c657222206163636f756e747320746f2074686520696e666f20726567617264696e6720746865207374616b696e672e14506179656501010130543a3a4163636f756e7449644452657761726444657374696e6174696f6e00040004e42057686572652074686520726577617264207061796d656e742073686f756c64206265206d6164652e204b657965642062792073746173682e2856616c696461746f727301010130543a3a4163636f756e7449647056616c696461746f7250726566733c42616c616e63654f663c543e3e01080c0004450120546865206d61702066726f6d202877616e6e616265292076616c696461746f72207374617368206b657920746f2074686520707265666572656e636573206f6620746861742076616c696461746f722e284e6f6d696e61746f727301010130543a3a4163636f756e744964445665633c543a3a4163636f756e7449643e01040004650120546865206d61702066726f6d206e6f6d696e61746f72207374617368206b657920746f2074686520736574206f66207374617368206b657973206f6620616c6c2076616c696461746f727320746f206e6f6d696e6174652e1c5374616b65727301010130543a3a4163636f756e744964904578706f737572653c543a3a4163636f756e7449642c2042616c616e63654f663c543e3e000c00000010b101204e6f6d696e61746f727320666f72206120706172746963756c6172206163636f756e74207468617420697320696e20616374696f6e207269676874206e6f772e20596f752063616e27742069746572617465207468726f7567682076616c696461746f727320686572652cc02062757420796f752063616e2066696e64207468656d20696e20746865206073657373696f6e7360206d6f64756c652e00902054686973206973206b6579656420627920746865207374617368206163636f756e742e3843757272656e74456c65637465640100445665633c543a3a4163636f756e7449643e040004fc205468652063757272656e746c7920656c65637465642076616c696461746f7220736574206b65796564206279207374617368206163636f756e742049442e2843757272656e74457261010038543a3a426c6f636b4e756d626572200000000000000000045c205468652063757272656e742065726120696e6465782e5043757272656e7453657373696f6e52657761726401003042616c616e63654f663c543e4000000000000000000000000000000000042101204d6178696d756d207265776172642c207065722076616c696461746f722c20746861742069732070726f7669646564207065722061636365707461626c652073657373696f6e2e4043757272656e7445726152657761726401003042616c616e63654f663c543e40000000000000000000000000000000000869012054686520616363756d756c617465642072657761726420666f72207468652063757272656e74206572612e20526573657420746f207a65726f2061742074686520626567696e6e696e67206f66207468652065726120616e64cc20696e6372656173656420666f72206576657279207375636365737366756c6c792066696e69736865642073657373696f6e2e484e65787453657373696f6e73506572457261000038543a3a426c6f636b4e756d6265720400049020546865206e6578742076616c7565206f662073657373696f6e7320706572206572612e4c4c6173744572614c656e6774684368616e6765010038543a3a426c6f636b4e756d62657220000000000000000004e0205468652073657373696f6e20696e6465782061742077686963682074686520657261206c656e677468206c617374206368616e6765642e24536c6f745374616b6501003042616c616e63654f663c543e40000000000000000000000000000000000c31012054686520616d6f756e74206f662062616c616e6365206163746976656c79206174207374616b6520666f7220656163682076616c696461746f7220736c6f742c2063757272656e746c792e00c02054686973206973207573656420746f20646572697665207265776172647320616e642070756e6973686d656e74732e28536c617368436f756e7401010130543a3a4163636f756e7449640c75333200100000000004d10120546865206e756d626572206f662074696d6573206120676976656e2076616c696461746f7220686173206265656e207265706f72746564206f66666c696e652e205468697320676574732064656372656d656e746564206279206f6e652065616368206572612074686174207061737365732e34466f7263696e674e65774572610000082829040004682057652061726520666f7263696e672061206e6577206572612e3c526563656e746c794f66666c696e650100a05665633c28543a3a4163636f756e7449642c20543a3a426c6f636b4e756d6265722c20753332293e040004f101204d6f737420726563656e742060524543454e545f4f46464c494e455f434f554e546020696e7374616e6365732e202877686f206974207761732c207768656e20697420776173207265706f727465642c20686f77206d616e7920696e7374616e63657320746865792077657265206f66666c696e6520666f72292e013c10626f6e640c28636f6e74726f6c6c65728c3c543a3a4c6f6f6b7570206173205374617469634c6f6f6b75703e3a3a536f757263651476616c756554436f6d706163743c42616c616e63654f663c543e3e1470617965654452657761726444657374696e6174696f6e1081012054616b6520746865206f726967696e206163636f756e74206173206120737461736820616e64206c6f636b207570206076616c756560206f66206974732062616c616e63652e2060636f6e74726f6c6c6572602077696c6c2062652074686568206163636f756e74207468617420636f6e74726f6c732069742e00250120546865206469737061746368206f726967696e20666f7220746869732063616c6c206d757374206265205f5369676e65645f20627920746865207374617368206163636f756e742e28626f6e645f657874726104386d61785f6164646974696f6e616c54436f6d706163743c42616c616e63654f663c543e3e1875012041646420736f6d6520657874726120616d6f756e742074686174206861766520617070656172656420696e207468652073746173682060667265655f62616c616e63656020696e746f207468652062616c616e636520757020666f7224207374616b696e672e00510120557365207468697320696620746865726520617265206164646974696f6e616c2066756e647320696e20796f7572207374617368206163636f756e74207468617420796f75207769736820746f20626f6e642e00550120546865206469737061746368206f726967696e20666f7220746869732063616c6c206d757374206265205f5369676e65645f206279207468652073746173682c206e6f742074686520636f6e74726f6c6c65722e18756e626f6e64041476616c756554436f6d706163743c42616c616e63654f663c543e3e285501205363686564756c65206120706f7274696f6e206f662074686520737461736820746f20626520756e6c6f636b656420726561647920666f72207472616e73666572206f75742061667465722074686520626f6e64010120706572696f6420656e64732e2049662074686973206c656176657320616e20616d6f756e74206163746976656c7920626f6e646564206c657373207468616e350120543a3a43757272656e63793a3a6578697374656e7469616c5f6465706f73697428292c207468656e20697420697320696e6372656173656420746f207468652066756c6c20616d6f756e742e004901204f6e63652074686520756e6c6f636b20706572696f6420697320646f6e652c20796f752063616e2063616c6c206077697468647261775f756e626f6e6465646020746f2061637475616c6c79206d6f7665c0207468652066756e6473206f7574206f66206d616e6167656d656e7420726561647920666f72207472616e736665722e00550120546865206469737061746368206f726967696e20666f7220746869732063616c6c206d757374206265205f5369676e65645f2062792074686520636f6e74726f6c6c65722c206e6f74207468652073746173682e00982053656520616c736f205b6043616c6c3a3a77697468647261775f756e626f6e646564605d2e4477697468647261775f756e626f6e64656400202d012052656d6f766520616e7920756e6c6f636b6564206368756e6b732066726f6d207468652060756e6c6f636b696e67602071756575652066726f6d206f7572206d616e6167656d656e742e003501205468697320657373656e7469616c6c7920667265657320757020746861742062616c616e636520746f206265207573656420627920746865207374617368206163636f756e7420746f20646f4c2077686174657665722069742077616e74732e00550120546865206469737061746368206f726967696e20666f7220746869732063616c6c206d757374206265205f5369676e65645f2062792074686520636f6e74726f6c6c65722c206e6f74207468652073746173682e006c2053656520616c736f205b6043616c6c3a3a756e626f6e64605d2e2076616c6964617465041470726566737056616c696461746f7250726566733c42616c616e63654f663c543e3e14e8204465636c617265207468652064657369726520746f2076616c696461746520666f7220746865206f726967696e20636f6e74726f6c6c65722e00dc20456666656374732077696c6c2062652066656c742061742074686520626567696e6e696e67206f6620746865206e657874206572612e00550120546865206469737061746368206f726967696e20666f7220746869732063616c6c206d757374206265205f5369676e65645f2062792074686520636f6e74726f6c6c65722c206e6f74207468652073746173682e206e6f6d696e617465041c74617267657473a05665633c3c543a3a4c6f6f6b7570206173205374617469634c6f6f6b75703e3a3a536f757263653e141101204465636c617265207468652064657369726520746f206e6f6d696e6174652060746172676574736020666f7220746865206f726967696e20636f6e74726f6c6c65722e00dc20456666656374732077696c6c2062652066656c742061742074686520626567696e6e696e67206f6620746865206e657874206572612e00550120546865206469737061746368206f726967696e20666f7220746869732063616c6c206d757374206265205f5369676e65645f2062792074686520636f6e74726f6c6c65722c206e6f74207468652073746173682e146368696c6c0014c8204465636c617265206e6f2064657369726520746f206569746865722076616c6964617465206f72206e6f6d696e6174652e00dc20456666656374732077696c6c2062652066656c742061742074686520626567696e6e696e67206f6620746865206e657874206572612e00550120546865206469737061746368206f726967696e20666f7220746869732063616c6c206d757374206265205f5369676e65645f2062792074686520636f6e74726f6c6c65722c206e6f74207468652073746173682e247365745f7061796565041470617965654452657761726444657374696e6174696f6e14b8202852652d2973657420746865207061796d656e742074617267657420666f72206120636f6e74726f6c6c65722e00dc20456666656374732077696c6c2062652066656c742061742074686520626567696e6e696e67206f6620746865206e657874206572612e00550120546865206469737061746368206f726967696e20666f7220746869732063616c6c206d757374206265205f5369676e65645f2062792074686520636f6e74726f6c6c65722c206e6f74207468652073746173682e387365745f636f6e74726f6c6c65720428636f6e74726f6c6c65728c3c543a3a4c6f6f6b7570206173205374617469634c6f6f6b75703e3a3a536f7572636514b8202852652d2973657420746865207061796d656e742074617267657420666f72206120636f6e74726f6c6c65722e00dc20456666656374732077696c6c2062652066656c742061742074686520626567696e6e696e67206f6620746865206e657874206572612e00550120546865206469737061746368206f726967696e20666f7220746869732063616c6c206d757374206265205f5369676e65645f206279207468652073746173682c206e6f742074686520636f6e74726f6c6c65722e507365745f73657373696f6e735f7065725f657261040c6e65775c436f6d706163743c543a3a426c6f636b4e756d6265723e04982053657420746865206e756d626572206f662073657373696f6e7320696e20616e206572612e507365745f626f6e64696e675f6475726174696f6e040c6e65775c436f6d706163743c543a3a426c6f636b4e756d6265723e04b020546865206c656e677468206f662074686520626f6e64696e67206475726174696f6e20696e20657261732e4c7365745f76616c696461746f725f636f756e74040c6e657730436f6d706163743c7533323e04802054686520696465616c206e756d626572206f662076616c696461746f72732e34666f7263655f6e65775f65726104346170706c795f7265776172647310626f6f6c083d0120466f72636520746865726520746f2062652061206e6577206572612e205468697320616c736f20666f726365732061206e65772073657373696f6e20696d6d6564696174656c792061667465722e250120606170706c795f72657761726473602073686f756c64206265207472756520666f722076616c696461746f727320746f20676574207468652073657373696f6e207265776172642e5c7365745f6f66666c696e655f736c6173685f6772616365040c6e657730436f6d706163743c7533323e04902053657420746865206f66666c696e6520736c61736820677261636520706572696f642e447365745f696e76756c6e657261626c6573042876616c696461746f7273445665633c543a3a4163636f756e7449643e04cc20536574207468652076616c696461746f72732077686f2063616e6e6f7420626520736c61736865642028696620616e79292e010c18526577617264041c42616c616e636504e020416c6c2076616c696461746f72732068617665206265656e2072657761726465642062792074686520676976656e2062616c616e63652e384f66666c696e655761726e696e6708244163636f756e7449640c753332085501204f6e652076616c696461746f722028616e64207468656972206e6f6d696e61746f72732920686173206265656e20676976656e2061206f66666c696e652d7761726e696e67202874686579277265207374696c6c15012077697468696e207468656972206772616365292e205468652061636372756564206e756d626572206f6620736c6173686573206973207265636f726465642c20746f6f2e304f66666c696e65536c61736808244163636f756e7449641c42616c616e6365042d01204f6e652076616c696461746f722028616e64207468656972206e6f6d696e61746f72732920686173206265656e20736c61736865642062792074686520676976656e20616d6f756e742e2464656d6f63726163792444656d6f637261637901403c5075626c696350726f70436f756e7401002450726f70496e646578100000000004f420546865206e756d626572206f6620287075626c6963292070726f706f73616c7320746861742068617665206265656e206d61646520736f206661722e2c5075626c696350726f70730100ac5665633c2850726f70496e6465782c20543a3a50726f706f73616c2c20543a3a4163636f756e744964293e0400048020546865207075626c69632070726f706f73616c732e20556e736f727465642e244465706f7369744f660001012450726f70496e646578842842616c616e63654f663c543e2c205665633c543a3a4163636f756e7449643e2900040004842054686f73652077686f2068617665206c6f636b65642061206465706f7369742e304c61756e6368506572696f64010038543a3a426c6f636b4e756d62657220e80300000000000004e420486f77206f6674656e2028696e20626c6f636b7329206e6577207075626c6963207265666572656e646120617265206c61756e636865642e384d696e696d756d4465706f73697401003042616c616e63654f663c543e400000000000000000000000000000000004350120546865206d696e696d756d20616d6f756e7420746f20626520757365642061732061206465706f73697420666f722061207075626c6963207265666572656e64756d2070726f706f73616c2e2c5075626c696344656c6179010038543a3a426c6f636b4e756d62657220000000000000000004d4205468652064656c6179206265666f726520656e6163746d656e7420666f7220616c6c207075626c6963207265666572656e64612e384d61784c6f636b506572696f647301002c4c6f636b506572696f6473040004d90120546865206d6178696d756d206e756d626572206f66206164646974696f6e616c206c6f636b20706572696f6473206120766f746572206d6179206f6666657220746f20737472656e677468656e20746865697220766f74652e204d756c7469706c6573206f6620605075626c696344656c6179602e30566f74696e67506572696f64010038543a3a426c6f636b4e756d62657220e80300000000000004b820486f77206f6674656e2028696e20626c6f636b732920746f20636865636b20666f72206e657720766f7465732e3c5265666572656e64756d436f756e7401003c5265666572656e64756d496e646578100000000004390120546865206e6578742066726565207265666572656e64756d20696e6465782c20616b6120746865206e756d626572206f66207265666572656e64756d73207374617274656420736f206661722e244e65787454616c6c7901003c5265666572656e64756d496e646578100000000004c820546865206e657874207265666572656e64756d20696e64657820746861742073686f756c642062652074616c6c6965642e405265666572656e64756d496e666f4f660001013c5265666572656e64756d496e646578b4285265666572656e64756d496e666f3c543a3a426c6f636b4e756d6265722c20543a3a50726f706f73616c3e2900040004b420496e666f726d6174696f6e20636f6e6365726e696e6720616e7920676976656e207265666572656e64756d2e344469737061746368517565756501010138543a3a426c6f636b4e756d626572ac5665633c4f7074696f6e3c28543a3a50726f706f73616c2c205265666572656e64756d496e646578293e3e00040004c0205175657565206f66207375636365737366756c207265666572656e646120746f20626520646973706174636865642e24566f74657273466f720101013c5265666572656e64756d496e646578445665633c543a3a4163636f756e7449643e00040004a4204765742074686520766f7465727320666f72207468652063757272656e742070726f706f73616c2e18566f74654f660101017c285265666572656e64756d496e6465782c20543a3a4163636f756e7449642910566f74650004000cd501204765742074686520766f746520696e206120676976656e207265666572656e64756d206f66206120706172746963756c617220766f7465722e2054686520726573756c74206973206d65616e696e6766756c206f6e6c792069662060766f746572735f666f726020696e636c7564657320746865c90120766f746572207768656e2063616c6c6564207769746820746865207265666572656e64756d2028796f75276c6c20676574207468652064656661756c742060566f7465602076616c7565206f7468657277697365292e20496620796f7520646f6e27742077616e7420746f20636865636b61012060766f746572735f666f72602c207468656e20796f752063616e20616c736f20636865636b20666f722073696d706c65206578697374656e636520776974682060566f74654f663a3a657869737473602066697273742e1450726f787900010130543a3a4163636f756e74496430543a3a4163636f756e74496400040004b9012057686f2069732061626c6520746f20766f746520666f722077686f6d2e2056616c7565206973207468652066756e642d686f6c64696e67206163636f756e742c206b65792069732074686520766f74652d7472616e73616374696f6e2d73656e64696e67206163636f756e742e2c44656c65676174696f6e7301010130543a3a4163636f756e7449646c28543a3a4163636f756e7449642c204c6f636b506572696f64732901840000000000000000000000000000000000000000000000000000000000000000000441012047657420746865206163636f756e742028616e64206c6f636b20706572696f64732920746f20776869636820616e6f74686572206163636f756e742069732064656c65676174696e6720766f74652e01301c70726f706f7365082070726f706f73616c40426f783c543a3a50726f706f73616c3e1476616c756554436f6d706163743c42616c616e63654f663c543e3e04a02050726f706f736520612073656e73697469766520616374696f6e20746f2062652074616b656e2e187365636f6e64042070726f706f73616c48436f6d706163743c50726f70496e6465783e04a02050726f706f736520612073656e73697469766520616374696f6e20746f2062652074616b656e2e10766f746508247265665f696e64657860436f6d706163743c5265666572656e64756d496e6465783e10766f746510566f746508350120566f746520696e2061207265666572656e64756d2e2049662060766f74652e69735f6179652829602c2074686520766f746520697320746f20656e616374207468652070726f706f73616c3bbc206f7468657277697365206974206973206120766f746520746f206b65657020746865207374617475732071756f2e2870726f78795f766f746508247265665f696e64657860436f6d706163743c5265666572656e64756d496e6465783e10766f746510566f746508890120566f746520696e2061207265666572656e64756d206f6e20626568616c66206f6620612073746173682e2049662060766f74652e69735f6179652829602c2074686520766f746520697320746f20656e616374207468652070726f706f73616c3bbc206f7468657277697365206974206973206120766f746520746f206b65657020746865207374617475732071756f2e4073746172745f7265666572656e64756d0c2070726f706f73616c40426f783c543a3a50726f706f73616c3e247468726573686f6c6434566f74655468726573686f6c641464656c617938543a3a426c6f636b4e756d62657204502053746172742061207265666572656e64756d2e4463616e63656c5f7265666572656e64756d04247265665f696e64657860436f6d706163743c5265666572656e64756d496e6465783e04542052656d6f76652061207265666572656e64756d2e3463616e63656c5f71756575656408107768656e5c436f6d706163743c543a3a426c6f636b4e756d6265723e14776869636830436f6d706163743c7533323e04a02043616e63656c20612070726f706f73616c2071756575656420666f7220656e6163746d656e742e247365745f70726f7879041470726f787930543a3a4163636f756e7449640498205370656369667920612070726f78792e2043616c6c6564206279207468652073746173682e3072657369676e5f70726f787900049820436c656172207468652070726f78792e2043616c6c6564206279207468652070726f78792e3072656d6f76655f70726f7879041470726f787930543a3a4163636f756e744964049820436c656172207468652070726f78792e2043616c6c6564206279207468652073746173682e2064656c65676174650808746f30543a3a4163636f756e744964306c6f636b5f706572696f64732c4c6f636b506572696f6473043c2044656c656761746520766f74652e28756e64656c656761746500044420556e64656c656761746520766f74652e01242050726f706f736564082450726f70496e6465781c42616c616e636500185461626c65640c2450726f70496e6465781c42616c616e6365385665633c4163636f756e7449643e001c53746172746564083c5265666572656e64756d496e64657834566f74655468726573686f6c640018506173736564043c5265666572656e64756d496e64657800244e6f74506173736564043c5265666572656e64756d496e646578002443616e63656c6c6564043c5265666572656e64756d496e64657800204578656375746564083c5265666572656e64756d496e64657810626f6f6c002444656c65676174656408244163636f756e744964244163636f756e744964002c556e64656c65676174656404244163636f756e744964001c636f756e63696c1c436f756e63696c01503443616e646964616379426f6e6401003042616c616e63654f663c543e400900000000000000000000000000000004050120486f77206d7563682073686f756c64206265206c6f636b656420757020696e206f7264657220746f207375626d6974206f6e6527732063616e6469646163792e28566f74696e67426f6e6401003042616c616e63654f663c543e400000000000000000000000000000000004090120486f77206d7563682073686f756c64206265206c6f636b656420757020696e206f7264657220746f2062652061626c6520746f207375626d697420766f7465732e5050726573656e74536c617368506572566f74657201003042616c616e63654f663c543e4001000000000000000000000000000000040d01205468652070756e6973686d656e742c2070657220766f7465722c20696620796f752070726f7669646520616e20696e76616c69642070726573656e746174696f6e2e284361727279436f756e7401000c753332100200000004350120486f77206d616e792072756e6e6572732d75702073686f756c64206861766520746865697220617070726f76616c73207065727369737420756e74696c20746865206e65787420766f74652e5050726573656e746174696f6e4475726174696f6e010038543a3a426c6f636b4e756d62657220e803000000000000043d0120486f77206c6f6e6720746f2067697665206561636820746f702063616e64696461746520746f2070726573656e74207468656d73656c7665732061667465722074686520766f746520656e64732e4c496e6163746976654772616365506572696f64010024566f7465496e646578100100000008a10120486f77206d616e7920766f746520696e6465786573206e65656420746f20676f20627920616674657220612074617267657420766f7465722773206c61737420766f7465206265666f726520746865792063616e206265207265617065642069662074686569725020617070726f76616c7320617265206d6f6f742e30566f74696e67506572696f64010038543a3a426c6f636b4e756d62657220e80300000000000004b820486f77206f6674656e2028696e20626c6f636b732920746f20636865636b20666f72206e657720766f7465732e305465726d4475726174696f6e010038543a3a426c6f636b4e756d626572200500000000000000049820486f77206c6f6e67206561636820706f736974696f6e2069732061637469766520666f722e3044657369726564536561747301000c753332100000000004e8204e756d626572206f66206163636f756e747320746861742073686f756c642062652073697474696e67206f6e2074686520636f756e63696c2e34416374697665436f756e63696c01008c5665633c28543a3a4163636f756e7449642c20543a3a426c6f636b4e756d626572293e0400106d01205468652063757272656e7420636f756e63696c2e205768656e2074686572652773206120766f746520676f696e67206f6e2c20746869732073686f756c64207374696c6c206265207573656420666f72206578656375746976657101206d6174746572732e2054686520626c6f636b206e756d62657220287365636f6e6420656c656d656e7420696e20746865207475706c65292069732074686520626c6f636b207468617420746865697220706f736974696f6e20697371012061637469766520756e74696c202863616c63756c61746564206279207468652073756d206f662074686520626c6f636b206e756d626572207768656e2074686520636f756e63696c206d656d6265722077617320656c65637465646820616e64207468656972207465726d206475726174696f6e292e24566f7465436f756e74010024566f7465496e64657810000000000405012054686520746f74616c206e756d626572206f6620766f746573207468617420686176652068617070656e6564206f722061726520696e2070726f67726573732e2c417070726f76616c734f6601010130543a3a4163636f756e744964245665633c626f6f6c3e000400086d012041206c697374206f6620766f74657320666f72206561636820766f7465722c2072657370656374696e6720746865206c61737420636c656172656420766f746520696e6465782074686174207468697320766f7465722077617340206c617374206163746976652061742e385265676973746572496e666f4f6600010130543a3a4163636f756e7449644028566f7465496e6465782c2075333229000400087d012054686520766f746520696e64657820616e64206c69737420736c6f742074686174207468652063616e646964617465206077686f60207761732072656769737465726564206f7220604e6f6e6560206966207468657920617265206e6f74582063757272656e746c7920726567697374657265642e304c6173744163746976654f6600010130543a3a4163636f756e74496424566f7465496e64657800040004010120546865206c61737420636c656172656420766f746520696e6465782074686174207468697320766f74657220776173206c617374206163746976652061742e18566f746572730100445665633c543a3a4163636f756e7449643e04000460205468652070726573656e7420766f746572206c6973742e2843616e646964617465730100445665633c543a3a4163636f756e7449643e04000470205468652070726573656e742063616e646964617465206c6973742e3843616e646964617465436f756e7401000c753332100000000000304e65787446696e616c697a650000a028543a3a426c6f636b4e756d6265722c207533322c205665633c543a3a4163636f756e7449643e29040004210120546865206163636f756e747320686f6c64696e672074686520736561747320746861742077696c6c206265636f6d652066726565206f6e20746865206e6578742074616c6c792e40536e617073686f7465645374616b65730100445665633c42616c616e63654f663c543e3e040004e820546865207374616b6573206173207468657920776572652061742074686520706f696e7420746861742074686520766f746520656e6465642e2c4c6561646572626f6172640000845665633c2842616c616e63654f663c543e2c20543a3a4163636f756e744964293e040004e02047657420746865206c6561646572626f61726420696620776527726520696e207468652070726573656e746174696f6e2070686173652e0128347365745f617070726f76616c730814766f746573245665633c626f6f6c3e14696e64657848436f6d706163743c566f7465496e6465783e086101205365742063616e64696461746520617070726f76616c732e20417070726f76616c20736c6f747320737461792076616c6964206173206c6f6e672061732063616e6469646174657320696e2074686f736520736c6f7473402061726520726567697374657265642e4c70726f78795f7365745f617070726f76616c730814766f746573245665633c626f6f6c3e14696e64657848436f6d706163743c566f7465496e6465783e089501205365742063616e64696461746520617070726f76616c732066726f6d20612070726f78792e20417070726f76616c20736c6f747320737461792076616c6964206173206c6f6e672061732063616e6469646174657320696e2074686f736520736c6f7473402061726520726567697374657265642e4c726561705f696e6163746976655f766f74657210387265706f727465725f696e64657830436f6d706163743c7533323e0c77686f8c3c543a3a4c6f6f6b7570206173205374617469634c6f6f6b75703e3a3a536f757263652477686f5f696e64657830436f6d706163743c7533323e48617373756d65645f766f74655f696e64657848436f6d706163743c566f7465496e6465783e1461012052656d6f7665206120766f7465722e20466f72206974206e6f7420746f206265206120626f6e642d636f6e73756d696e67206e6f2d6f702c20616c6c20617070726f7665642063616e64696461746520696e64696365737101206d757374206e6f772062652065697468657220756e72656769737465726564206f72207265676973746572656420746f20612063616e646964617465207468617420726567697374657265642074686520736c6f74206166746572a02074686520766f7465722067617665207468656972206c61737420617070726f76616c207365742e000101204d61792062652063616c6c656420627920616e796f6e652e2052657475726e732074686520766f746572206465706f73697420746f20607369676e6564602e34726574726163745f766f7465720414696e64657830436f6d706163743c7533323e042d012052656d6f7665206120766f7465722e20416c6c20766f746573206172652063616e63656c6c656420616e642074686520766f746572206465706f7369742069732072657475726e65642e407375626d69745f63616e6469646163790410736c6f7430436f6d706163743c7533323e0c78205375626d6974206f6e6573656c6620666f722063616e6469646163792e001101204163636f756e74206d757374206861766520656e6f756768207472616e736665727261626c652066756e647320696e20697420746f207061792074686520626f6e642e3870726573656e745f77696e6e65720c2463616e6469646174658c3c543a3a4c6f6f6b7570206173205374617469634c6f6f6b75703e3a3a536f7572636514746f74616c54436f6d706163743c42616c616e63654f663c543e3e14696e64657848436f6d706163743c566f7465496e6465783e0c650120436c61696d207468617420607369676e656460206973206f6e65206f662074686520746f702053656c663a3a63617272795f636f756e742829202b2063757272656e745f766f746528292e312063616e646964617465732ea501204f6e6c7920776f726b73206966207468652060626c6f636b5f6e756d626572203e3d2063757272656e745f766f746528292e306020616e6420603c2063757272656e745f766f746528292e30202b2070726573656e746174696f6e5f6475726174696f6e282960607820607369676e6564602073686f756c642068617665206174206c65617374447365745f646573697265645f73656174730414636f756e7430436f6d706163743c7533323e0c650120536574207468652064657369726564206d656d62657220636f756e743b206966206c6f776572207468616e207468652063757272656e7420636f756e742c207468656e2073656174732077696c6c206e6f74206265207570690120656c656374696f6e207768656e2074686579206578706972652e204966206d6f72652c207468656e2061206e657720766f74652077696c6c2062652073746172746564206966206f6e65206973206e6f7420616c72656164793420696e2070726f67726573732e3472656d6f76655f6d656d626572040c77686f8c3c543a3a4c6f6f6b7570206173205374617469634c6f6f6b75703e3a3a536f757263650c71012052656d6f7665206120706172746963756c6172206d656d6265722e20412074616c6c792077696c6c2068617070656e20696e7374616e746c7920286966206e6f7420616c726561647920696e20612070726573656e746174696f6e410120706572696f642920746f2066696c6c2074686520736561742069662072656d6f76616c206d65616e732074686174207468652064657369726564206d656d6265727320617265206e6f74206d65742e7c20546869732069732065666665637469766520696d6d6564696174656c792e647365745f70726573656e746174696f6e5f6475726174696f6e0414636f756e745c436f6d706163743c543a3a426c6f636b4e756d6265723e08590120536574207468652070726573656e746174696f6e206475726174696f6e2e2049662074686572652069732063757272656e746c79206120766f7465206265696e672070726573656e74656420666f722c2077696c6c6020696e766f6b65206066696e616c697a655f766f7465602e447365745f7465726d5f6475726174696f6e0414636f756e745c436f6d706163743c543a3a426c6f636b4e756d6265723e08510120536574207468652070726573656e746174696f6e206475726174696f6e2e2049662074686572652069732063757272656e74206120766f7465206265696e672070726573656e74656420666f722c2077696c6c6020696e766f6b65206066696e616c697a655f766f7465602e01102c566f74657252656170656408244163636f756e744964244163636f756e74496404542072656170656420766f7465722c2072656170657240426164526561706572536c617368656404244163636f756e744964043c20736c6173686564207265617065723054616c6c7953746172746564040c75333204f420412074616c6c792028666f7220617070726f76616c20766f746573206f6620636f756e63696c2073656174287329292068617320737461727465642e3854616c6c7946696e616c697a656408385665633c4163636f756e7449643e385665633c4163636f756e7449643e04690120412074616c6c792028666f7220617070726f76616c20766f746573206f6620636f756e63696c2073656174287329292068617320656e646564202877697468206f6e65206f72206d6f7265206e6577206d656d62657273292e38636f756e63696c5f766f74696e6734436f756e63696c566f74696e67012034436f6f6c6f6666506572696f64010038543a3a426c6f636b4e756d62657220e8030000000000000030566f74696e67506572696f64010038543a3a426c6f636b4e756d6265722003000000000000000040456e61637444656c6179506572696f64010038543a3a426c6f636b4e756d62657220000000000000000004cd01204e756d626572206f6620626c6f636b7320627920776869636820746f2064656c617920656e6163746d656e74206f66207375636365737366756c2c206e6f6e2d756e616e696d6f75732d636f756e63696c2d696e7374696761746564207265666572656e64756d2070726f706f73616c732e2450726f706f73616c730100785665633c28543a3a426c6f636b4e756d6265722c20543a3a48617368293e0400002850726f706f73616c4f660001011c543a3a486173682c543a3a50726f706f73616c000400003850726f706f73616c566f746572730101011c543a3a48617368445665633c543a3a4163636f756e7449643e0004000034436f756e63696c566f74654f660001015c28543a3a486173682c20543a3a4163636f756e7449642910626f6f6c00040000385665746f656450726f706f73616c0001011c543a3a486173688c28543a3a426c6f636b4e756d6265722c205665633c543a3a4163636f756e7449643e290004000001141c70726f706f7365042070726f706f73616c40426f783c543a3a50726f706f73616c3e0010766f7465082070726f706f73616c1c543a3a486173681c617070726f766510626f6f6c00107665746f043470726f706f73616c5f686173681c543a3a4861736800487365745f636f6f6c6f66665f706572696f640418626c6f636b735c436f6d706163743c543a3a426c6f636b4e756d6265723e00447365745f766f74696e675f706572696f640418626c6f636b735c436f6d706163743c543a3a426c6f636b4e756d6265723e0001084054616c6c7943616e63656c6174696f6e1010486173680c7533320c7533320c753332080101204120766f74696e672074616c6c79206861732068617070656e656420666f722061207265666572656e64756d2063616e63656c6c6174696f6e20766f74652ea0204c61737420746872656520617265207965732c206e6f2c206162737461696e20636f756e74732e3c54616c6c795265666572656e64756d1010486173680c7533320c7533320c75333208cc204120766f74696e672074616c6c79206861732068617070656e656420666f722061207265666572656e64756d20766f74652ea0204c61737420746872656520617265207965732c206e6f2c206162737461696e20636f756e74732e3c636f756e63696c5f6d6f74696f6e7338436f756e63696c4d6f74696f6e7301102450726f706f73616c730100305665633c543a3a486173683e04000498205468652028686173686573206f662920746865206163746976652070726f706f73616c732e2850726f706f73616c4f660001011c543a3a48617368583c542061732054726169743e3a3a50726f706f73616c00040004cc2041637475616c2070726f706f73616c20666f72206120676976656e20686173682c20696620697427732063757272656e742e18566f74696e670001011c543a3a48617368e82850726f706f73616c496e6465782c207533322c205665633c543a3a4163636f756e7449643e2c205665633c543a3a4163636f756e7449643e2900040004250120566f74657320666f72206120676976656e2070726f706f73616c3a202872657175697265645f7965735f766f7465732c207965735f766f746572732c206e6f5f766f74657273292e3450726f706f73616c436f756e7401000c753332100000000004482050726f706f73616c7320736f206661722e01081c70726f706f736508247468726573686f6c6430436f6d706163743c7533323e2070726f706f73616c6c426f783c3c542061732054726169743e3a3a50726f706f73616c3e0010766f74650c2070726f706f73616c1c543a3a4861736814696e64657858436f6d706163743c50726f706f73616c496e6465783e1c617070726f766510626f6f6c0001142050726f706f73656410244163636f756e7449643450726f706f73616c496e64657810486173680c7533320465012041206d6f74696f6e2028676976656e20686173682920686173206265656e2070726f706f7365642028627920676976656e206163636f756e742920776974682061207468726573686f6c642028676976656e20753332292e14566f74656414244163636f756e744964104861736810626f6f6c0c7533320c7533320809012041206d6f74696f6e2028676976656e20686173682920686173206265656e20766f746564206f6e20627920676976656e206163636f756e742c206c656176696e67f420612074616c6c79202879657320766f74657320616e64206e6f20766f74657320676976656e206173207533327320726573706563746976656c79292e20417070726f76656404104861736804c42041206d6f74696f6e2077617320617070726f76656420627920746865207265717569726564207468726573686f6c642e2c446973617070726f76656404104861736804d42041206d6f74696f6e20776173206e6f7420617070726f76656420627920746865207265717569726564207468726573686f6c642e20457865637574656408104861736810626f6f6c0405012041206d6f74696f6e207761732065786563757465643b2060626f6f6c6020697320747275652069662072657475726e656420776974686f7574206572726f722e4066696e616c6974795f747261636b6572000001042866696e616c5f68696e74041068696e745c436f6d706163743c543a3a426c6f636b4e756d6265723e08f42048696e7420746861742074686520617574686f72206f66207468697320626c6f636b207468696e6b732074686520626573742066696e616c697a65646c20626c6f636b2069732074686520676976656e206e756d6265722e001c6772616e6470613c4772616e64706146696e616c69747901083450656e64696e674368616e67650000c853746f72656450656e64696e674368616e67653c543a3a426c6f636b4e756d6265722c20543a3a53657373696f6e4b65793e040000284e657874466f72636564000038543a3a426c6f636b4e756d6265720400000104487265706f72745f6d69736265686176696f72041c5f7265706f72741c5665633c75383e0464205265706f727420736f6d65206d69736265686176696f722e0104384e6577417574686f72697469657304585665633c2853657373696f6e4b65792c20753634293e0490204e657720617574686f726974792073657420686173206265656e206170706c6965642e20747265617375727920547265617375727901203050726f706f73616c426f6e6401001c5065726d696c6c10000000000851012050726f706f7274696f6e206f662066756e647320746861742073686f756c6420626520626f6e64656420696e206f7264657220746f20706c61636520612070726f706f73616c2e20416e206163636570746564dc2070726f706f73616c2067657473207468657365206261636b2e20412072656a65637465642070726f706f73616c20646f65736e27742e4c50726f706f73616c426f6e644d696e696d756d01003042616c616e63654f663c543e4000000000000000000000000000000000044901204d696e696d756d20616d6f756e74206f662066756e647320746861742073686f756c6420626520706c6163656420696e2061206465706f73697420666f72206d616b696e6720612070726f706f73616c2e2c5370656e64506572696f64010038543a3a426c6f636b4e756d626572200100000000000000048820506572696f64206265747765656e2073756363657373697665207370656e64732e104275726e01001c5065726d696c6c10000000000411012050657263656e74616765206f662073706172652066756e64732028696620616e7929207468617420617265206275726e7420706572207370656e6420706572696f642e0c506f7401003042616c616e63654f663c543e400000000000000000000000000000000004cc20546f74616c2066756e647320617661696c61626c6520746f2074686973206d6f64756c6520666f72207370656e64696e672e3450726f706f73616c436f756e7401003450726f706f73616c496e646578100000000004a4204e756d626572206f662070726f706f73616c7320746861742068617665206265656e206d6164652e2450726f706f73616c730001013450726f706f73616c496e6465789050726f706f73616c3c543a3a4163636f756e7449642c2042616c616e63654f663c543e3e000400047c2050726f706f73616c7320746861742068617665206265656e206d6164652e24417070726f76616c730100485665633c50726f706f73616c496e6465783e040004f82050726f706f73616c20696e646963657320746861742068617665206265656e20617070726f76656420627574206e6f742079657420617761726465642e01143470726f706f73655f7370656e64081476616c756554436f6d706163743c42616c616e63654f663c543e3e2c62656e65666963696172798c3c543a3a4c6f6f6b7570206173205374617469634c6f6f6b75703e3a3a536f757263650c2d012050757420666f727761726420612073756767657374696f6e20666f72207370656e64696e672e2041206465706f7369742070726f706f7274696f6e616c20746f207468652076616c7565350120697320726573657276656420616e6420736c6173686564206966207468652070726f706f73616c2069732072656a65637465642e2049742069732072657475726e6564206f6e636520746865542070726f706f73616c20697320617761726465642e1c7365745f706f74041c6e65775f706f7454436f6d706163743c42616c616e63654f663c543e3e04b420536574207468652062616c616e6365206f662066756e647320617661696c61626c6520746f207370656e642e24636f6e666967757265103470726f706f73616c5f626f6e6440436f6d706163743c5065726d696c6c3e5470726f706f73616c5f626f6e645f6d696e696d756d54436f6d706163743c42616c616e63654f663c543e3e307370656e645f706572696f645c436f6d706163743c543a3a426c6f636b4e756d6265723e106275726e40436f6d706163743c5065726d696c6c3e0470202852652d29636f6e6669677572652074686973206d6f64756c652e3c72656a6563745f70726f706f73616c042c70726f706f73616c5f696458436f6d706163743c50726f706f73616c496e6465783e04fc2052656a65637420612070726f706f736564207370656e642e20546865206f726967696e616c206465706f7369742077696c6c20626520736c61736865642e40617070726f76655f70726f706f73616c042c70726f706f73616c5f696458436f6d706163743c50726f706f73616c496e6465783e085d0120417070726f766520612070726f706f73616c2e2041742061206c617465722074696d652c207468652070726f706f73616c2077696c6c20626520616c6c6f636174656420746f207468652062656e6566696369617279ac20616e6420746865206f726967696e616c206465706f7369742077696c6c2062652072657475726e65642e01142050726f706f736564043450726f706f73616c496e6465780438204e65772070726f706f73616c2e205370656e64696e67041c42616c616e636504e8205765206861766520656e6465642061207370656e6420706572696f6420616e642077696c6c206e6f7720616c6c6f636174652066756e64732e1c417761726465640c3450726f706f73616c496e6465781c42616c616e6365244163636f756e744964048020536f6d652066756e64732068617665206265656e20616c6c6f63617465642e144275726e74041c42616c616e6365048c20536f6d65206f66206f75722066756e64732068617665206265656e206275726e742e20526f6c6c6f766572041c42616c616e6365043101205370656e64696e67206861732066696e69736865643b20746869732069732074686520616d6f756e74207468617420726f6c6c73206f76657220756e74696c206e657874207370656e642e20636f6e747261637420436f6e747261637401442c5472616e7366657246656501003042616c616e63654f663c543e40000000000000000000000000000000000494205468652066656520726571756972656420746f206d616b652061207472616e736665722e2c4372656174696f6e46656501003042616c616e63654f663c543e4000000000000000000000000000000000049c205468652066656520726571756972656420746f2063726561746520616e206163636f756e742e485472616e73616374696f6e4261736546656501003042616c616e63654f663c543e400000000000000000000000000000000004dc205468652066656520746f206265207061696420666f72206d616b696e672061207472616e73616374696f6e3b2074686520626173652e485472616e73616374696f6e4279746546656501003042616c616e63654f663c543e4000000000000000000000000000000000040d01205468652066656520746f206265207061696420666f72206d616b696e672061207472616e73616374696f6e3b20746865207065722d6279746520706f7274696f6e2e2c436f6e747261637446656501003042616c616e63654f663c543e401500000000000000000000000000000004c0205468652066656520726571756972656420746f20637265617465206120636f6e747261637420696e7374616e63652e2c43616c6c42617365466565010018543a3a47617320870000000000000004c820546865206261736520666565206368617267656420666f722063616c6c696e6720696e746f206120636f6e74726163742e3443726561746542617365466565010018543a3a47617320af0000000000000004b820546865206261736520666565206368617267656420666f72206372656174696e67206120636f6e74726163742e20476173507269636501003042616c616e63654f663c543e4001000000000000000000000000000000047820546865207072696365206f66206f6e6520756e6974206f66206761732e204d6178446570746801000c753332106400000004c820546865206d6178696d756d206e657374696e67206c6576656c206f6620612063616c6c2f63726561746520737461636b2e34426c6f636b4761734c696d6974010018543a3a4761732040420f000000000004f020546865206d6178696d756d20616d6f756e74206f6620676173207468617420636f756c6420626520657870656e6465642070657220626c6f636b2e204761735370656e74010018543a3a476173200000000000000000048020476173207370656e7420736f2066617220696e207468697320626c6f636b2e3c43757272656e745363686564756c650100405363686564756c653c543a3a4761733e3501000000000100000000000000010000000000000001000000000000000100000000000000010000000000000001000000000000000100000000000000010000000000000000000100100000000004942043757272656e7420636f7374207363686564756c6520666f7220636f6e7472616374732e28436f6465486173684f6600010130543a3a4163636f756e7449642c436f6465486173683c543e00040004a82054686520636f6465206173736f6369617465642077697468206120676976656e206163636f756e742e305072697374696e65436f64650001012c436f6465486173683c543e1c5665633c75383e0004000465012041206d617070696e672066726f6d20616e206f726967696e616c20636f6465206861736820746f20746865206f726967696e616c20636f64652c20756e746f756368656420627920696e737472756d656e746174696f6e2e2c436f646553746f726167650001012c436f6465486173683c543e587761736d3a3a5072656661625761736d4d6f64756c650004000475012041206d617070696e67206265747765656e20616e206f726967696e616c20636f6465206861736820616e6420696e737472756d656e746564207761736d20636f64652c20726561647920666f722074686520657865637574696f6e2e384163636f756e74436f756e74657201000c753634200000000000000000045020546865207375627472696520636f756e746572344163636f756e74496e666f4f6600010130543a3a4163636f756e7449642c4163636f756e74496e666f00040004a82054686520636f6465206173736f6369617465642077697468206120676976656e206163636f756e742e01103c7570646174655f7363686564756c6504207363686564756c65405363686564756c653c543a3a4761733e0cb4205570646174657320746865207363686564756c6520666f72206d65746572696e6720636f6e7472616374732e000d0120546865207363686564756c65206d7573742068617665206120677265617465722076657273696f6e207468616e207468652073746f726564207363686564756c652e207075745f636f646508246761735f6c696d69743c436f6d706163743c543a3a4761733e10636f64651c5665633c75383e0859012053746f7265732074686520676976656e2062696e617279205761736d20636f646520696e746f2074686520636861696e732073746f7261676520616e642072657475726e73206974732060636f646568617368602ed420596f752063616e20696e7374616e746961746520636f6e747261637473206f6e6c7920776974682073746f72656420636f64652e1063616c6c1010646573748c3c543a3a4c6f6f6b7570206173205374617469634c6f6f6b75703e3a3a536f757263651476616c756554436f6d706163743c42616c616e63654f663c543e3e246761735f6c696d69743c436f6d706163743c543a3a4761733e10646174611c5665633c75383e1c0901204d616b657320612063616c6c20746f20616e206163636f756e742c206f7074696f6e616c6c79207472616e7366657272696e6720736f6d652062616c616e63652e002901202a20496620746865206163636f756e74206973206120736d6172742d636f6e7472616374206163636f756e742c20746865206173736f63696174656420636f64652077696c6c206265b020657865637574656420616e6420616e792076616c75652077696c6c206265207472616e736665727265642e1901202a20496620746865206163636f756e74206973206120726567756c6172206163636f756e742c20616e792076616c75652077696c6c206265207472616e736665727265642e4901202a204966206e6f206163636f756e742065786973747320616e64207468652063616c6c2076616c7565206973206e6f74206c657373207468616e20606578697374656e7469616c5f6465706f736974602c1501206120726567756c6172206163636f756e742077696c6c206265206372656174656420616e6420616e792076616c75652077696c6c206265207472616e736665727265642e186372656174651024656e646f776d656e7454436f6d706163743c42616c616e63654f663c543e3e246761735f6c696d69743c436f6d706163743c543a3a4761733e24636f64655f686173682c436f6465486173683c543e10646174611c5665633c75383e28a90120437265617465732061206e657720636f6e74726163742066726f6d207468652060636f646568617368602067656e65726174656420627920607075745f636f6465602c206f7074696f6e616c6c79207472616e7366657272696e6720736f6d652062616c616e63652e0084204372656174696f6e20697320657865637574656420617320666f6c6c6f77733a004101202d207468652064657374696e6174696f6e206164647265737320697320636f6d7075746564206261736564206f6e207468652073656e64657220616e642068617368206f662074686520636f64652e0501202d2074686520736d6172742d636f6e7472616374206163636f756e7420697320637265617465642061742074686520636f6d707574656420616464726573732e6d01202d20746865206063746f725f636f64656020697320657865637574656420696e2074686520636f6e74657874206f6620746865206e65776c792063726561746564206163636f756e742e204275666665722072657475726e65645d0120202061667465722074686520657865637574696f6e206973207361766564206173207468652060636f646560206f6620746865206163636f756e742e205468617420636f64652077696c6c20626520696e766f6b6564a820202075706f6e20616e792063616c6c2072656365697665642062792074686973206163636f756e742e7c202d2054686520636f6e747261637420697320696e697469616c697a65642e0118205472616e736665720c244163636f756e744964244163636f756e7449641c42616c616e6365045501205472616e736665722068617070656e6564206066726f6d6020746f2060746f60207769746820676976656e206076616c7565602061732070617274206f662061206063616c6c60206f722060637265617465602e30496e7374616e74696174656408244163636f756e744964244163636f756e74496404dc20436f6e7472616374206465706c6f7965642062792061646472657373206174207468652073706563696669656420616464726573732e28436f646553746f72656404104861736804b820436f646520776974682074686520737065636966696564206861736820686173206265656e2073746f7265642e3c5363686564756c6555706461746564040c75333204c020547269676765726564207768656e207468652063757272656e74207363686564756c6520697320757064617465642e284469737061746368656408244163636f756e74496410626f6f6c08390120412063616c6c2077617320646973706174636865642066726f6d2074686520676976656e206163636f756e742e2054686520626f6f6c207369676e616c7320776865746865722069742077617374207375636365737366756c20657865637574696f6e206f72206e6f742e20436f6e747261637408244163636f756e7449641c5665633c75383e048c20416e206576656e742066726f6d20636f6e7472616374206f66206163636f756e742e107375646f105375646f01040c4b6579010030543a3a4163636f756e74496480000000000000000000000000000000000000000000000000000000000000000004842054686520604163636f756e74496460206f6620746865207375646f206b65792e0108107375646f042070726f706f73616c40426f783c543a3a50726f706f73616c3e0c39012041757468656e7469636174657320746865207375646f206b657920616e64206469737061746368657320612066756e6374696f6e2063616c6c20776974682060526f6f7460206f726967696e2e00d020546865206469737061746368206f726967696e20666f7220746869732063616c6c206d757374206265205f5369676e65645f2e1c7365745f6b6579040c6e65778c3c543a3a4c6f6f6b7570206173205374617469634c6f6f6b75703e3a3a536f757263650c75012041757468656e74696361746573207468652063757272656e74207375646f206b657920616e6420736574732074686520676976656e204163636f756e7449642028606e6577602920617320746865206e6577207375646f206b65792e00d020546865206469737061746368206f726967696e20666f7220746869732063616c6c206d757374206265205f5369676e65645f2e01081453756469640410626f6f6c04602041207375646f206a75737420746f6f6b20706c6163652e284b65794368616e67656404244163636f756e74496404f020546865207375646f6572206a757374207377697463686564206964656e746974793b20746865206f6c64206b657920697320737570706c6965642e'; + +export default meta; diff --git a/packages/types/src/Metadata/v4/toV3.ts b/packages/types/src/Metadata/v4/toV3.ts new file mode 100644 index 0000000000..528d155b58 --- /dev/null +++ b/packages/types/src/Metadata/v4/toV3.ts @@ -0,0 +1,10 @@ +// Copyright 2017-2019 @polkadot/types authors & contributors +// This software may be modified and distributed under the terms +// of the Apache-2.0 license. See the LICENSE file for details. + +import MetadataV3 from '../v3/Metadata'; +import MetadataV4 from '.'; + +export default function toV3 (v4: MetadataV4): MetadataV3 { + return new MetadataV3(v4); +} diff --git a/packages/types/src/primitive/StorageKey.ts b/packages/types/src/primitive/StorageKey.ts index c84245633e..8f790df398 100644 --- a/packages/types/src/primitive/StorageKey.ts +++ b/packages/types/src/primitive/StorageKey.ts @@ -7,11 +7,12 @@ import { AnyU8a } from '../types'; import { isFunction } from '@plugnet/util'; import Bytes from './Bytes'; -import { StorageFunctionMetadata } from '../Metadata/v0/Modules'; +import { StorageFunctionMetadata as MetaV0 } from '../Metadata/v0/Storage'; +import { StorageFunctionMetadata as MetaV4 } from '../Metadata/v4/Storage'; export interface StorageFunction { (arg?: any): Uint8Array; - meta: StorageFunctionMetadata; + meta: MetaV0 | MetaV4; method: string; section: string; toJSON: () => any; @@ -25,7 +26,7 @@ export interface StorageFunction { * constructed by passing in a raw key or a StorageFunction with (optional) arguments. */ export default class StorageKey extends Bytes { - private _meta: StorageFunctionMetadata | null; + private _meta: MetaV0 | MetaV4 | null; private _outputType: string | null; constructor (value: AnyU8a | StorageKey | StorageFunction | [StorageFunction, any]) { @@ -49,7 +50,7 @@ export default class StorageKey extends Bytes { return value as Uint8Array; } - static getMeta (value: StorageKey | StorageFunction | [StorageFunction, any]): StorageFunctionMetadata | null { + static getMeta (value: StorageKey | StorageFunction | [StorageFunction, any]): MetaV0 | MetaV4 | null { if (value instanceof StorageKey) { return value.meta; } else if (isFunction(value)) { @@ -80,7 +81,7 @@ export default class StorageKey extends Bytes { /** * @description The metadata or `null` when not available */ - get meta (): StorageFunctionMetadata | null { + get meta (): MetaV0 | MetaV4 | null { return this._meta; } diff --git a/packages/types/src/scripts/METHODS_STORAGE_SUBSTRATE.md b/packages/types/src/scripts/METHODS_STORAGE_SUBSTRATE.md index f0f6edc58b..326487a809 100644 --- a/packages/types/src/scripts/METHODS_STORAGE_SUBSTRATE.md +++ b/packages/types/src/scripts/METHODS_STORAGE_SUBSTRATE.md @@ -9,7 +9,7 @@ _These are keys that are always available to the runtime implementation_ - **summary**: Number of authorities. ▸ **authorityPrefix**(): `u32` -- **summary**: Prefix under which authorities are storied. +- **summary**: Prefix under which authorities are stored. ▸ **changesTrieConfig**(): `u32` - **summary**: Changes trie configuration is stored under this key.