From 0dc46445bcc9b09244d7cb3311bdd8829bef9827 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Wed, 1 Apr 2020 22:44:34 +0200 Subject: [PATCH] Bump dev (incl. lint fixes) (#2126) * Bump dev (incl. lint fixes) * Fix call encoding (stepped into that one) * Event struct order * Update with missing tuple type (getTypeDef type) --- CHANGELOG.md | 4 +- .../03_listen_to_balance_change/index.js | 4 +- .../promise/09_transfer_events/index.js | 2 +- docs/examples/rx/09_transfer_events/index.js | 2 +- jest.config.js | 2 + package.json | 2 +- packages/api-contract/src/ContractRegistry.ts | 18 +- packages/api-contract/src/MetaRegistry.ts | 12 +- packages/api-contract/src/base/Contract.ts | 14 +- packages/api-contract/src/base/util.ts | 6 +- packages/api-derive/src/accounts/info.ts | 8 +- packages/api-derive/src/balances/account.ts | 4 +- .../src/democracy/_referendumInfo.ts | 2 +- .../api-derive/src/democracy/dispatchQueue.ts | 4 +- .../api-derive/src/democracy/proposals.ts | 2 +- packages/api-derive/src/elections/info.ts | 4 +- packages/api-derive/src/society/candidates.ts | 2 +- packages/api-derive/src/society/info.ts | 2 +- packages/api-derive/src/society/member.ts | 2 +- packages/api-derive/src/staking/overview.ts | 4 +- packages/api-derive/src/tx/signingInfo.ts | 4 +- packages/api/src/base/Decorate.ts | 2 +- packages/api/src/checkTypes.manual.ts | 2 +- packages/api/src/promise/Api.spec.ts | 8 +- packages/api/src/submittable/createClass.ts | 4 +- packages/api/src/util/augmentObject.spec.ts | 14 +- packages/api/test/util/logEvents.ts | 2 +- .../fromMetadata/createFunction.spec.ts | 74 +-- .../storage/fromMetadata/createFunction.ts | 8 +- .../storage/fromMetadata/substrate.ts | 4 +- .../metadata/src/Metadata/util/toCallsOnly.ts | 12 +- packages/metadata/src/Metadata/v0/toV1.ts | 6 +- packages/metadata/src/Metadata/v10/toV11.ts | 8 +- .../metadata/src/Metadata/v11/toLatest.ts | 8 +- packages/metadata/src/Metadata/v3/toV4.ts | 10 +- packages/metadata/src/Metadata/v4/toV5.ts | 12 +- packages/metadata/src/Metadata/v6/toV7.ts | 2 +- packages/rpc-core/src/index.ts | 4 +- .../src/coder/decodeResponse.spec.ts | 4 +- packages/rpc-provider/src/mock/index.ts | 2 +- packages/rpc-provider/src/ws/send.spec.ts | 4 +- packages/rpc-provider/test/mockWs.ts | 8 +- .../scripts/polkadot-types-chain-info.js | 4 +- .../scripts/polkadot-types-from-chain.js | 1 + .../scripts/polkadot-types-from-defs.js | 1 + .../polkadot-types-internal-interfaces.js | 1 + .../polkadot-types-internal-metadata.js | 1 + packages/typegen/src/extractChain.ts | 4 +- packages/typegen/src/fromChain.ts | 8 +- packages/typegen/src/fromDefs.ts | 8 +- packages/typegen/src/metadataMd.ts | 64 +-- packages/typegen/src/util/derived.ts | 12 +- packages/typegen/src/util/imports.ts | 4 +- packages/types-known/src/chain/westend.ts | 3 +- packages/types-known/src/index.spec.ts | 4 +- packages/types-known/src/metadata.ts | 6 +- packages/types-known/src/modules.ts | 10 +- packages/types/src/codec/Enum.spec.ts | 3 + packages/types/src/codec/Linkage.ts | 1 + packages/types/src/codec/Result.spec.ts | 2 +- packages/types/src/codec/Result.ts | 1 + packages/types/src/codec/Set.spec.ts | 3 + packages/types/src/codec/Set.ts | 5 +- packages/types/src/codec/Struct.spec.ts | 2 + packages/types/src/codec/Tuple.spec.ts | 1 + packages/types/src/codec/utils/encodeTypes.ts | 2 +- packages/types/src/create/createClass.ts | 6 +- packages/types/src/create/createType.spec.ts | 10 +- packages/types/src/create/getTypeDef.spec.ts | 84 ++-- packages/types/src/create/getTypeDef.ts | 4 +- packages/types/src/create/registry.spec.ts | 8 +- packages/types/src/create/registry.ts | 2 +- packages/types/src/extrinsic/Extrinsic.ts | 10 +- packages/types/src/extrinsic/v1/Extrinsic.ts | 1 + .../src/extrinsic/v1/ExtrinsicPayload.ts | 3 + .../src/extrinsic/v1/ExtrinsicSignature.ts | 3 + packages/types/src/extrinsic/v2/Extrinsic.ts | 1 + .../src/extrinsic/v2/ExtrinsicPayload.ts | 2 + .../src/extrinsic/v2/ExtrinsicSignature.ts | 2 + packages/types/src/extrinsic/v3/Extrinsic.ts | 1 + .../src/extrinsic/v3/ExtrinsicPayload.ts | 6 +- packages/types/src/extrinsic/v4/Extrinsic.ts | 1 + .../src/extrinsic/v4/ExtrinsicSignature.ts | 1 + packages/types/src/generic/Block.spec.ts | 2 + packages/types/src/generic/Block.ts | 1 + packages/types/src/generic/Call.ts | 11 +- packages/types/src/generic/Event.ts | 5 +- packages/types/src/generic/Vote.ts | 4 +- .../src/interfaces/account/definitions.ts | 3 + .../interfaces/attestations/definitions.ts | 3 + .../types/src/interfaces/aura/definitions.ts | 3 + .../src/interfaces/author/definitions.ts | 3 + .../src/interfaces/authorship/definitions.ts | 3 + .../types/src/interfaces/babe/definitions.ts | 3 + .../src/interfaces/balances/definitions.ts | 3 + .../types/src/interfaces/chain/definitions.ts | 3 + .../src/interfaces/childstate/definitions.ts | 3 + .../src/interfaces/claims/definitions.ts | 3 + .../src/interfaces/collective/definitions.ts | 3 + .../src/interfaces/consensus/definitions.ts | 3 + .../src/interfaces/contracts/definitions.ts | 3 + .../src/interfaces/democracy/definitions.ts | 3 + .../src/interfaces/elections/definitions.ts | 3 + .../src/interfaces/engine/definitions.ts | 3 + .../types/src/interfaces/evm/definitions.ts | 3 + .../src/interfaces/extrinsics/definitions.ts | 3 + .../interfaces/genericAsset/definitions.ts | 3 + .../src/interfaces/grandpa/definitions.ts | 3 + .../src/interfaces/identity/definitions.ts | 3 + .../src/interfaces/imOnline/definitions.ts | 3 + .../src/interfaces/metadata/definitions.ts | 3 + .../src/interfaces/offchain/definitions.ts | 3 + .../src/interfaces/offences/definitions.ts | 3 + .../src/interfaces/parachains/definitions.ts | 3 + .../src/interfaces/payment/definitions.ts | 3 + .../src/interfaces/recovery/definitions.ts | 3 + .../types/src/interfaces/rpc/definitions.ts | 3 + .../src/interfaces/runtime/definitions.ts | 3 + .../src/interfaces/session/definitions.ts | 3 + .../src/interfaces/society/definitions.ts | 3 + .../src/interfaces/staking/definitions.ts | 3 + .../types/src/interfaces/state/definitions.ts | 3 + .../src/interfaces/system/definitions.ts | 3 + .../src/interfaces/treasury/definitions.ts | 7 +- .../src/interfaces/utility/definitions.ts | 11 +- .../src/interfaces/vesting/definitions.ts | 3 + packages/types/src/primitive/Data.ts | 2 + packages/types/src/primitive/StorageKey.ts | 8 +- typedoc.js | 6 +- yarn.lock | 438 ++++++++++-------- 130 files changed, 718 insertions(+), 483 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 381eab40f4..6d1300a27e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # 1.9.1 Apr 1, 2020 -**Breaking change** (TypeScript with derives only) The return type names for `api.derive.*` have been adjusted for consistency, all starting with `Derive*` (previously a mixture of `Derived*` and `Derive*`) -**Breaking change** (derives only) Additional cleanups of democracy proposal & referenda derives, including support for new Polkadot/Substrate vote retrievals +- **Breaking change** (TypeScript with derives only) The return type names for `api.derive.*` have been adjusted for consistency, all starting with `Derive*` (previously a mixture of `Derived*` and `Derive*`) +- **Breaking change** (derives only) Additional cleanups of democracy proposal & referenda derives, including support for new Polkadot/Substrate vote retrievals - Tx signing via `signAndSend` & `signAsync` now tries to use the last finalized block (depending on finalized drift) - Add support for `api.rpc.childstate.*` Substrate RPCs, older nodes with still populate `api.rpc.state.*` with the child methods - Adjust `Error.message` on RPC failures to not include the (already known) method signature diff --git a/docs/examples/promise/03_listen_to_balance_change/index.js b/docs/examples/promise/03_listen_to_balance_change/index.js index 2ffbbd736b..a61745cd83 100755 --- a/docs/examples/promise/03_listen_to_balance_change/index.js +++ b/docs/examples/promise/03_listen_to_balance_change/index.js @@ -13,13 +13,13 @@ async function main () { // Retrieve the initial balance. Since the call has no callback, it is simply a promise // that resolves to the current on-chain value - let { nonce: previousNonce, data: { free: previousFree } } = await api.query.system.account(Alice); + let { data: { free: previousFree }, nonce: previousNonce } = await api.query.system.account(Alice); console.log(`${Alice} has a balance of ${previousFree}, nonce ${previousNonce}`); console.log(`You may leave this example running and start example 06 or transfer any value to ${Alice}`); // Here we subscribe to any balance changes and update the on-screen value - api.query.system.account(Alice, ({ nonce: currentNonce, data: { free: currentFree } }) => { + api.query.system.account(Alice, ({ data: { free: currentFree }, nonce: currentNonce }) => { // Calculate the delta const change = currentFree.sub(previousFree); diff --git a/docs/examples/promise/09_transfer_events/index.js b/docs/examples/promise/09_transfer_events/index.js index b787af6f7f..f61f0081a4 100755 --- a/docs/examples/promise/09_transfer_events/index.js +++ b/docs/examples/promise/09_transfer_events/index.js @@ -44,7 +44,7 @@ async function main () { console.log('Included at block hash', status.asInBlock.toHex()); console.log('Events:'); - events.forEach(({ phase, event: { data, method, section } }) => { + events.forEach(({ event: { data, method, section }, phase }) => { console.log('\t', phase.toString(), `: ${section}.${method}`, data.toString()); }); } else if (status.isFinalized) { diff --git a/docs/examples/rx/09_transfer_events/index.js b/docs/examples/rx/09_transfer_events/index.js index dbeb356e24..b1c9ea4ad8 100644 --- a/docs/examples/rx/09_transfer_events/index.js +++ b/docs/examples/rx/09_transfer_events/index.js @@ -48,7 +48,7 @@ async function main () { console.log('Included at block hash', status.asInBlock.toHex()); console.log('Events:'); - events.forEach(({ phase, event: { data, method, section } }) => { + events.forEach(({ event: { data, method, section }, phase }) => { console.log('\t', phase.toString(), `: ${section}.${method}`, data.toString()); }); } else if (status.isFinalized) { diff --git a/jest.config.js b/jest.config.js index 1b6508eb8b..aa7ccfe55d 100644 --- a/jest.config.js +++ b/jest.config.js @@ -6,10 +6,12 @@ module.exports = Object.assign({}, config, { moduleNameMapper: { '@polkadot/api-contract(.*)$': '/packages/api-contract/src/$1', '@polkadot/api-derive(.*)$': '/packages/api-derive/src/$1', + // eslint-disable-next-line sort-keys '@polkadot/api(.*)$': '/packages/api/src/$1', '@polkadot/metadata(.*)$': '/packages/metadata/src/$1', '@polkadot/rpc-(core|provider)(.*)$': '/packages/rpc-$1/src/$2', '@polkadot/types-known(.*)$': '/packages/types-known/src/$1', + // eslint-disable-next-line sort-keys '@polkadot/types(.*)$': '/packages/types/src/$1' }, modulePathIgnorePatterns: [ diff --git a/package.json b/package.json index d22bf288fa..f8795af8ea 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "@babel/core": "^7.9.0", "@babel/register": "^7.9.0", "@babel/runtime": "^7.9.2", - "@polkadot/dev": "^0.51.9", + "@polkadot/dev": "^0.52.3", "@polkadot/ts": "^0.3.14", "@polkadot/typegen": "workspace:packages/typegen", "@types/jest": "^25.1.4", diff --git a/packages/api-contract/src/ContractRegistry.ts b/packages/api-contract/src/ContractRegistry.ts index e57f8a1c07..c2a88cc3b4 100644 --- a/packages/api-contract/src/ContractRegistry.ts +++ b/packages/api-contract/src/ContractRegistry.ts @@ -83,7 +83,7 @@ export default class ContractRegistry extends MetaRegistry { assert(unknownKeys.length === 0, `Unknown keys ${unknownKeys.join(', ')} found in ABI args for messages.${message.name}`); - const { name, selector, return_type: returnType } = message; + const { name, return_type: returnType, selector } = message; assert(isNumber(name) && isString(this.stringAt(name)), `Expected name for ${fnname}`); assert(isNull(returnType) || (isNumber(returnType.ty) && isObject(this.typeDefAt(returnType.ty))), `Expected return_type for ${fnname}`); @@ -150,12 +150,12 @@ export default class ContractRegistry extends MetaRegistry { return args.map(({ name, type, ...arg }) => ({ ...arg, name: this.stringAt(name), type: this.convertType(type) })); } - public convertType ({ ty, display_name: displayNameIndices }: ContractABITypePre): TypeDef { + public convertType ({ display_name: displayNameIndices, ty }: ContractABITypePre): TypeDef { const displayName = this.stringsAt(displayNameIndices).join('::'); return this.typeDefAt(ty, { displayName }); } - public convertContract ({ constructors, messages, name, events, ...contract }: ContractABIContractPre): ContractABIContract { + public convertContract ({ constructors, events, messages, name, ...contract }: ContractABIContractPre): ContractABIContract { return { constructors: this.convertConstructors(constructors), messages: messages.map((message) => this.convertMessage(message)), @@ -202,13 +202,13 @@ export default class ContractRegistry extends MetaRegistry { } } - public convertStorageStruct ({ 'struct.type': structType, 'struct.fields': structFields }: ContractABIStorageStructPre): ContractABIStorageStruct { + public convertStorageStruct ({ 'struct.fields': structFields, 'struct.type': structType }: ContractABIStorageStructPre): ContractABIStorageStruct { return { - 'struct.type': this.typeDefAt(structType), - 'struct.fields': structFields.map(({ name, layout }) => ({ - name: this.stringAt(name), - layout: this.convertStorageLayout(layout) - })) + 'struct.fields': structFields.map(({ layout, name }) => ({ + layout: this.convertStorageLayout(layout), + name: this.stringAt(name) + })), + 'struct.type': this.typeDefAt(structType) }; } diff --git a/packages/api-contract/src/MetaRegistry.ts b/packages/api-contract/src/MetaRegistry.ts index c15ba2cdb2..6b441eba38 100644 --- a/packages/api-contract/src/MetaRegistry.ts +++ b/packages/api-contract/src/MetaRegistry.ts @@ -244,13 +244,13 @@ export default class MetaRegistry extends MetadataRegistryLookup { return { info: TypeDefInfo.Vec, - type: `Vec<${type}>`, - sub: this.typeDefFromMetaTypeAt(vecTypeIndex) + sub: this.typeDefFromMetaTypeAt(vecTypeIndex), + type: `Vec<${type}>` }; } private typeDefForBuiltinVecFixed (id: MetaTypeIdVecFixed, typeIndex?: TypeIndex): Pick { - const { 'array.type': vecTypeIndex, 'array.len': vecLength } = id; + const { 'array.len': vecLength, 'array.type': vecTypeIndex } = id; assert(!vecLength || vecLength <= 256, 'MetaRegistry: Only support for [Type; ], where length <= 256'); assert(!typeIndex || vecTypeIndex !== typeIndex, `MetaRegistry: self-referencing registry type at index ${typeIndex}`); @@ -261,8 +261,8 @@ export default class MetaRegistry extends MetadataRegistryLookup { return { info: TypeDefInfo.VecFixed, length: vecLength, // ex: { type: type } - type: `[${type};${vecLength}]`, - sub: this.typeDefFromMetaTypeAt(vecTypeIndex) + sub: this.typeDefFromMetaTypeAt(vecTypeIndex), + type: `[${type};${vecLength}]` }; } @@ -288,7 +288,7 @@ export default class MetaRegistry extends MetadataRegistryLookup { private typeDefForClikeEnum (def: MetaTypeDefClikeEnum): Pick { return { info: TypeDefInfo.Enum, - sub: def['clike_enum.variants'].map(({ name: nameIndex, discriminant }): TypeDef => ({ + sub: def['clike_enum.variants'].map(({ discriminant, name: nameIndex }): TypeDef => ({ ext: { discriminant }, info: TypeDefInfo.Plain, name: this.stringAt(nameIndex), diff --git a/packages/api-contract/src/base/Contract.ts b/packages/api-contract/src/base/Contract.ts index b51d037256..a2d5cd0cd7 100644 --- a/packages/api-contract/src/base/Contract.ts +++ b/packages/api-contract/src/base/Contract.ts @@ -36,7 +36,7 @@ export default class Contract extends BaseWithTxAndRpc public call (as: 'rpc', message: string, value: BN | number, gasLimit: BN | number, ...params: any[]): ContractCall; public call (as: 'tx', message: string, value: BN | number, gasLimit: BN | number, ...params: any[]): ContractCall; public call (as: CallType, message: string, value: BN | number, gasLimit: BN | number, ...params: any[]): ContractCall { - const { fn, def } = this.getMessage(message); + const { def, fn } = this.getMessage(message); return { send: this.decorateMethod( @@ -44,11 +44,11 @@ export default class Contract extends BaseWithTxAndRpc ? (account: IKeyringPair | string | AccountId | Address): ContractCallResult<'rpc'> => this.rpcContractsCall( this.registry.createType('ContractCallRequest', { - origin: account, dest: this.address.toString(), - value, gasLimit, - inputData: fn(...params) + inputData: fn(...params), + origin: account, + value }) ).pipe(map((result: ContractExecResult): ContractCallOutcome => this.createOutcome(result, this.registry.createType('AccountId', account), def, params) @@ -73,13 +73,13 @@ export default class Contract extends BaseWithTxAndRpc } return { - time: Date.now(), + isSuccess: result.isSuccess, message, origin, + output, params, result, - isSuccess: result.isSuccess, - output + time: Date.now() }; } diff --git a/packages/api-contract/src/base/util.ts b/packages/api-contract/src/base/util.ts index ad7dcb3613..b7d157042c 100644 --- a/packages/api-contract/src/base/util.ts +++ b/packages/api-contract/src/base/util.ts @@ -31,9 +31,9 @@ export abstract class Base implements ContractBase ({ - index, def, - fn: this.abi.messages[def.name] || this.abi.messages[stringCamelCase(name)] + fn: this.abi.messages[def.name] || this.abi.messages[stringCamelCase(name)], + index }) ); } @@ -49,7 +49,7 @@ export abstract class Base implements ContractBase, superOf?: [Accou : undefined, email: dataAsString(info.email), image: dataAsString(info.image), + judgements, legal: dataAsString(info.legal), other: info.additional.reduce((other: Record, [_key, _value]): Record => { const key = dataAsString(_key); @@ -78,8 +79,7 @@ function extractIdentity (identityOfOpt?: Option, superOf?: [Accou : undefined, riot: dataAsString(info.riot), twitter: dataAsString(info.twitter), - web: dataAsString(info.web), - judgements + web: dataAsString(info.web) }; } @@ -140,9 +140,9 @@ function retrieveFlags (api: ApiInterfaceRx, accountId?: AccountId): Observable< return { isCouncil: (electionsMembers?.map(([id]) => id) || councilMembers || []).some(checkIncluded), - isTechCommittee: technicalCommitteeMembers.some(checkIncluded), isSociety: societyMembers.some(checkIncluded), - isSudo: !!sudoKey && sudoKey.eq(accountId) + isSudo: !!sudoKey && sudoKey.eq(accountId), + isTechCommittee: technicalCommitteeMembers.some(checkIncluded) }; }) ); diff --git a/packages/api-derive/src/balances/account.ts b/packages/api-derive/src/balances/account.ts index a8b5097c79..79897f0553 100644 --- a/packages/api-derive/src/balances/account.ts +++ b/packages/api-derive/src/balances/account.ts @@ -44,7 +44,7 @@ function queryBalancesAccount (api: ApiInterfaceRx, accountId: AccountId): Obser [api.query.balances.account, accountId], [api.query.system.accountNonce, accountId] ]).pipe( - map(([{ free, reserved, miscFrozen, feeFrozen }, accountNonce]): Result => + map(([{ feeFrozen, free, miscFrozen, reserved }, accountNonce]): Result => [free, reserved, feeFrozen, miscFrozen, accountNonce] ) ); @@ -54,7 +54,7 @@ function queryCurrent (api: ApiInterfaceRx, accountId: AccountId): Observable>(accountId).pipe( map((infoOrTuple): Result => { - const { free, reserved, miscFrozen, feeFrozen } = (infoOrTuple as AccountInfo).nonce + const { feeFrozen, free, miscFrozen, reserved } = (infoOrTuple as AccountInfo).nonce ? (infoOrTuple as AccountInfo).data : (infoOrTuple as [Index, AccountData])[1]; const accountNonce = (infoOrTuple as AccountInfo).nonce || (infoOrTuple as [Index, AccountData])[0]; diff --git a/packages/api-derive/src/democracy/_referendumInfo.ts b/packages/api-derive/src/democracy/_referendumInfo.ts index 0bc2a5617f..e7b98e790f 100644 --- a/packages/api-derive/src/democracy/_referendumInfo.ts +++ b/packages/api-derive/src/democracy/_referendumInfo.ts @@ -21,9 +21,9 @@ export function _referendumInfo (api: ApiInterfaceRx): (index: BN, info: Option< return status ? api.query.democracy.preimages(status.proposalHash).pipe( map((preimage): DeriveReferendum => ({ - index: api.registry.createType('ReferendumIndex', index), image: parseImage(api, preimage), imageHash: status.proposalHash, + index: api.registry.createType('ReferendumIndex', index), status })) ) diff --git a/packages/api-derive/src/democracy/dispatchQueue.ts b/packages/api-derive/src/democracy/dispatchQueue.ts index fead2632e0..08d0ac0a8f 100644 --- a/packages/api-derive/src/democracy/dispatchQueue.ts +++ b/packages/api-derive/src/democracy/dispatchQueue.ts @@ -27,9 +27,9 @@ export function dispatchQueue (api: ApiInterfaceRx): () => Observable dispatches.map(([at, imageHash, index], dispatchIndex): DeriveDispatch => ({ at, - index, image: images[dispatchIndex], - imageHash + imageHash, + index })) ) ) diff --git a/packages/api-derive/src/democracy/proposals.ts b/packages/api-derive/src/democracy/proposals.ts index ff48332aae..945c0d5e45 100644 --- a/packages/api-derive/src/democracy/proposals.ts +++ b/packages/api-derive/src/democracy/proposals.ts @@ -26,9 +26,9 @@ function parse ([proposals, images, depositors]: [Proposals, (DeriveProposalImag return { balance, - index, image: images[proposalIndex], imageHash, + index, proposer, seconds }; diff --git a/packages/api-derive/src/elections/info.ts b/packages/api-derive/src/elections/info.ts index 850c34c71e..1b99eee198 100644 --- a/packages/api-derive/src/elections/info.ts +++ b/packages/api-derive/src/elections/info.ts @@ -27,9 +27,9 @@ function queryElections (api: ApiInterfaceRx): Observable { api.query[section].runnersUp ]).pipe( map(([councilMembers, candidates, members, runnersUp]): DeriveElectionsInfo => ({ - candidates, - candidateCount: api.registry.createType('u32', candidates.length), candidacyBond: api.consts[section].candidacyBond as Balance, + candidateCount: api.registry.createType('u32', candidates.length), + candidates, desiredSeats: api.consts[section].desiredMembers as u32, members: members.length ? members.sort(sortAccounts) diff --git a/packages/api-derive/src/society/candidates.ts b/packages/api-derive/src/society/candidates.ts index 8ea4ce96e6..8a6abcfbf2 100644 --- a/packages/api-derive/src/society/candidates.ts +++ b/packages/api-derive/src/society/candidates.ts @@ -30,7 +30,7 @@ export function candidates (api: ApiInterfaceRx): () => Observable - candidates.map(({ who, kind, value }, index) => ({ + candidates.map(({ kind, value, who }, index) => ({ accountId: who, isSuspended: suspended[index].isSome, kind, diff --git a/packages/api-derive/src/society/info.ts b/packages/api-derive/src/society/info.ts index c036da3c08..0d621954fc 100644 --- a/packages/api-derive/src/society/info.ts +++ b/packages/api-derive/src/society/info.ts @@ -30,9 +30,9 @@ export function info (api: ApiInterfaceRx): () => Observable { map(([bids, defender, founder, head, maxMembers, pot]: Result): DeriveSociety => ({ bids, defender: defender.unwrapOr(undefined), + founder: founder.unwrapOr(undefined), hasDefender: (defender.isSome && head.isSome && !head.eq(defender)) || false, head: head.unwrapOr(undefined), - founder: founder.unwrapOr(undefined), maxMembers, pot })) diff --git a/packages/api-derive/src/society/member.ts b/packages/api-derive/src/society/member.ts index 625e518f44..e80afb3ef2 100644 --- a/packages/api-derive/src/society/member.ts +++ b/packages/api-derive/src/society/member.ts @@ -29,8 +29,8 @@ export function member (api: ApiInterfaceRx): (accountId: AccountId) => Observab ]).pipe( map(([payouts, strikes, defenderVotes, suspended, vouching]: Result): DeriveSocietyMember => ({ accountId, - payouts, isSuspended: suspended.isTrue, + payouts, strikes, vote: defenderVotes.unwrapOr(undefined), vouching: vouching.unwrapOr(undefined) diff --git a/packages/api-derive/src/staking/overview.ts b/packages/api-derive/src/staking/overview.ts index 11dbea5975..a5715efaab 100644 --- a/packages/api-derive/src/staking/overview.ts +++ b/packages/api-derive/src/staking/overview.ts @@ -15,12 +15,12 @@ function retrievePointsPrev (api: ApiInterfaceRx, currentElected: AccountId[]): return api.query.staking.currentEraPointsEarned().pipe( map(({ individual, total }): EraRewardPoints => api.registry.createType('EraRewardPoints', { - total, individual: new Map( individual .map((points): RewardPoint => api.registry.createType('RewardPoint', points)) .map((points, index): [AccountId, RewardPoint] => [currentElected[index], points]) - ) + ), + total }) ) ); diff --git a/packages/api-derive/src/tx/signingInfo.ts b/packages/api-derive/src/tx/signingInfo.ts index 40a36633ef..273d6877f6 100644 --- a/packages/api-derive/src/tx/signingInfo.ts +++ b/packages/api-derive/src/tx/signingInfo.ts @@ -59,11 +59,11 @@ export function signingInfo (api: ApiInterfaceRx): (address: string, nonce?: Any ]).pipe( map(([nonce, header]) => ({ header, - nonce, mortalLength: MORTAL_PERIOD .div(api.consts.babe?.expectedBlockTime || api.consts.timestamp?.minimumPeriod.muln(2) || FALLBACK_PERIOD) .add(MAX_FINALITY_LAG) - .toNumber() + .toNumber(), + nonce })) ); } diff --git a/packages/api/src/base/Decorate.ts b/packages/api/src/base/Decorate.ts index 9410b4d1e3..53f42ad217 100644 --- a/packages/api/src/base/Decorate.ts +++ b/packages/api/src/base/Decorate.ts @@ -218,7 +218,7 @@ export default abstract class Decorate extends Events protected filterRpcMethods (exposed: string[]): void { const hasResults = exposed.length !== 0; const allKnown = [...this._rpcCore.mapping.entries()]; - const allKeys = allKnown.reduce((allKeys: string[], [, { alias, method, section, pubsub }]): string[] => { + const allKeys = allKnown.reduce((allKeys: string[], [, { alias, method, pubsub, section }]): string[] => { allKeys.push(`${section}_${method}`); if (pubsub) { diff --git a/packages/api/src/checkTypes.manual.ts b/packages/api/src/checkTypes.manual.ts index 89fa08cd09..e2ebc92904 100644 --- a/packages/api/src/checkTypes.manual.ts +++ b/packages/api/src/checkTypes.manual.ts @@ -161,7 +161,7 @@ async function tx (api: ApiPromise, keyring: TestKeyringMap): Promise { }); // it handles enum inputs correctly - await api.tx.democracy.proxyVote(123, { Split: { yay: 123, nay: 456 } }).signAndSend(keyring.alice); + await api.tx.democracy.proxyVote(123, { Split: { nay: 456, yay: 123 } }).signAndSend(keyring.alice); } async function main (): Promise { diff --git a/packages/api/src/promise/Api.spec.ts b/packages/api/src/promise/Api.spec.ts index 2a92b1f210..2440516118 100644 --- a/packages/api/src/promise/Api.spec.ts +++ b/packages/api/src/promise/Api.spec.ts @@ -21,8 +21,8 @@ describe('ApiPromise', (): void => { const aliceEd = keyring.addPair( // eslint-disable-next-line @typescript-eslint/unbound-method createPair({ toSS58: keyring.encodeAddress, type: 'ed25519' }, { - secretKey: hexToU8a('0xabf8e5bdbe30c65656c0a3cbd181ff8a56294a69dfedd27982aace4a7690911588dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee'), - publicKey: hexToU8a('0x88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee') + publicKey: hexToU8a('0x88dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee'), + secretKey: hexToU8a('0xabf8e5bdbe30c65656c0a3cbd181ff8a56294a69dfedd27982aace4a7690911588dc3417d5058ec4b4503e0c12ea1a0a89be200fe98922423d4334014fa6b0ee') }) ); let provider: Mock; @@ -57,7 +57,7 @@ describe('ApiPromise', (): void => { const metadata: any = {}; const key = `${genesisHash}-${specVersion}`; metadata[key] = rpcData; - const api = await ApiPromise.create({ provider, metadata, registry } as ApiOptions); + const api = await ApiPromise.create({ metadata, provider, registry } as ApiOptions); expect(api.genesisHash).toBeDefined(); expect(api.runtimeMetadata).toBeDefined(); @@ -70,7 +70,7 @@ describe('ApiPromise', (): void => { it('Create API instance without metadata and makes the runtime, rpc, state & extrinsics available', async (): Promise => { const metadata = {}; - const api = await ApiPromise.create({ provider, metadata, registry }); + const api = await ApiPromise.create({ metadata, provider, registry }); expect(api.genesisHash).toBeDefined(); expect(api.runtimeMetadata).toBeDefined(); diff --git a/packages/api/src/submittable/createClass.ts b/packages/api/src/submittable/createClass.ts index b21b8b447b..c5fdacac33 100644 --- a/packages/api/src/submittable/createClass.ts +++ b/packages/api/src/submittable/createClass.ts @@ -237,8 +237,8 @@ export default function createClass ({ api, apiType, const payload = this.registry.createType('SignerPayload', { ...options, address, - method: this.method, - blockNumber: header ? header.number : 0 + blockNumber: header ? header.number : 0, + method: this.method }); let result: SignerResult; diff --git a/packages/api/src/util/augmentObject.spec.ts b/packages/api/src/util/augmentObject.spec.ts index 70f3544629..a7c05faaa0 100644 --- a/packages/api/src/util/augmentObject.spec.ts +++ b/packages/api/src/util/augmentObject.spec.ts @@ -18,8 +18,8 @@ describe('augmentObject', (): void => { it('logs added/removed sections and methods', (): void => { augmentObject( 'test', - { foo: { f: 1, d: 1 }, bar: { b: 1 }, new: { z: 1 } }, - { foo: { f: 1, c: 1 }, bar: { a: 1, c: 1 }, baz: { a: 1 } } + { bar: { b: 1 }, foo: { d: 1, f: 1 }, new: { z: 1 } }, + { bar: { a: 1, c: 1 }, baz: { a: 1 }, foo: { c: 1, f: 1 } } ); expect(spy).toHaveBeenCalledWith( @@ -35,19 +35,19 @@ describe('augmentObject', (): void => { }); it('copies sections to the dest', (): void => { - const src = { foo: { a: 1 }, bar: { b: 1 } }; + const src = { bar: { b: 1 }, foo: { a: 1 } }; expect(augmentObject('test', src, {})).toEqual(src); }); it('adds fields to existing sections', (): void => { - const src = { foo: { a: 1 }, bar: { b: 1 } }; - const dst = { foo: { b: 2 }, baz: { c: 1 } }; + const src = { bar: { b: 1 }, foo: { a: 1 } }; + const dst = { baz: { c: 1 }, foo: { b: 2 } }; expect(augmentObject('test', src, dst)).toEqual({ - foo: { b: 2, a: 1 }, bar: { b: 1 }, - baz: { c: 1 } + baz: { c: 1 }, + foo: { a: 1, b: 2 } }); }); }); diff --git a/packages/api/test/util/logEvents.ts b/packages/api/test/util/logEvents.ts index 77392055cc..50f10d42e1 100644 --- a/packages/api/test/util/logEvents.ts +++ b/packages/api/test/util/logEvents.ts @@ -15,7 +15,7 @@ export const logEvents = (done: () => {}): (r: SubmittableResult) => void => console.log('Completed at block hash', status.value.toHex()); console.log('Events:'); - events.forEach(({ phase, event: { data, method, section } }: EventRecord): void => { + events.forEach(({ event: { data, method, section }, phase }: EventRecord): void => { console.log('\t', phase.toString(), `: ${section}.${method}`, data.toString()); }); diff --git a/packages/metadata/src/Decorated/storage/fromMetadata/createFunction.spec.ts b/packages/metadata/src/Decorated/storage/fromMetadata/createFunction.spec.ts index dbecdb7b31..2fccdfc69b 100644 --- a/packages/metadata/src/Decorated/storage/fromMetadata/createFunction.spec.ts +++ b/packages/metadata/src/Decorated/storage/fromMetadata/createFunction.spec.ts @@ -14,10 +14,10 @@ describe('createFunction', (): void => { it('should create timestamp.now correctly', (): void => { expect( createFunction(registry, { - prefix: 'Timestamp', - section: 'timestamp', + meta: { type: {} } as any, method: 'Now', - meta: { type: {} } as any + prefix: 'Timestamp', + section: 'timestamp' }, { metaVersion: 8 })() ).toEqual( Uint8Array.from([64, 14, 73, 68, 207, 217, 141, 111, 76, 195, 116, 209, 111, 90, 78, 63, 156]) // Length-prefixed @@ -29,15 +29,15 @@ describe('createFunction', (): void => { createFunction( registry, { - prefix: 'Substrate', - section: 'substrate', + meta: { type: {} } as any, method: 'authorityCount', - meta: { type: {} } as any + prefix: 'Substrate', + section: 'substrate' }, { key: ':auth:len', - skipHashing: true, - metaVersion: 8 + metaVersion: 8, + skipHashing: true } ).method ).toEqual('authorityCount'); @@ -50,15 +50,15 @@ describe('createFunction', (): void => { createFunction( registry, { - prefix: 'Substrate', - section: 'substrate', + meta: { type: {} } as any, method: 'authorityCount', - meta: { type: {} } as any + prefix: 'Substrate', + section: 'substrate' }, { key, - skipHashing: true, - metaVersion: 8 + metaVersion: 8, + skipHashing: true } )() ).toEqual( @@ -74,22 +74,22 @@ describe('createFunction', (): void => { beforeAll((): void => { storageFn = createFunction(registry, { - prefix: 'GenericAsset', - section: 'genericAsset', - method: 'FreeBalance', meta: { name: 'metaName', type: { - isDoubleMap: true, asDoubleMap: { hasher: registry.createType('StorageHasher', 'Blake2_256'), key1: new Text(registry, 'AccountId'), key2: new Text(registry, 'AccountId'), - value: new Text(registry, 'Balance'), - key2Hasher: registry.createType('StorageHasher', 'Twox128') - } + key2Hasher: registry.createType('StorageHasher', 'Twox128'), + value: new Text(registry, 'Balance') + }, + isDoubleMap: true } - } as any + } as any, + method: 'FreeBalance', + prefix: 'GenericAsset', + section: 'genericAsset' }, { metaVersion: 8 }); }); @@ -107,21 +107,21 @@ describe('createFunction', (): void => { it('allows creates double map function with a Null type key', (): void => { const storageFn = createFunction(registry, { - prefix: 'System', - section: 'system', - method: 'EventTopics', meta: { type: { - isDoubleMap: true, asDoubleMap: { hasher: registry.createType('StorageHasher', 'Blake2_256'), key1: new Text(registry, 'Null'), key2: new Text(registry, 'Hash'), - value: new Text(registry, 'Vec<(BlockNumber,EventIndex)>'), - key2Hasher: registry.createType('StorageHasher', 'Blake2_256') - } + key2Hasher: registry.createType('StorageHasher', 'Blake2_256'), + value: new Text(registry, 'Vec<(BlockNumber,EventIndex)>') + }, + isDoubleMap: true } - } as any + } as any, + method: 'EventTopics', + prefix: 'System', + section: 'system' }, { metaVersion: 8 }); // the value of the Null type key does not effect the result @@ -132,21 +132,21 @@ describe('createFunction', (): void => { it('allows creating of known DoubleMap keys (with Bytes)', (): void => { const storageFn = createFunction(registry, { - prefix: 'Session', - section: 'session', - method: 'NextKeys', meta: { type: { - isDoubleMap: true, asDoubleMap: { hasher: registry.createType('StorageHasher', 'Twox64Concat'), key1: new Text(registry, 'Bytes'), key2: new Text(registry, 'AccountId'), - value: new Text(registry, 'SessionKeys5'), - key2Hasher: registry.createType('StorageHasher', 'Blake2_256') - } + key2Hasher: registry.createType('StorageHasher', 'Blake2_256'), + value: new Text(registry, 'SessionKeys5') + }, + isDoubleMap: true } - } as any + } as any, + method: 'NextKeys', + prefix: 'Session', + section: 'session' }, { metaVersion: 9 }); expect( diff --git a/packages/metadata/src/Decorated/storage/fromMetadata/createFunction.ts b/packages/metadata/src/Decorated/storage/fromMetadata/createFunction.ts index d55d1b58f4..a892cac4c3 100644 --- a/packages/metadata/src/Decorated/storage/fromMetadata/createFunction.ts +++ b/packages/metadata/src/Decorated/storage/fromMetadata/createFunction.ts @@ -150,11 +150,11 @@ function extendHeadMeta (registry: Registry, { meta: { documentation, name, type // metadata with a fallback value using the type of the key, the normal // meta fallback only applies to actual entry values, create one for head (iterFn as IterFn).meta = registry.createType('StorageEntryMetadataLatest', { - name, - modifier: registry.createType('StorageEntryModifierLatest', 1), // required - type: registry.createType('StorageEntryTypeLatest', registry.createType('PlainTypeLatest', type.isMap ? type.asMap.key : type.asDoubleMap.key1), 0), + documentation, fallback: registry.createType('Bytes', createTypeUnsafe(registry, outputType).toHex()), - documentation + modifier: registry.createType('StorageEntryModifierLatest', 1), // required + name, + type: registry.createType('StorageEntryTypeLatest', registry.createType('PlainTypeLatest', type.isMap ? type.asMap.key : type.asDoubleMap.key1), 0) }); return registry.createType('StorageKey', iterFn, { method, section }); diff --git a/packages/metadata/src/Decorated/storage/fromMetadata/substrate.ts b/packages/metadata/src/Decorated/storage/fromMetadata/substrate.ts index e3c692b4f3..95720a5d20 100644 --- a/packages/metadata/src/Decorated/storage/fromMetadata/substrate.ts +++ b/packages/metadata/src/Decorated/storage/fromMetadata/substrate.ts @@ -22,8 +22,8 @@ function createRuntimeFunction (method: string, key: string, { documentation, ty meta: { documentation: registry.createType('Vec', [documentation]), modifier: registry.createType('StorageEntryModifierLatest', 1), // required - type: registry.createType('StorageEntryTypeLatest', type, 0), - toJSON: (): any => key + toJSON: (): any => key, + type: registry.createType('StorageEntryTypeLatest', type, 0) } as StorageEntryMetadataLatest, method, prefix: 'Substrate', diff --git a/packages/metadata/src/Metadata/util/toCallsOnly.ts b/packages/metadata/src/Metadata/util/toCallsOnly.ts index 4b86ddd600..b20b8ee293 100644 --- a/packages/metadata/src/Metadata/util/toCallsOnly.ts +++ b/packages/metadata/src/Metadata/util/toCallsOnly.ts @@ -21,8 +21,8 @@ function mapCalls (registry: Registry, _calls: Option registry.createType('FunctionMetadataLatest', { args, - name, - documentation: documentation.map((doc) => doc.toString().trim()) + documentation: documentation.map((doc) => doc.toString().trim()), + name }) ) : null @@ -32,10 +32,10 @@ function mapCalls (registry: Registry, _calls: Option ({ - name, - calls: mapCalls(registry, calls) - })), - extrinsic + calls: mapCalls(registry, calls), + name + })) }).toJSON(); } diff --git a/packages/metadata/src/Metadata/v0/toV1.ts b/packages/metadata/src/Metadata/v0/toV1.ts index 44bbd2f672..03ab97e62d 100644 --- a/packages/metadata/src/Metadata/v0/toV1.ts +++ b/packages/metadata/src/Metadata/v0/toV1.ts @@ -41,11 +41,11 @@ export default function toV1 (registry: Registry, metadataV0: MetadataV0): Metad : stringUpperFirst(mod.prefix.toString()); // If this module doesn't have storage, we just assume the prefix is the name capitalized return registry.createType('ModuleMetadataV1', { + calls: toV1Calls(registry, mod), + events: toV1Events(registry, metadataV0, mod.prefix), name: mod.prefix, // Not capitalized prefix, // Capitalized - storage: toV1Storage(registry, mod), - calls: toV1Calls(registry, mod), - events: toV1Events(registry, metadataV0, mod.prefix) + storage: toV1Storage(registry, mod) }); }) }); diff --git a/packages/metadata/src/Metadata/v10/toV11.ts b/packages/metadata/src/Metadata/v10/toV11.ts index 4b53743add..63e350389a 100644 --- a/packages/metadata/src/Metadata/v10/toV11.ts +++ b/packages/metadata/src/Metadata/v10/toV11.ts @@ -8,12 +8,12 @@ import { Registry } from '@polkadot/types/types'; /** @internal */ export default function toV11 (registry: Registry, { modules }: MetadataV10): MetadataV11 { return registry.createType('MetadataV11', { - modules, // This is new in V11, pass V0 here - something non-existing, telling the API to use // the fallback for this information (on-chain detection) extrinsic: { - version: 0, - signedExtensions: [] - } + signedExtensions: [], + version: 0 + }, + modules }); } diff --git a/packages/metadata/src/Metadata/v11/toLatest.ts b/packages/metadata/src/Metadata/v11/toLatest.ts index 809ab21d92..dc97e2897e 100644 --- a/packages/metadata/src/Metadata/v11/toLatest.ts +++ b/packages/metadata/src/Metadata/v11/toLatest.ts @@ -31,7 +31,7 @@ function convertCalls (registry: Registry, calls: FunctionMetadataV11[], section return calls.map(({ args, documentation, name }): FunctionMetadataLatest => { args.forEach(({ type }): void => setTypeOverride(sectionTypes, type)); - return registry.createType('FunctionMetadataLatest', { args, name, documentation }); + return registry.createType('FunctionMetadataLatest', { args, documentation, name }); }); } @@ -65,8 +65,9 @@ function convertStorage (registry: Registry, { items, prefix }: StorageMetadataV * most-recent metadata, since it allows us a chance to actually apply call and storage specific type aliasses * @internal **/ -export default function toLatest (registry: Registry, { modules, extrinsic }: MetadataV11): MetadataLatest { +export default function toLatest (registry: Registry, { extrinsic, modules }: MetadataV11): MetadataLatest { return registry.createType('MetadataLatest', { + extrinsic, modules: modules.map((mod): ModuleMetadataLatest => { const calls = mod.calls.unwrapOr(null); const storage = mod.storage.unwrapOr(null); @@ -81,7 +82,6 @@ export default function toLatest (registry: Registry, { modules, extrinsic }: Me ? convertStorage(registry, storage, sectionTypes) : null }); - }), - extrinsic + }) }); } diff --git a/packages/metadata/src/Metadata/v3/toV4.ts b/packages/metadata/src/Metadata/v3/toV4.ts index cb7b86a5ea..339995d2fe 100644 --- a/packages/metadata/src/Metadata/v3/toV4.ts +++ b/packages/metadata/src/Metadata/v3/toV4.ts @@ -20,22 +20,22 @@ function toV4StorageFunction (registry: Registry, storageFn: StorageFunctionMeta ? [registry.createType('MapTypeV4', { hasher: registry.createType('StorageHasherV4', 'Twox128'), key: type.asMap.key, - value: type.asMap.value, - linked: type.asMap.linked + linked: type.asMap.linked, + value: type.asMap.value }), 1] : [registry.createType('DoubleMapTypeV4', { hasher: registry.createType('StorageHasherV4', 'Twox128'), key1: type.asDoubleMap.key1, key2: type.asDoubleMap.key2, - value: type.asDoubleMap.value, - key2Hasher: type.asDoubleMap.key2Hasher + key2Hasher: type.asDoubleMap.key2Hasher, + value: type.asDoubleMap.value }), 2]; return registry.createType('StorageFunctionMetadataV4', { documentation, fallback, - name, modifier, + name, type: registry.createType('StorageFunctionTypeV4', newType, index) }); } diff --git a/packages/metadata/src/Metadata/v4/toV5.ts b/packages/metadata/src/Metadata/v4/toV5.ts index 605bb35a50..0ba47a7083 100644 --- a/packages/metadata/src/Metadata/v4/toV5.ts +++ b/packages/metadata/src/Metadata/v4/toV5.ts @@ -37,15 +37,15 @@ function toV5StorageFunction (registry: Registry, storageFn: StorageFunctionMeta hasher: type.asDoubleMap.hasher, key1: type.asDoubleMap.key1, key2: type.asDoubleMap.key2, - value: type.asDoubleMap.value, - key2Hasher: toStorageHasher(registry, type.asDoubleMap.key2Hasher) + key2Hasher: toStorageHasher(registry, type.asDoubleMap.key2Hasher), + value: type.asDoubleMap.value }), 2]; return registry.createType('StorageFunctionMetadataV5', { documentation, fallback, - name, modifier, + name, type: registry.createType('StorageFunctionTypeV5', newType, index) }); } @@ -55,6 +55,8 @@ export default function toV5 (registry: Registry, { modules }: MetadataV4): Meta return registry.createType('MetadataV5', { modules: modules.map(({ calls, events, name, prefix, storage }): ModuleMetadataV5 => registry.createType('ModuleMetadataV5', { + calls, + events, name, prefix, storage: storage.isSome @@ -63,9 +65,7 @@ export default function toV5 (registry: Registry, { modules }: MetadataV4): Meta 'Vec', storage.unwrap().map((v): StorageFunctionMetadataV5 => toV5StorageFunction(registry, v)) ) - : undefined, - calls, - events + : undefined }) ) }); diff --git a/packages/metadata/src/Metadata/v6/toV7.ts b/packages/metadata/src/Metadata/v6/toV7.ts index 3e5f0fa6d1..ffe01f9777 100644 --- a/packages/metadata/src/Metadata/v6/toV7.ts +++ b/packages/metadata/src/Metadata/v6/toV7.ts @@ -15,7 +15,7 @@ export default function toV7 (registry: Registry, { modules }: MetadataV6): Meta events, name, storage: storage.isSome - ? registry.createType('StorageMetadataV7', { prefix, items: storage.unwrap() }) + ? registry.createType('StorageMetadataV7', { items: storage.unwrap(), prefix }) : null }) ) diff --git a/packages/rpc-core/src/index.ts b/packages/rpc-core/src/index.ts index 645a8feb4a..8a2cdd634b 100644 --- a/packages/rpc-core/src/index.ts +++ b/packages/rpc-core/src/index.ts @@ -209,7 +209,7 @@ export default class Rpc implements RpcInterface { } // create a subscriptor, it subscribes once and resolves with the id as subscribe - private createSubscriber ({ subType, subName, paramsJson, update }: { subType: string; subName: string; paramsJson: AnyJson[]; update: ProviderInterfaceCallback }, errorHandler: (error: Error) => void): Promise { + private createSubscriber ({ paramsJson, subName, subType, update }: { subType: string; subName: string; paramsJson: AnyJson[]; update: ProviderInterfaceCallback }, errorHandler: (error: Error) => void): Promise { return new Promise((resolve, reject): void => { this.provider .subscribe(subType, subName, paramsJson, update) @@ -256,7 +256,7 @@ export default class Rpc implements RpcInterface { } }; - subscriptionPromise = this.createSubscriber({ subType, subName, paramsJson, update }, errorHandler); + subscriptionPromise = this.createSubscriber({ paramsJson, subName, subType, update }, errorHandler); } catch (error) { errorHandler(error); } diff --git a/packages/rpc-provider/src/coder/decodeResponse.spec.ts b/packages/rpc-provider/src/coder/decodeResponse.spec.ts index c77fdb640c..c4198bc423 100644 --- a/packages/rpc-provider/src/coder/decodeResponse.spec.ts +++ b/packages/rpc-provider/src/coder/decodeResponse.spec.ts @@ -38,13 +38,13 @@ describe('decodeResponse', (): void => { it('throws any error found', (): void => { expect( - (): any => coder.decodeResponse({ id: 1, jsonrpc: '2.0', error: { code: 123, message: 'test error' } } as JsonRpcResponse) + (): any => coder.decodeResponse({ error: { code: 123, message: 'test error' }, id: 1, jsonrpc: '2.0' } as JsonRpcResponse) ).toThrow(/123: test error/); }); it('throws any error found, with data', (): void => { expect( - (): any => coder.decodeResponse({ id: 1, jsonrpc: '2.0', error: { code: 123, data: 'Error("Some random error description")', message: 'test error' } } as JsonRpcResponse) + (): any => coder.decodeResponse({ error: { code: 123, data: 'Error("Some random error description")', message: 'test error' }, id: 1, jsonrpc: '2.0' } as JsonRpcResponse) ).toThrow(/123: test error: Some random error description/); }); diff --git a/packages/rpc-provider/src/mock/index.ts b/packages/rpc-provider/src/mock/index.ts index 78f7b840c8..93f6ee9ea8 100644 --- a/packages/rpc-provider/src/mock/index.ts +++ b/packages/rpc-provider/src/mock/index.ts @@ -58,8 +58,8 @@ export default class Mock implements ProviderInterface { chain_getHeader: () => this.registry.createType('Header', rpcHeader.result).toJSON(), state_getKeys: (): string[] => [], state_getKeysPaged: (): string[] => [], - state_getRuntimeVersion: (): string => this.registry.createType('RuntimeVersion').toHex(), state_getMetadata: (): string => rpcMetadata, + state_getRuntimeVersion: (): string => this.registry.createType('RuntimeVersion').toHex(), state_getStorage: (storage: MockStateDb, params: any[]): string => u8aToHex(storage[(params[0] as string)]), system_chain: (): string => 'mockChain', system_name: (): string => 'mockClient', diff --git a/packages/rpc-provider/src/ws/send.spec.ts b/packages/rpc-provider/src/ws/send.spec.ts index e9184409fc..db21b216b3 100644 --- a/packages/rpc-provider/src/ws/send.spec.ts +++ b/packages/rpc-provider/src/ws/send.spec.ts @@ -74,11 +74,11 @@ describe('send', (): void => { it('throws error when !response.ok', (): Promise => { createMock([{ - id: 1, error: { code: 666, message: 'error' - } + }, + id: 1 }]); return createWs(true) diff --git a/packages/rpc-provider/test/mockWs.ts b/packages/rpc-provider/test/mockWs.ts index 501fb3ee4b..b21974aa24 100644 --- a/packages/rpc-provider/test/mockWs.ts +++ b/packages/rpc-provider/test/mockWs.ts @@ -31,14 +31,14 @@ interface ReplyDef { } // should be JSONRPC def return -function createError ({ id, error: { code, message } }: ErrorDef): any { +function createError ({ error: { code, message }, id }: ErrorDef): any { return { - id, - jsonrpc: '2.0', error: { code, message - } + }, + id, + jsonrpc: '2.0' }; } diff --git a/packages/typegen/scripts/polkadot-types-chain-info.js b/packages/typegen/scripts/polkadot-types-chain-info.js index f10dc9a5a8..bb17734b22 100755 --- a/packages/typegen/scripts/polkadot-types-chain-info.js +++ b/packages/typegen/scripts/polkadot-types-chain-info.js @@ -15,11 +15,13 @@ try { ['module-resolver', { alias: { '^@polkadot/api-derive(.*)': './packages/api-derive/src\\1', - '^@polkadot/metadata(.*)': './packages/metadata/src\\1', + // eslint-disable-next-line sort-keys '^@polkadot/api(.*)': './packages/api/src/\\1', + '^@polkadot/metadata(.*)': './packages/metadata/src\\1', '^@polkadot/rpc-core(.*)': './packages/rpc-core/src\\1', '^@polkadot/rpc-provider(.*)': './packages/rpc-provider/src\\1', '^@polkadot/types-known(.*)': './packages/types-known/src\\1', + // eslint-disable-next-line sort-keys '^@polkadot/types(.*)': './packages/types/src\\1' } }] diff --git a/packages/typegen/scripts/polkadot-types-from-chain.js b/packages/typegen/scripts/polkadot-types-from-chain.js index 592dc2c007..8a92901ef6 100755 --- a/packages/typegen/scripts/polkadot-types-from-chain.js +++ b/packages/typegen/scripts/polkadot-types-from-chain.js @@ -16,6 +16,7 @@ try { alias: { '^@polkadot/metadata(.*)': './packages/metadata/src\\1', '^@polkadot/types-known(.*)': './packages/types-known/src\\1', + // eslint-disable-next-line sort-keys '^@polkadot/types(.*)': './packages/types/src\\1' } }] diff --git a/packages/typegen/scripts/polkadot-types-from-defs.js b/packages/typegen/scripts/polkadot-types-from-defs.js index 2fb35b6bda..9f6f450605 100755 --- a/packages/typegen/scripts/polkadot-types-from-defs.js +++ b/packages/typegen/scripts/polkadot-types-from-defs.js @@ -17,6 +17,7 @@ try { '^@polkadot/metadata(.*)': './packages/metadata/src\\1', '^@polkadot/typegen(.*)': './packages/typegen/src\\1', '^@polkadot/types-known(.*)': './packages/types-known/src\\1', + // eslint-disable-next-line sort-keys '^@polkadot/types(.*)': './packages/types/src\\1' } }] diff --git a/packages/typegen/scripts/polkadot-types-internal-interfaces.js b/packages/typegen/scripts/polkadot-types-internal-interfaces.js index 1536b467f9..eb52d6c083 100755 --- a/packages/typegen/scripts/polkadot-types-internal-interfaces.js +++ b/packages/typegen/scripts/polkadot-types-internal-interfaces.js @@ -16,6 +16,7 @@ try { alias: { '^@polkadot/metadata(.*)': './packages/metadata/src\\1', '^@polkadot/types-known(.*)': './packages/types-known/src\\1', + // eslint-disable-next-line sort-keys '^@polkadot/types(.*)': './packages/types/src\\1' } }] diff --git a/packages/typegen/scripts/polkadot-types-internal-metadata.js b/packages/typegen/scripts/polkadot-types-internal-metadata.js index 7d1f38aebc..105bbb769c 100755 --- a/packages/typegen/scripts/polkadot-types-internal-metadata.js +++ b/packages/typegen/scripts/polkadot-types-internal-metadata.js @@ -16,6 +16,7 @@ try { alias: { '^@polkadot/metadata(.*)': './packages/metadata/src\\1', '^@polkadot/types-known(.*)': './packages/types-known/src\\1', + // eslint-disable-next-line sort-keys '^@polkadot/types(.*)': './packages/types/src\\1' } }] diff --git a/packages/typegen/src/extractChain.ts b/packages/typegen/src/extractChain.ts index dfb8f97980..2be99dd878 100644 --- a/packages/typegen/src/extractChain.ts +++ b/packages/typegen/src/extractChain.ts @@ -35,8 +35,8 @@ export default function main (): void { ws: { default: 'ws://127.0.0.1:9944', description: 'The API endpoint to connect to, e.g. wss://kusama-rpc.polkadot.io', - type: 'string', - required: true + required: true, + type: 'string' } }).argv; diff --git a/packages/typegen/src/fromChain.ts b/packages/typegen/src/fromChain.ts index 1885ecd0c3..864bdcde0a 100644 --- a/packages/typegen/src/fromChain.ts +++ b/packages/typegen/src/fromChain.ts @@ -62,13 +62,13 @@ export default function main (): void { const { endpoint, output, package: pkg, strict: isStrict } = yargs.strict().options({ endpoint: { description: 'The endpoint to connect to (e.g. wss://kusama-rpc.polkadot.io) or relative path to a file containing the JSON output of an RPC state_getMetadata call', - type: 'string', - required: true + required: true, + type: 'string' }, output: { description: 'The target directory to write the data to', - type: 'string', - required: true + required: true, + type: 'string' }, package: { description: 'Optional package in output location (for extra definitions)', diff --git a/packages/typegen/src/fromDefs.ts b/packages/typegen/src/fromDefs.ts index cd1543dcb3..cf851a37eb 100644 --- a/packages/typegen/src/fromDefs.ts +++ b/packages/typegen/src/fromDefs.ts @@ -13,13 +13,13 @@ export default function main (): void { const { input, package: pkg } = yargs.strict().options({ input: { description: 'The directory to use for the user definitions', - type: 'string', - required: true + required: true, + type: 'string' }, package: { description: 'The package name & path to use for the user types', - type: 'string', - required: true + required: true, + type: 'string' } }).argv; diff --git a/packages/typegen/src/metadataMd.ts b/packages/typegen/src/metadataMd.ts index 82f4b772c5..df55b7f94e 100644 --- a/packages/typegen/src/metadataMd.ts +++ b/packages/typegen/src/metadataMd.ts @@ -105,7 +105,6 @@ function addRpc (): string { .filter((key) => Object.keys(definitions[key as 'babe'].rpc || {}).length !== 0); return renderPage({ - title: 'JSON-RPC', description: DESC_RPC, sections: sections .sort() @@ -113,33 +112,33 @@ function addRpc (): string { const section = definitions[sectionName as 'babe']; return { - name: sectionName, // description: section.description, items: Object.keys(section.rpc) .sort() .map((methodName) => { const method = section.rpc[methodName]; - const args = method.params.map(({ name, isOptional, type }: any): string => { + const args = method.params.map(({ isOptional, name, type }: any): string => { return name + (isOptional ? '?' : '') + ': `' + type + '`'; }).join(', '); const type = '`' + method.type + '`'; return { - name: `${methodName}(${args}): ${type}`, - jsonrpc: '`' + `${sectionName}_${methodName}` + '`', interface: '`' + `api.rpc.${sectionName}.${methodName}` + '`', + jsonrpc: '`' + `${sectionName}_${methodName}` + '`', + name: `${methodName}(${args}): ${type}`, ...(method.description && { summary: method.description }) }; - }) + }), + name: sectionName }; - }) + }), + title: 'JSON-RPC' }); } /** @internal */ function addConstants (metadata: MetadataLatest): string { return renderPage({ - title: 'Constants', description: DESC_CONSTANTS, sections: metadata.modules .sort(sortByName) @@ -148,20 +147,21 @@ function addConstants (metadata: MetadataLatest): string { const sectionName = stringLowerFirst(moduleMetadata.name.toString()); return { - name: sectionName, items: moduleMetadata.constants .sort(sortByName) .map((func) => { const methodName = stringCamelCase(func.name.toString()); return { - name: `${methodName}: ` + '`' + func.type + '`', interface: '`' + `api.consts.${sectionName}.${methodName}` + '`', + name: `${methodName}: ` + '`' + func.type + '`', ...(func.documentation.length && { summary: func.documentation }) }; - }) + }), + name: sectionName }; - }) + }), + title: 'Constants' }); } @@ -174,7 +174,6 @@ function addStorage (metadata: MetadataLatest): string { const sectionName = stringLowerFirst(moduleMetadata.name.toString()); return { - name: sectionName, items: moduleMetadata.storage.unwrap().items .sort(sortByName) .map((func) => { @@ -187,28 +186,28 @@ function addStorage (metadata: MetadataLatest): string { const outputType = unwrapStorageType(func.type, func.modifier.isOptional); return { - name: `${methodName}(${arg}): ` + '`' + outputType + '`', interface: '`' + `api.query.${sectionName}.${methodName}` + '`', + name: `${methodName}(${arg}): ` + '`' + outputType + '`', ...(func.documentation.length && { summary: func.documentation }) }; - }) + }), + name: sectionName }; }); - const options = { flags: 'r', encoding: 'utf8' }; + const options = { encoding: 'utf8', flags: 'r' }; const knownSection = JSON.parse(fs.readFileSync('docs/substrate/storage-known-section.json', options)); return renderPage({ - title: 'Storage', description: DESC_STORAGE, - sections: moduleSections.concat([knownSection]) + sections: moduleSections.concat([knownSection]), + title: 'Storage' }); } /** @internal */ function addExtrinsics (metadata: MetadataLatest): string { return renderPage({ - title: 'Extrinsics', description: DESC_EXTRINSICS, sections: metadata.modules .sort(sortByName) @@ -217,7 +216,6 @@ function addExtrinsics (metadata: MetadataLatest): string { const sectionName = stringCamelCase(meta.name.toString()); return { - name: sectionName, items: meta.calls.unwrap() .sort(sortByName) .map((func) => { @@ -225,26 +223,26 @@ function addExtrinsics (metadata: MetadataLatest): string { const args = Call.filterOrigin(func).map(({ name, type }): string => `${name}: ` + '`' + type + '`').join(', '); return { - name: `${methodName}(${args})`, interface: '`' + `api.tx.${sectionName}.${methodName}` + '`', + name: `${methodName}(${args})`, ...(func.documentation.length && { summary: func.documentation }) }; - }) + }), + name: sectionName }; - }) + }), + title: 'Extrinsics' }); } /** @internal */ function addEvents (metadata: MetadataLatest): string { return renderPage({ - title: 'Events', description: DESC_EVENTS, sections: metadata.modules .sort(sortByName) .filter((meta) => !meta.events.isNone && meta.events.unwrap().length) .map((meta) => ({ - name: stringCamelCase(meta.name.toString()), items: meta.events.unwrap() .sort(sortByName) .map((func) => { @@ -255,34 +253,36 @@ function addEvents (metadata: MetadataLatest): string { name: `${methodName}(${args})`, ...(func.documentation.length && { summary: func.documentation }) }; - }) - })) + }), + name: stringCamelCase(meta.name.toString()) + })), + title: 'Events' }); } /** @internal */ function addErrors (metadata: MetadataLatest): string { return renderPage({ - title: 'Errors', description: DESC_ERRORS, sections: metadata.modules .sort(sortByName) .filter((moduleMetadata) => !moduleMetadata.errors.isEmpty) .map((moduleMetadata) => ({ - name: stringLowerFirst(moduleMetadata.name.toString()), items: moduleMetadata.errors .sort(sortByName) .map((error) => ({ name: error.name.toString(), ...(error.documentation.length && { summary: error.documentation }) - })) - })) + })), + name: stringLowerFirst(moduleMetadata.name.toString()) + })), + title: 'Errors' }); } /** @internal */ function writeFile (name: string, ...chunks: any[]): void { - const options = { flags: 'w', encoding: 'utf8' }; + const options = { encoding: 'utf8', flags: 'w' }; const writeStream = fs.createWriteStream(name, options); writeStream.on('finish', (): void => { diff --git a/packages/typegen/src/util/derived.ts b/packages/typegen/src/util/derived.ts index 3698d271aa..ea5487b5b9 100644 --- a/packages/typegen/src/util/derived.ts +++ b/packages/typegen/src/util/derived.ts @@ -44,21 +44,21 @@ export function getDerivedTypes (definitions: object, type: string, primitiveNam const types = [ { info: TypeDefInfo.Option, - type, - sub: def + sub: def, + type }, { info: TypeDefInfo.Vec, - type, - sub: def + sub: def, + type } ]; if (isCompact) { types.unshift({ info: TypeDefInfo.Compact, - type, - sub: def + sub: def, + type }); } diff --git a/packages/typegen/src/util/imports.ts b/packages/typegen/src/util/imports.ts index 474148333a..6975cc5325 100644 --- a/packages/typegen/src/util/imports.ts +++ b/packages/typegen/src/util/imports.ts @@ -116,7 +116,7 @@ export function createImports (importDefinitions: Record, { type return local; }, {}), primitiveTypes: {}, - typesTypes: {}, - typeToModule + typeToModule, + typesTypes: {} }; } diff --git a/packages/types-known/src/chain/westend.ts b/packages/types-known/src/chain/westend.ts index c8f9427734..3d25c12a56 100644 --- a/packages/types-known/src/chain/westend.ts +++ b/packages/types-known/src/chain/westend.ts @@ -9,9 +9,8 @@ const versioned: OverrideVersionedType[] = [ minmax: [1000, undefined], types: { Address: 'GenericAddress', - Keys: 'SessionKeys5', - // previous substrate versions BalanceLock: 'BalanceLockTo212', + Keys: 'SessionKeys5', ReferendumInfo: 'ReferendumInfoTo239', StakingLedger: 'StakingLedgerTo223' } diff --git a/packages/types-known/src/index.spec.ts b/packages/types-known/src/index.spec.ts index bf6becdcaa..a0e1d38460 100644 --- a/packages/types-known/src/index.spec.ts +++ b/packages/types-known/src/index.spec.ts @@ -42,8 +42,8 @@ describe('getModuleTypes', (): void => { it('merges pre-defined and user-defined for identity', (): void => { expect(getModuleTypes(registry, 'identity')).toEqual({ - Judgement: 'IdentityJudgement', - Id: 'IdentityId' + Id: 'IdentityId', + Judgement: 'IdentityJudgement' }); }); }); diff --git a/packages/types-known/src/metadata.ts b/packages/types-known/src/metadata.ts index 693b498f8d..249f43bb72 100644 --- a/packages/types-known/src/metadata.ts +++ b/packages/types-known/src/metadata.ts @@ -15,10 +15,10 @@ const typesMeta: OverrideVersionedType[] = [ types: { Address: 'GenericAddress', BlockNumber: 'u64', - Index: 'u64', EventRecord: 'EventRecordTo76', - ValidatorPrefs: 'ValidatorPrefsTo145', - StakingLedger: 'StakingLedgerTo223' + Index: 'u64', + StakingLedger: 'StakingLedgerTo223', + ValidatorPrefs: 'ValidatorPrefsTo145' } } ]; diff --git a/packages/types-known/src/modules.ts b/packages/types-known/src/modules.ts index 0a0ca6f3ac..2e022d64fc 100644 --- a/packages/types-known/src/modules.ts +++ b/packages/types-known/src/modules.ts @@ -6,15 +6,13 @@ import { OverrideModuleType } from '@polkadot/types/types'; // type overrides for modules (where duplication between modules exist) const typesModules: Record = { - // old metadata & naming - contract: { - // v2 & v3 - AccountInfo: 'ContractAccountInfo' - }, - // current from here on balances: { Releases: 'ReleasesBalances' }, + contract: { // old metadata & naming + // v2 & v3 + AccountInfo: 'ContractAccountInfo' + }, contracts: { StorageKey: 'ContractStorageKey' }, diff --git a/packages/types/src/codec/Enum.spec.ts b/packages/types/src/codec/Enum.spec.ts index 279e9fa111..7321a9ab06 100644 --- a/packages/types/src/codec/Enum.spec.ts +++ b/packages/types/src/codec/Enum.spec.ts @@ -89,6 +89,7 @@ describe('Enum', (): void => { expect( new Enum( registry, + // eslint-disable-next-line sort-keys { foo: 'Text', bar: 'u32' }, '0x0134120000' ).value.toString() @@ -339,7 +340,9 @@ describe('Enum', (): void => { it('has a sane output for typed enums', (): void => { expect( + // eslint-disable-next-line sort-keys new Enum(registry, { foo: Text, bar: U32 }).toRawType() + // eslint-disable-next-line sort-keys ).toEqual(JSON.stringify({ _enum: { foo: 'Text', bar: 'u32' } })); }); }); diff --git a/packages/types/src/codec/Linkage.ts b/packages/types/src/codec/Linkage.ts index 2f184b898a..453c0294ea 100644 --- a/packages/types/src/codec/Linkage.ts +++ b/packages/types/src/codec/Linkage.ts @@ -21,6 +21,7 @@ export default class Linkage extends Struct { constructor (registry: Registry, Type: Constructor | keyof InterfaceTypes, value?: any) { super(registry, { previous: Option.with(Type), + // eslint-disable-next-line sort-keys next: Option.with(Type) }, value); } diff --git a/packages/types/src/codec/Result.spec.ts b/packages/types/src/codec/Result.spec.ts index e3b3aaf2a6..8bf2ea16a0 100644 --- a/packages/types/src/codec/Result.spec.ts +++ b/packages/types/src/codec/Result.spec.ts @@ -10,7 +10,7 @@ import Result from './Result'; describe('Result', (): void => { const registry = new TypeRegistry(); - const Type = Result.with({ Ok: u32, Error: Text }); + const Type = Result.with({ Error: Text, Ok: u32 }); it('has a sane toRawType representation', (): void => { expect(new Type(registry).toRawType()).toEqual('Result'); diff --git a/packages/types/src/codec/Result.ts b/packages/types/src/codec/Result.ts index 3f1fd6d5b7..4de80bc571 100644 --- a/packages/types/src/codec/Result.ts +++ b/packages/types/src/codec/Result.ts @@ -16,6 +16,7 @@ import Enum from './Enum'; export default class Result extends Enum { constructor (registry: Registry, Ok: Constructor | keyof InterfaceTypes, Error: Constructor | keyof InterfaceTypes, value?: any) { // NOTE This is order-dependent, Ok (with index 0) needs to be first + // eslint-disable-next-line sort-keys super(registry, { Ok, Error }, value); } diff --git a/packages/types/src/codec/Set.spec.ts b/packages/types/src/codec/Set.spec.ts index aa5080f424..01134cf86f 100644 --- a/packages/types/src/codec/Set.spec.ts +++ b/packages/types/src/codec/Set.spec.ts @@ -2,9 +2,12 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +/* eslint-disable sort-keys */ + import { TypeRegistry } from '../create'; import Set from './Set'; +// TODO actually import these from definitions, don't re-define here const SET_FIELDS = { header: 0b00000001, body: 0b00000010, diff --git a/packages/types/src/codec/Set.ts b/packages/types/src/codec/Set.ts index 2a29e8abf8..c1caac0de4 100644 --- a/packages/types/src/codec/Set.ts +++ b/packages/types/src/codec/Set.ts @@ -228,6 +228,9 @@ export default class CodecSet extends Set implements Codec { */ // eslint-disable-next-line @typescript-eslint/no-unused-vars public toU8a (isBare?: boolean): Uint8Array { - return bnToU8a(this.valueEncoded, { isLe: false, bitLength: this.#byteLength * 8 }); + return bnToU8a(this.valueEncoded, { + bitLength: this.#byteLength * 8, + isLe: false + }); } } diff --git a/packages/types/src/codec/Struct.spec.ts b/packages/types/src/codec/Struct.spec.ts index ce2a83d9e4..253291385c 100644 --- a/packages/types/src/codec/Struct.spec.ts +++ b/packages/types/src/codec/Struct.spec.ts @@ -2,6 +2,8 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +/* eslint-disable sort-keys */ + import { TypeRegistry } from '../create'; import AccountId from '../generic/AccountId'; import Text from '../primitive/Text'; diff --git a/packages/types/src/codec/Tuple.spec.ts b/packages/types/src/codec/Tuple.spec.ts index e68c0aa37e..8a9eea4b99 100644 --- a/packages/types/src/codec/Tuple.spec.ts +++ b/packages/types/src/codec/Tuple.spec.ts @@ -127,6 +127,7 @@ describe('Tuple', (): void => { it('generates sane value with object types', (): void => { expect( + // eslint-disable-next-line sort-keys new Tuple(registry, { number: U128, blockNumber: registry.createClass('BlockNumber') }).toRawType() ).toEqual('(u128,u32)'); }); diff --git a/packages/types/src/codec/utils/encodeTypes.ts b/packages/types/src/codec/utils/encodeTypes.ts index edca37afc0..13c47aa533 100644 --- a/packages/types/src/codec/utils/encodeTypes.ts +++ b/packages/types/src/codec/utils/encodeTypes.ts @@ -21,7 +21,7 @@ export function paramsNotation (outer: string, inner?: string | any[], transform } function encodeWithParams (typeDef: Pick, outer = typeDef.displayName || typeDef.type): string { - const { info, sub, params } = typeDef; + const { info, params, sub } = typeDef; switch (info) { case TypeDefInfo.BTreeMap: diff --git a/packages/types/src/create/createClass.ts b/packages/types/src/create/createClass.ts index a3d82cc877..f2b5045131 100644 --- a/packages/types/src/create/createClass.ts +++ b/packages/types/src/create/createClass.ts @@ -106,7 +106,7 @@ const infoMapping: Record C // We have circular deps between Linkage & Struct [TypeDefInfo.Linkage]: (registry: Registry, value: TypeDef): Constructor => { const type = `Option<${getSubType(value)}>`; - const Clazz = Struct.with({ previous: type, next: type } as any); + const Clazz = Struct.with({ next: type, previous: type } as any); ClassOf.prototype.toRawType = function (): string { return `Linkage<${this.next.toRawType(true)}>`; @@ -127,14 +127,14 @@ const infoMapping: Record C const [Ok, Error] = getTypeClassArray(value); // eslint-disable-next-line @typescript-eslint/no-use-before-define - return Result.with({ Ok, Error }); + return Result.with({ Error, Ok }); }, [TypeDefInfo.Set]: (registry: Registry, value: TypeDef): Constructor => { const result: Record = {}; return CodecSet.with( - getSubDefArray(value).reduce((result, { name, index }): Record => { + getSubDefArray(value).reduce((result, { index, name }): Record => { result[name as string] = index as number; return result; diff --git a/packages/types/src/create/createType.spec.ts b/packages/types/src/create/createType.spec.ts index 4ab8f46775..fd0f11319a 100644 --- a/packages/types/src/create/createType.spec.ts +++ b/packages/types/src/create/createType.spec.ts @@ -125,17 +125,19 @@ describe('createType', (): void => { registry.register({ TestComplex: { balance: 'Balance', + // eslint-disable-next-line sort-keys accountId: 'AccountId', log: '(u64, u32)', + // eslint-disable-next-line sort-keys fromSrml: 'Gas' } }); const value = createTypeUnsafe(registry, 'TestComplex', [{ - balance: 123, accountId: '0x1234567812345678123456781234567812345678123456781234567812345678', - log: [456, 789], - fromSrml: 0 + balance: 123, + fromSrml: 0, + log: [456, 789] }]); expect(value instanceof createClass(registry, 'TestComplex')).toBe(true); @@ -160,8 +162,10 @@ describe('createType', (): void => { Balance: 'u128', TestComplex: { balance: 'Balance', + // eslint-disable-next-line sort-keys accountId: 'AccountId', log: '(u64, u32)', + // eslint-disable-next-line sort-keys fromSrml: 'Gas' } }); diff --git a/packages/types/src/create/getTypeDef.spec.ts b/packages/types/src/create/getTypeDef.spec.ts index 174697f52c..d9bf2778c4 100644 --- a/packages/types/src/create/getTypeDef.spec.ts +++ b/packages/types/src/create/getTypeDef.spec.ts @@ -34,7 +34,6 @@ describe('getTypeDef', (): void => { getTypeDef('BTreeMap') ).toEqual({ info: TypeDefInfo.BTreeMap, - type: 'BTreeMap', sub: [ { info: TypeDefInfo.Plain, @@ -44,7 +43,8 @@ describe('getTypeDef', (): void => { info: TypeDefInfo.Plain, type: 'Text' } - ] + ], + type: 'BTreeMap' }); }); @@ -53,11 +53,11 @@ describe('getTypeDef', (): void => { getTypeDef('BTreeSet') ).toEqual({ info: TypeDefInfo.BTreeSet, - type: 'BTreeSet', sub: { info: TypeDefInfo.Plain, type: 'Text' - } + }, + type: 'BTreeSet' }); }); @@ -66,7 +66,6 @@ describe('getTypeDef', (): void => { getTypeDef('Result') ).toEqual({ info: TypeDefInfo.Result, - type: 'Result', sub: [ { info: TypeDefInfo.Plain, @@ -76,7 +75,8 @@ describe('getTypeDef', (): void => { info: TypeDefInfo.Plain, type: 'Text' } - ] + ], + type: 'Result' }); }); @@ -85,11 +85,9 @@ describe('getTypeDef', (): void => { getTypeDef('Result,Text>') ).toEqual({ info: TypeDefInfo.Result, - type: 'Result,Text>', sub: [ { info: TypeDefInfo.Result, - type: 'Result', sub: [ { info: TypeDefInfo.Plain, @@ -99,13 +97,15 @@ describe('getTypeDef', (): void => { info: TypeDefInfo.Plain, type: 'u32' } - ] + ], + type: 'Result' }, { info: TypeDefInfo.Plain, type: 'Text' } - ] + ], + type: 'Result,Text>' }); }); @@ -114,7 +114,6 @@ describe('getTypeDef', (): void => { getTypeDef('(u32, Compact, Vec, Option, (Text,Vec<(Bool,u128)>))') ).toEqual({ info: TypeDefInfo.Tuple, - type: '(u32,Compact,Vec,Option,(Text,Vec<(Bool,u128)>))', sub: [ { info: TypeDefInfo.Plain, @@ -122,31 +121,30 @@ describe('getTypeDef', (): void => { }, { info: TypeDefInfo.Compact, - type: 'Compact', sub: { info: TypeDefInfo.Plain, type: 'u32' - } + }, + type: 'Compact' }, { info: TypeDefInfo.Vec, - type: 'Vec', sub: { info: TypeDefInfo.Plain, type: 'u64' - } + }, + type: 'Vec' }, { info: TypeDefInfo.Option, - type: 'Option', sub: { info: TypeDefInfo.Plain, type: 'u128' - } + }, + type: 'Option' }, { info: TypeDefInfo.Tuple, - type: '(Text,Vec<(Bool,u128)>)', sub: [ { info: TypeDefInfo.Plain, @@ -154,10 +152,8 @@ describe('getTypeDef', (): void => { }, { info: TypeDefInfo.Vec, - type: 'Vec<(Bool,u128)>', sub: { info: TypeDefInfo.Tuple, - type: '(Bool,u128)', sub: [ { info: TypeDefInfo.Plain, @@ -167,12 +163,16 @@ describe('getTypeDef', (): void => { info: TypeDefInfo.Plain, type: 'u128' } - ] - } + ], + type: '(Bool,u128)' + }, + type: 'Vec<(Bool,u128)>' } - ] + ], + type: '(Text,Vec<(Bool,u128)>)' } - ] + ], + type: '(u32,Compact,Vec,Option,(Text,Vec<(Bool,u128)>))' }); }); @@ -181,10 +181,8 @@ describe('getTypeDef', (): void => { getTypeDef('Vec<(Box, Proposal,Lookup::Target)>') ).toEqual({ info: TypeDefInfo.Vec, - type: 'Vec<(PropIndex,Proposal,LookupTarget)>', sub: { info: TypeDefInfo.Tuple, - type: '(PropIndex,Proposal,LookupTarget)', sub: [ { info: TypeDefInfo.Plain, @@ -198,8 +196,10 @@ describe('getTypeDef', (): void => { info: TypeDefInfo.Plain, type: 'LookupTarget' } - ] - } + ], + type: '(PropIndex,Proposal,LookupTarget)' + }, + type: 'Vec<(PropIndex,Proposal,LookupTarget)>' }); }); @@ -208,10 +208,8 @@ describe('getTypeDef', (): void => { getTypeDef('Vec<(PropIndex, Proposal, AccountId)>') ).toEqual({ info: TypeDefInfo.Vec, - type: 'Vec<(PropIndex,Proposal,AccountId)>', sub: { info: TypeDefInfo.Tuple, - type: '(PropIndex,Proposal,AccountId)', sub: [ { info: TypeDefInfo.Plain, @@ -225,8 +223,10 @@ describe('getTypeDef', (): void => { info: TypeDefInfo.Plain, type: 'AccountId' } - ] - } + ], + type: '(PropIndex,Proposal,AccountId)' + }, + type: 'Vec<(PropIndex,Proposal,AccountId)>' }); }); @@ -235,7 +235,6 @@ describe('getTypeDef', (): void => { getTypeDef('{"balance":"Balance","account_id":"AccountId","log":"(u64, Signature)"}') ).toEqual({ info: TypeDefInfo.Struct, - type: '{"balance":"Balance","account_id":"AccountId","log":"(u64,Signature)"}', sub: [ { info: TypeDefInfo.Plain, @@ -250,7 +249,6 @@ describe('getTypeDef', (): void => { { info: TypeDefInfo.Tuple, name: 'log', - type: '(u64,Signature)', sub: [ { info: TypeDefInfo.Plain, @@ -260,9 +258,11 @@ describe('getTypeDef', (): void => { info: TypeDefInfo.Plain, type: 'Signature' } - ] + ], + type: '(u64,Signature)' } - ] + ], + type: '{"balance":"Balance","account_id":"AccountId","log":"(u64,Signature)"}' }); }); @@ -271,23 +271,23 @@ describe('getTypeDef', (): void => { expect( getTypeDef('[[u8;32];3]') ).toEqual({ - info: TypeDefInfo.VecFixed, - type: '[[u8;32];3]', ext: { length: 3, type: '[u8;32]' }, + info: TypeDefInfo.VecFixed, sub: { - info: TypeDefInfo.VecFixed, - type: '[u8;32]', ext: { length: 32 }, + info: TypeDefInfo.VecFixed, sub: { info: TypeDefInfo.Plain, type: 'u8' - } - } + }, + type: '[u8;32]' + }, + type: '[[u8;32];3]' }); }); }); diff --git a/packages/types/src/create/getTypeDef.ts b/packages/types/src/create/getTypeDef.ts index 5d59102a61..ac9492860d 100644 --- a/packages/types/src/create/getTypeDef.ts +++ b/packages/types/src/create/getTypeDef.ts @@ -158,10 +158,10 @@ interface TypeDefOptions { displayName?: string; } -export function getTypeDef (_type: string, { name, displayName }: TypeDefOptions = {}): TypeDef { +export function getTypeDef (_type: string, { displayName, name }: TypeDefOptions = {}): TypeDef { // create the type via Type, allowing types to be sanitized const type = sanitize(_type); - const value: TypeDef = { info: TypeDefInfo.Plain, displayName, name, type }; + const value: TypeDef = { displayName, info: TypeDefInfo.Plain, name, type }; const nested = nestedExtraction.find((nested): boolean => hasWrapper(type, nested) ); diff --git a/packages/types/src/create/registry.spec.ts b/packages/types/src/create/registry.spec.ts index 7b1669b93a..67afd264e8 100644 --- a/packages/types/src/create/registry.spec.ts +++ b/packages/types/src/create/registry.spec.ts @@ -110,15 +110,15 @@ describe('TypeRegistry', (): void => { it('can create structs via definition', (): void => { registry.register({ SomeStruct: { - foo: 'u32', - bar: 'Text' + bar: 'Text', + foo: 'u32' } }); const SomeStruct = registry.getOrThrow('SomeStruct'); const struct: any = new SomeStruct(registry, { - foo: 42, - bar: 'testing' + bar: 'testing', + foo: 42 }); expect(struct instanceof Struct).toBe(true); diff --git a/packages/types/src/create/registry.ts b/packages/types/src/create/registry.ts index 2cc2f420ad..adc6e80f2f 100644 --- a/packages/types/src/create/registry.ts +++ b/packages/types/src/create/registry.ts @@ -23,7 +23,7 @@ function decorateErrors (_: Registry, metadata: RegistryMetadata, metadataErrors metadata.asLatest.modules.forEach((section, sectionIndex): void => { const sectionName = stringCamelCase(section.name.toString()); - section.errors.forEach(({ name, documentation }, index): void => { + section.errors.forEach(({ documentation, name }, index): void => { const eventIndex = new Uint8Array([sectionIndex, index]); metadataErrors[u8aToHex(eventIndex)] = { diff --git a/packages/types/src/extrinsic/Extrinsic.ts b/packages/types/src/extrinsic/Extrinsic.ts index 8114cc0e95..62e46aba08 100644 --- a/packages/types/src/extrinsic/Extrinsic.ts +++ b/packages/types/src/extrinsic/Extrinsic.ts @@ -256,15 +256,15 @@ export default class Extrinsic extends ExtrinsicBase implements IExtrinsic { */ public toHuman (isExpanded?: boolean): AnyJson { return { - method: this.method.toHuman(isExpanded), isSigned: this.isSigned, + method: this.method.toHuman(isExpanded), ...(this.isSigned ? { - signer: this.signer.toHuman(isExpanded), - nonce: this.nonce.toHuman(isExpanded), era: this.era.toHuman(isExpanded), - tip: this.tip.toHuman(isExpanded), - signature: this.signature.toHex() + nonce: this.nonce.toHuman(isExpanded), + signature: this.signature.toHex(), + signer: this.signer.toHuman(isExpanded), + tip: this.tip.toHuman(isExpanded) } : {} ) diff --git a/packages/types/src/extrinsic/v1/Extrinsic.ts b/packages/types/src/extrinsic/v1/Extrinsic.ts index 3e992a32b2..bcaa8b8c0c 100644 --- a/packages/types/src/extrinsic/v1/Extrinsic.ts +++ b/packages/types/src/extrinsic/v1/Extrinsic.ts @@ -27,6 +27,7 @@ export default class ExtrinsicV1 extends Struct implements IExtrinsicImpl { constructor (registry: Registry, value?: Uint8Array | ExtrinsicValueV1, { isSigned }: Partial = {}) { super(registry, { signature: 'ExtrinsicSignatureV1', + // eslint-disable-next-line sort-keys method: 'Call' }, ExtrinsicV1.decodeExtrinsic(registry, value, isSigned)); } diff --git a/packages/types/src/extrinsic/v1/ExtrinsicPayload.ts b/packages/types/src/extrinsic/v1/ExtrinsicPayload.ts index 8881b7f814..b8cf04d819 100644 --- a/packages/types/src/extrinsic/v1/ExtrinsicPayload.ts +++ b/packages/types/src/extrinsic/v1/ExtrinsicPayload.ts @@ -26,8 +26,11 @@ export default class ExtrinsicPayloadV1 extends Struct { constructor (registry: Registry, value?: ExtrinsicPayloadValue | Uint8Array | string) { super(registry, { nonce: 'Compact', + // eslint-disable-next-line sort-keys method: 'Bytes', + // eslint-disable-next-line sort-keys era: 'ExtrinsicEra', + // eslint-disable-next-line sort-keys blockHash: 'Hash' }, value); } diff --git a/packages/types/src/extrinsic/v1/ExtrinsicSignature.ts b/packages/types/src/extrinsic/v1/ExtrinsicSignature.ts index de7adcde38..e78da29d4a 100644 --- a/packages/types/src/extrinsic/v1/ExtrinsicSignature.ts +++ b/packages/types/src/extrinsic/v1/ExtrinsicSignature.ts @@ -26,8 +26,11 @@ export default class ExtrinsicSignatureV1 extends Struct implements IExtrinsicSi constructor (registry: Registry, value?: ExtrinsicSignatureV1 | Uint8Array, { isSigned }: ExtrinsicSignatureOptions = {}) { super(registry, { signer: 'Address', + // eslint-disable-next-line sort-keys signature: 'Signature', + // eslint-disable-next-line sort-keys nonce: 'Compact', + // eslint-disable-next-line sort-keys era: 'ExtrinsicEra' }, ExtrinsicSignatureV1.decodeExtrinsicSignature(value, isSigned)); } diff --git a/packages/types/src/extrinsic/v2/Extrinsic.ts b/packages/types/src/extrinsic/v2/Extrinsic.ts index 424dbdbb46..9bbaa87dc8 100644 --- a/packages/types/src/extrinsic/v2/Extrinsic.ts +++ b/packages/types/src/extrinsic/v2/Extrinsic.ts @@ -27,6 +27,7 @@ export default class ExtrinsicV2 extends Struct implements IExtrinsicImpl { constructor (registry: Registry, value?: Uint8Array | ExtrinsicValueV2 | Call, { isSigned }: Partial = {}) { super(registry, { signature: 'ExtrinsicSignatureV2', + // eslint-disable-next-line sort-keys method: 'Call' }, ExtrinsicV2.decodeExtrinsic(registry, value, isSigned)); } diff --git a/packages/types/src/extrinsic/v2/ExtrinsicPayload.ts b/packages/types/src/extrinsic/v2/ExtrinsicPayload.ts index a1c670ac2a..c3edd40130 100644 --- a/packages/types/src/extrinsic/v2/ExtrinsicPayload.ts +++ b/packages/types/src/extrinsic/v2/ExtrinsicPayload.ts @@ -21,9 +21,11 @@ export default class ExtrinsicPayloadV2 extends Struct { constructor (registry: Registry, value?: ExtrinsicPayloadValue | Uint8Array | string) { super(registry, { method: 'Bytes', + // eslint-disable-next-line sort-keys era: 'ExtrinsicEra', nonce: 'Compact', tip: 'Compact', + // eslint-disable-next-line sort-keys blockHash: 'Hash' }, value); } diff --git a/packages/types/src/extrinsic/v2/ExtrinsicSignature.ts b/packages/types/src/extrinsic/v2/ExtrinsicSignature.ts index c47b886583..c4aade5df8 100644 --- a/packages/types/src/extrinsic/v2/ExtrinsicSignature.ts +++ b/packages/types/src/extrinsic/v2/ExtrinsicSignature.ts @@ -21,7 +21,9 @@ export default class ExtrinsicSignatureV2 extends Struct implements IExtrinsicSi constructor (registry: Registry, value: ExtrinsicSignatureV2 | Uint8Array | undefined, { isSigned }: ExtrinsicSignatureOptions = {}) { super(registry, { signer: 'Address', + // eslint-disable-next-line sort-keys signature: 'Signature', + // eslint-disable-next-line sort-keys era: 'ExtrinsicEra', nonce: 'Compact', tip: 'Compact' diff --git a/packages/types/src/extrinsic/v3/Extrinsic.ts b/packages/types/src/extrinsic/v3/Extrinsic.ts index 6d4b431d67..af6a085dd9 100644 --- a/packages/types/src/extrinsic/v3/Extrinsic.ts +++ b/packages/types/src/extrinsic/v3/Extrinsic.ts @@ -27,6 +27,7 @@ export default class ExtrinsicV3 extends Struct implements IExtrinsicImpl { constructor (registry: Registry, value?: Uint8Array | ExtrinsicValueV3 | Call, { isSigned }: Partial = {}) { super(registry, { signature: 'ExtrinsicSignatureV3', + // eslint-disable-next-line sort-keys method: 'Call' }, ExtrinsicV3.decodeExtrinsic(registry, value, isSigned)); } diff --git a/packages/types/src/extrinsic/v3/ExtrinsicPayload.ts b/packages/types/src/extrinsic/v3/ExtrinsicPayload.ts index 2c402e8185..7190c5d7db 100644 --- a/packages/types/src/extrinsic/v3/ExtrinsicPayload.ts +++ b/packages/types/src/extrinsic/v3/ExtrinsicPayload.ts @@ -22,13 +22,15 @@ export default class ExtrinsicPayloadV3 extends Struct { constructor (registry: Registry, value?: ExtrinsicPayloadValue | Uint8Array | string) { super(registry, { method: 'Bytes', - // extensions + // eslint-disable-next-line sort-keys era: 'ExtrinsicEra', nonce: 'Compact', tip: 'Compact', - // extensions (additional) + // eslint-disable-next-line sort-keys specVersion: 'u32', + // eslint-disable-next-line sort-keys genesisHash: 'Hash', + // eslint-disable-next-line sort-keys blockHash: 'Hash' }, value); } diff --git a/packages/types/src/extrinsic/v4/Extrinsic.ts b/packages/types/src/extrinsic/v4/Extrinsic.ts index 6161451a35..364ca36930 100644 --- a/packages/types/src/extrinsic/v4/Extrinsic.ts +++ b/packages/types/src/extrinsic/v4/Extrinsic.ts @@ -27,6 +27,7 @@ export default class ExtrinsicV4 extends Struct implements IExtrinsicImpl { constructor (registry: Registry, value?: Uint8Array | ExtrinsicValueV4 | Call, { isSigned }: Partial = {}) { super(registry, { signature: 'ExtrinsicSignatureV4', + // eslint-disable-next-line sort-keys method: 'Call' }, ExtrinsicV4.decodeExtrinsic(registry, value, isSigned)); } diff --git a/packages/types/src/extrinsic/v4/ExtrinsicSignature.ts b/packages/types/src/extrinsic/v4/ExtrinsicSignature.ts index 3cfbafcc59..8ea103f2e2 100644 --- a/packages/types/src/extrinsic/v4/ExtrinsicSignature.ts +++ b/packages/types/src/extrinsic/v4/ExtrinsicSignature.ts @@ -23,6 +23,7 @@ export default class ExtrinsicSignatureV4 extends Struct implements IExtrinsicSi constructor (registry: Registry, value: ExtrinsicSignatureV4 | Uint8Array | undefined, { isSigned }: ExtrinsicSignatureOptions = {}) { super(registry, { signer: 'Address', + // eslint-disable-next-line sort-keys signature: 'MultiSignature', ...registry.getSignedExtensionTypes() }, ExtrinsicSignatureV4.decodeExtrinsicSignature(value, isSigned)); diff --git a/packages/types/src/generic/Block.spec.ts b/packages/types/src/generic/Block.spec.ts index fd5570cba0..9666f911e8 100644 --- a/packages/types/src/generic/Block.spec.ts +++ b/packages/types/src/generic/Block.spec.ts @@ -2,6 +2,8 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +/* eslint-disable sort-keys */ + import Metadata from '@polkadot/metadata/Metadata'; import metadataStatic from '@polkadot/metadata/Metadata/static'; diff --git a/packages/types/src/generic/Block.ts b/packages/types/src/generic/Block.ts index 43c9a9b3b8..08fe316b73 100644 --- a/packages/types/src/generic/Block.ts +++ b/packages/types/src/generic/Block.ts @@ -33,6 +33,7 @@ export default class Block extends Struct { constructor (registry: Registry, value?: BlockValue | Uint8Array) { super(registry, { header: 'Header', + // eslint-disable-next-line sort-keys extrinsics: 'Vec' }, value); } diff --git a/packages/types/src/generic/Call.ts b/packages/types/src/generic/Call.ts index fbd4bce9b7..c05a20f49b 100644 --- a/packages/types/src/generic/Call.ts +++ b/packages/types/src/generic/Call.ts @@ -55,8 +55,8 @@ function decodeCallViaObject (registry: Registry, value: DecodedMethod, _meta?: return { args, argsDef: getArgsDef(registry, meta), - meta, - callIndex + callIndex, + meta }; } @@ -124,6 +124,7 @@ export default class Call extends Struct implements IMethod { super(registry, { callIndex: CallIndex, + // eslint-disable-next-line sort-keys args: Struct.with(decoded.argsDef) }, decoded); @@ -212,10 +213,10 @@ export default class Call extends Struct implements IMethod { } return { - callIndex: u8aToHex(this.callIndex), - section: call?.section, - method: call?.method, args: this.args.map((arg) => arg.toHuman(isExpanded)), + callIndex: u8aToHex(this.callIndex), + method: call?.method, + section: call?.section, ...(isExpanded && call ? { documentation: call.meta.documentation.map((d) => d.toString()) } : {} diff --git a/packages/types/src/generic/Event.ts b/packages/types/src/generic/Event.ts index 7d987e4c0b..376a8370f4 100644 --- a/packages/types/src/generic/Event.ts +++ b/packages/types/src/generic/Event.ts @@ -77,6 +77,7 @@ export default class Event extends Struct { super(registry, { index: 'EventId', + // eslint-disable-next-line sort-keys data: DataType }, value); } @@ -94,8 +95,8 @@ export default class Event extends Struct { return { DataType: registry.findMetaEvent(index), value: { - index, - data: value.subarray(2) + data: value.subarray(2), + index } }; } diff --git a/packages/types/src/generic/Vote.ts b/packages/types/src/generic/Vote.ts index c81901ec2e..af885d03b6 100644 --- a/packages/types/src/generic/Vote.ts +++ b/packages/types/src/generic/Vote.ts @@ -101,8 +101,8 @@ export default class Vote extends U8aFixed { */ public toHuman (isExpanded?: boolean): AnyJson { return { - vote: this.isAye ? 'Aye' : 'Nay', - conviction: this.conviction.toHuman(isExpanded) + conviction: this.conviction.toHuman(isExpanded), + vote: this.isAye ? 'Aye' : 'Nay' }; } diff --git a/packages/types/src/interfaces/account/definitions.ts b/packages/types/src/interfaces/account/definitions.ts index da5e95b692..37a032b30a 100644 --- a/packages/types/src/interfaces/account/definitions.ts +++ b/packages/types/src/interfaces/account/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/attestations/definitions.ts b/packages/types/src/interfaces/attestations/definitions.ts index a9c89b501e..99e6769c34 100644 --- a/packages/types/src/interfaces/attestations/definitions.ts +++ b/packages/types/src/interfaces/attestations/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/aura/definitions.ts b/packages/types/src/interfaces/aura/definitions.ts index 2ee4580568..b17cd84e09 100644 --- a/packages/types/src/interfaces/aura/definitions.ts +++ b/packages/types/src/interfaces/aura/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/author/definitions.ts b/packages/types/src/interfaces/author/definitions.ts index 31ce9b8128..64ebc17f9d 100644 --- a/packages/types/src/interfaces/author/definitions.ts +++ b/packages/types/src/interfaces/author/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/authorship/definitions.ts b/packages/types/src/interfaces/authorship/definitions.ts index f8f0c3b06b..bc7e014a57 100644 --- a/packages/types/src/interfaces/authorship/definitions.ts +++ b/packages/types/src/interfaces/authorship/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/babe/definitions.ts b/packages/types/src/interfaces/babe/definitions.ts index 9cd2c6c789..aa90e7c3ae 100644 --- a/packages/types/src/interfaces/babe/definitions.ts +++ b/packages/types/src/interfaces/babe/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/balances/definitions.ts b/packages/types/src/interfaces/balances/definitions.ts index 5b848629ae..093136f66a 100644 --- a/packages/types/src/interfaces/balances/definitions.ts +++ b/packages/types/src/interfaces/balances/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/chain/definitions.ts b/packages/types/src/interfaces/chain/definitions.ts index 613d7a7db1..32a76a13e0 100644 --- a/packages/types/src/interfaces/chain/definitions.ts +++ b/packages/types/src/interfaces/chain/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/childstate/definitions.ts b/packages/types/src/interfaces/childstate/definitions.ts index 23cf3fe4ee..98df9eed94 100644 --- a/packages/types/src/interfaces/childstate/definitions.ts +++ b/packages/types/src/interfaces/childstate/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/claims/definitions.ts b/packages/types/src/interfaces/claims/definitions.ts index 2af23d57a0..4332ab43b4 100644 --- a/packages/types/src/interfaces/claims/definitions.ts +++ b/packages/types/src/interfaces/claims/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/collective/definitions.ts b/packages/types/src/interfaces/collective/definitions.ts index 9e0c3935c2..f2403341e4 100644 --- a/packages/types/src/interfaces/collective/definitions.ts +++ b/packages/types/src/interfaces/collective/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/consensus/definitions.ts b/packages/types/src/interfaces/consensus/definitions.ts index 8b51137fed..ea3c251753 100644 --- a/packages/types/src/interfaces/consensus/definitions.ts +++ b/packages/types/src/interfaces/consensus/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/contracts/definitions.ts b/packages/types/src/interfaces/contracts/definitions.ts index 0c9126e6dc..06fe3dff27 100644 --- a/packages/types/src/interfaces/contracts/definitions.ts +++ b/packages/types/src/interfaces/contracts/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/democracy/definitions.ts b/packages/types/src/interfaces/democracy/definitions.ts index 650b48cb82..e53f909a80 100644 --- a/packages/types/src/interfaces/democracy/definitions.ts +++ b/packages/types/src/interfaces/democracy/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; const AllConvictions = [ diff --git a/packages/types/src/interfaces/elections/definitions.ts b/packages/types/src/interfaces/elections/definitions.ts index 3d9c7d7754..a23835d2b9 100644 --- a/packages/types/src/interfaces/elections/definitions.ts +++ b/packages/types/src/interfaces/elections/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/engine/definitions.ts b/packages/types/src/interfaces/engine/definitions.ts index 54aee4f018..64d04941a3 100644 --- a/packages/types/src/interfaces/engine/definitions.ts +++ b/packages/types/src/interfaces/engine/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/evm/definitions.ts b/packages/types/src/interfaces/evm/definitions.ts index be574499d7..c915530d02 100644 --- a/packages/types/src/interfaces/evm/definitions.ts +++ b/packages/types/src/interfaces/evm/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/extrinsics/definitions.ts b/packages/types/src/interfaces/extrinsics/definitions.ts index 8868644c11..aad7bbb312 100644 --- a/packages/types/src/interfaces/extrinsics/definitions.ts +++ b/packages/types/src/interfaces/extrinsics/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/genericAsset/definitions.ts b/packages/types/src/interfaces/genericAsset/definitions.ts index 8ce5b6d401..8f7ea0115f 100644 --- a/packages/types/src/interfaces/genericAsset/definitions.ts +++ b/packages/types/src/interfaces/genericAsset/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/grandpa/definitions.ts b/packages/types/src/interfaces/grandpa/definitions.ts index 8ed7d53ea8..4903c79c00 100644 --- a/packages/types/src/interfaces/grandpa/definitions.ts +++ b/packages/types/src/interfaces/grandpa/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/identity/definitions.ts b/packages/types/src/interfaces/identity/definitions.ts index b4c79aa32d..a1a9d640aa 100644 --- a/packages/types/src/interfaces/identity/definitions.ts +++ b/packages/types/src/interfaces/identity/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/imOnline/definitions.ts b/packages/types/src/interfaces/imOnline/definitions.ts index 1fcaac788e..51695c7be3 100644 --- a/packages/types/src/interfaces/imOnline/definitions.ts +++ b/packages/types/src/interfaces/imOnline/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/metadata/definitions.ts b/packages/types/src/interfaces/metadata/definitions.ts index 5c4d126ed1..771728df5f 100644 --- a/packages/types/src/interfaces/metadata/definitions.ts +++ b/packages/types/src/interfaces/metadata/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; const AllHashers = { diff --git a/packages/types/src/interfaces/offchain/definitions.ts b/packages/types/src/interfaces/offchain/definitions.ts index 8a90ab9b64..f8bf5ad457 100644 --- a/packages/types/src/interfaces/offchain/definitions.ts +++ b/packages/types/src/interfaces/offchain/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/offences/definitions.ts b/packages/types/src/interfaces/offences/definitions.ts index 563ac19b08..ff42b5f066 100644 --- a/packages/types/src/interfaces/offences/definitions.ts +++ b/packages/types/src/interfaces/offences/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/parachains/definitions.ts b/packages/types/src/interfaces/parachains/definitions.ts index 574b8c9231..d029a22c58 100644 --- a/packages/types/src/interfaces/parachains/definitions.ts +++ b/packages/types/src/interfaces/parachains/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/payment/definitions.ts b/packages/types/src/interfaces/payment/definitions.ts index ccafce1c78..debd71e8d6 100644 --- a/packages/types/src/interfaces/payment/definitions.ts +++ b/packages/types/src/interfaces/payment/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/recovery/definitions.ts b/packages/types/src/interfaces/recovery/definitions.ts index ea22692ec0..2c4c9419cd 100644 --- a/packages/types/src/interfaces/recovery/definitions.ts +++ b/packages/types/src/interfaces/recovery/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/rpc/definitions.ts b/packages/types/src/interfaces/rpc/definitions.ts index 283d71fc7f..6671ed1308 100644 --- a/packages/types/src/interfaces/rpc/definitions.ts +++ b/packages/types/src/interfaces/rpc/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/runtime/definitions.ts b/packages/types/src/interfaces/runtime/definitions.ts index 7853add145..f0efe06e96 100644 --- a/packages/types/src/interfaces/runtime/definitions.ts +++ b/packages/types/src/interfaces/runtime/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/session/definitions.ts b/packages/types/src/interfaces/session/definitions.ts index b0b50211d0..8c7f4dc892 100644 --- a/packages/types/src/interfaces/session/definitions.ts +++ b/packages/types/src/interfaces/session/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; // The runtime definition of SessionKeys are passed as a Trait to session diff --git a/packages/types/src/interfaces/society/definitions.ts b/packages/types/src/interfaces/society/definitions.ts index 2ec1800013..cafb380e8b 100644 --- a/packages/types/src/interfaces/society/definitions.ts +++ b/packages/types/src/interfaces/society/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/staking/definitions.ts b/packages/types/src/interfaces/staking/definitions.ts index 581569b9fe..a9c6e05f41 100644 --- a/packages/types/src/interfaces/staking/definitions.ts +++ b/packages/types/src/interfaces/staking/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; const deprecated = { diff --git a/packages/types/src/interfaces/state/definitions.ts b/packages/types/src/interfaces/state/definitions.ts index f6446c01e5..6861fec255 100644 --- a/packages/types/src/interfaces/state/definitions.ts +++ b/packages/types/src/interfaces/state/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/system/definitions.ts b/packages/types/src/interfaces/system/definitions.ts index 559d2f2d29..fd95509965 100644 --- a/packages/types/src/interfaces/system/definitions.ts +++ b/packages/types/src/interfaces/system/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/interfaces/treasury/definitions.ts b/packages/types/src/interfaces/treasury/definitions.ts index 5562aac8e8..4f2bf171fc 100644 --- a/packages/types/src/interfaces/treasury/definitions.ts +++ b/packages/types/src/interfaces/treasury/definitions.ts @@ -2,13 +2,14 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { rpc: {}, types: { - OpenTipFinder: '(AccountId, Balance)', - OpenTipTip: '(AccountId, Balance)', OpenTip: { reason: 'Hash', who: 'AccountId', @@ -16,6 +17,8 @@ export default { closes: 'Option', tips: 'Vec' }, + OpenTipFinder: '(AccountId, Balance)', + OpenTipTip: '(AccountId, Balance)', TreasuryProposal: { proposer: 'AccountId', value: 'Balance', diff --git a/packages/types/src/interfaces/utility/definitions.ts b/packages/types/src/interfaces/utility/definitions.ts index 4f305ea3cc..1efd2c2bde 100644 --- a/packages/types/src/interfaces/utility/definitions.ts +++ b/packages/types/src/interfaces/utility/definitions.ts @@ -2,20 +2,23 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { rpc: {}, types: { - Timepoint: { - height: 'BlockNumber', - index: 'u32' - }, Multisig: { when: 'Timepoint', deposit: 'Balance', depositor: 'AccountId', approvals: 'Vec' + }, + Timepoint: { + height: 'BlockNumber', + index: 'u32' } } } as Definitions; diff --git a/packages/types/src/interfaces/vesting/definitions.ts b/packages/types/src/interfaces/vesting/definitions.ts index 2c93dd87ce..529dbae11a 100644 --- a/packages/types/src/interfaces/vesting/definitions.ts +++ b/packages/types/src/interfaces/vesting/definitions.ts @@ -2,6 +2,9 @@ // This software may be modified and distributed under the terms // of the Apache-2.0 license. See the LICENSE file for details. +// order important in structs... :) +/* eslint-disable sort-keys */ + import { Definitions } from '../../types'; export default { diff --git a/packages/types/src/primitive/Data.ts b/packages/types/src/primitive/Data.ts index 353aac48c3..74b46d311c 100644 --- a/packages/types/src/primitive/Data.ts +++ b/packages/types/src/primitive/Data.ts @@ -57,8 +57,10 @@ export default class Data extends Enum { super(registry, { None: 'Null', // 0 Raw: 'Bytes', // 1 + // eslint-disable-next-line sort-keys BlakeTwo256: 'H256', // 2 Sha256: 'H256', // 3 + // eslint-disable-next-line sort-keys Keccak256: 'H256', // 4 ShaThree256: 'H256' // 5 }, ...decodeData(registry, value)); diff --git a/packages/types/src/primitive/StorageKey.ts b/packages/types/src/primitive/StorageKey.ts index f3012c389e..3dabe1e898 100644 --- a/packages/types/src/primitive/StorageKey.ts +++ b/packages/types/src/primitive/StorageKey.ts @@ -35,14 +35,12 @@ interface StorageKeyExtra { const HASHER_MAP: Record = { // opaque Blake2_128: [16, false], // eslint-disable-line @typescript-eslint/camelcase + Blake2_128Concat: [16, true], // eslint-disable-line @typescript-eslint/camelcase Blake2_256: [32, false], // eslint-disable-line @typescript-eslint/camelcase + Identity: [0, true], Twox128: [16, false], Twox256: [32, false], - - // can decode - Blake2_128Concat: [16, true], // eslint-disable-line @typescript-eslint/camelcase - Twox64Concat: [8, true], - Identity: [0, true] + Twox64Concat: [8, true] }; function getStorageType (type: StorageEntryTypeLatest, isOptionalLinked?: boolean): [boolean, string] { diff --git a/typedoc.js b/typedoc.js index 769e4a1232..9db725e08a 100644 --- a/typedoc.js +++ b/typedoc.js @@ -1,15 +1,15 @@ module.exports = { - name: 'Polkadot JS API', exclude: '**/*+(index|e2e|spec|types).ts', excludeExternals: true, excludeNotExported: true, - excludeProtected: true, excludePrivate: true, + excludeProtected: true, hideGenerator: true, includeDeclarations: false, - out: 'docs', module: 'commonjs', moduleResolution: 'node', + name: 'Polkadot JS API', + out: 'docs', stripInternal: 'true', theme: 'markdown' }; diff --git a/yarn.lock b/yarn.lock index deed89fcea..45315267bb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1469,74 +1469,74 @@ __metadata: languageName: node linkType: hard -"@jest/core@npm:^25.2.3": - version: 25.2.3 - resolution: "@jest/core@npm:25.2.3" +"@jest/core@npm:^25.2.4": + version: 25.2.4 + resolution: "@jest/core@npm:25.2.4" dependencies: "@jest/console": ^25.2.3 - "@jest/reporters": ^25.2.3 - "@jest/test-result": ^25.2.3 - "@jest/transform": ^25.2.3 + "@jest/reporters": ^25.2.4 + "@jest/test-result": ^25.2.4 + "@jest/transform": ^25.2.4 "@jest/types": ^25.2.3 ansi-escapes: ^4.2.1 chalk: ^3.0.0 exit: ^0.1.2 graceful-fs: ^4.2.3 jest-changed-files: ^25.2.3 - jest-config: ^25.2.3 + jest-config: ^25.2.4 jest-haste-map: ^25.2.3 - jest-message-util: ^25.2.3 + jest-message-util: ^25.2.4 jest-regex-util: ^25.2.1 jest-resolve: ^25.2.3 - jest-resolve-dependencies: ^25.2.3 - jest-runner: ^25.2.3 - jest-runtime: ^25.2.3 - jest-snapshot: ^25.2.3 + jest-resolve-dependencies: ^25.2.4 + jest-runner: ^25.2.4 + jest-runtime: ^25.2.4 + jest-snapshot: ^25.2.4 jest-util: ^25.2.3 jest-validate: ^25.2.3 - jest-watcher: ^25.2.3 + jest-watcher: ^25.2.4 micromatch: ^4.0.2 p-each-series: ^2.1.0 realpath-native: ^2.0.0 rimraf: ^3.0.0 slash: ^3.0.0 strip-ansi: ^6.0.0 - checksum: 2/402fea735abdd435b062276dfbe5d1fdfe8c2b9077eaf4119fa6c681573268f79bb9312329a747c5586ca70c731a55b6434a16e7737f2db3102f24bd904dbcd5 + checksum: 2/0ce388d27e01bf8c70855bbb0b01c326feb0e7ff1dc4d52ad36a4b07f62c27db4a8e487f5986690dc04004d5278dfa793ddf2428fafc1e4d058c3fc77c81eae8 languageName: node linkType: hard -"@jest/environment@npm:^25.2.3": - version: 25.2.3 - resolution: "@jest/environment@npm:25.2.3" +"@jest/environment@npm:^25.2.4": + version: 25.2.4 + resolution: "@jest/environment@npm:25.2.4" dependencies: - "@jest/fake-timers": ^25.2.3 + "@jest/fake-timers": ^25.2.4 "@jest/types": ^25.2.3 jest-mock: ^25.2.3 - checksum: 2/aeeba5d16ec8d6542f94070811accc539e5e3b4ac7689f6cc45f1159c808a49d2b2917d16be2ae56aa1d8cdfc150d99413e593913ac523c675791fdc5ab63f8c + checksum: 2/a88585008da4da2319ed3a4c1ef2e5e57cbee8a233b05e20bf1e1e95584fe01af9555e7d830133e99320e3c31b2b620a7e289338d4b1e27574b92d16d02b6c6b languageName: node linkType: hard -"@jest/fake-timers@npm:^25.2.3": - version: 25.2.3 - resolution: "@jest/fake-timers@npm:25.2.3" +"@jest/fake-timers@npm:^25.2.4": + version: 25.2.4 + resolution: "@jest/fake-timers@npm:25.2.4" dependencies: "@jest/types": ^25.2.3 - jest-message-util: ^25.2.3 + jest-message-util: ^25.2.4 jest-mock: ^25.2.3 jest-util: ^25.2.3 lolex: ^5.0.0 - checksum: 2/6449b3af369130afb80c6484fb594eaf5cc6ab4eadcc8bb5f9d166ee4528a0144abc4baf6c0bf8992a4699e4083d00412750a5cc481159c92e5115171e583bdb + checksum: 2/b2dd323de13955c6917debc4279c316015813414da81d14764dc3d5e899bf84d8d6fe0abfa077e78d873c220ede0c6a8efa15841b667696c626b1d341bfd8f3d languageName: node linkType: hard -"@jest/reporters@npm:^25.2.3": - version: 25.2.3 - resolution: "@jest/reporters@npm:25.2.3" +"@jest/reporters@npm:^25.2.4": + version: 25.2.4 + resolution: "@jest/reporters@npm:25.2.4" dependencies: "@bcoe/v8-coverage": ^0.2.3 "@jest/console": ^25.2.3 - "@jest/test-result": ^25.2.3 - "@jest/transform": ^25.2.3 + "@jest/test-result": ^25.2.4 + "@jest/transform": ^25.2.4 "@jest/types": ^25.2.3 chalk: ^3.0.0 collect-v8-coverage: ^1.0.0 @@ -1560,7 +1560,7 @@ __metadata: dependenciesMeta: node-notifier: optional: true - checksum: 2/7c67ffc87a382246063eae79eace10b0e940d48e486933dc5d2fdf0e9eb533780668277c651dfd6af46a50de729014ca1b5a1b99cb9685f1cd1d2356d37ede12 + checksum: 2/accce1da8f2ee228a682435ec9c379ef59b8ad8d7c73f7d8b0ae54e8d4f64126b4f691817468b2409a144330b7a3544b95d0e6966cc319f76a9037e6082c8d8f languageName: node linkType: hard @@ -1575,34 +1575,34 @@ __metadata: languageName: node linkType: hard -"@jest/test-result@npm:^25.2.3": - version: 25.2.3 - resolution: "@jest/test-result@npm:25.2.3" +"@jest/test-result@npm:^25.2.4": + version: 25.2.4 + resolution: "@jest/test-result@npm:25.2.4" dependencies: "@jest/console": ^25.2.3 - "@jest/transform": ^25.2.3 + "@jest/transform": ^25.2.4 "@jest/types": ^25.2.3 "@types/istanbul-lib-coverage": ^2.0.0 collect-v8-coverage: ^1.0.0 - checksum: 2/56b6f6994a8a70e08825258be23f2c9c86e6ebb748c6b9eff1871d993d0bd79757850e4c5fe5d5e7ff1b95e3c4de352fa315227632ac370361a3aef92936888f + checksum: 2/fce5ba7c1214ea81f3e88fc3f116af89ef31408fbf1f59365781f5283475a2f90a791181ff084851bbb46e2fc06e0c27c23f9d4dca90c1b99b18ef55f650772f languageName: node linkType: hard -"@jest/test-sequencer@npm:^25.2.3": - version: 25.2.3 - resolution: "@jest/test-sequencer@npm:25.2.3" +"@jest/test-sequencer@npm:^25.2.4": + version: 25.2.4 + resolution: "@jest/test-sequencer@npm:25.2.4" dependencies: - "@jest/test-result": ^25.2.3 + "@jest/test-result": ^25.2.4 jest-haste-map: ^25.2.3 - jest-runner: ^25.2.3 - jest-runtime: ^25.2.3 - checksum: 2/4fb81161f67a8d57c0e96e9c6855bc3b2eeeabe1e34fcb955c192cb38bd26dea83b3ca4c42a5b4914eb92e1ed7cd526cba0a51b214202b91321fb738a4006ab3 + jest-runner: ^25.2.4 + jest-runtime: ^25.2.4 + checksum: 2/1b49fc6ba64972b28e77c9cee19d40e36be6838b6f2c6168e26823005e6c5ba1779ee8228572547d396b9995ead979f7e0e80820bffdaf290ea2c755958376bb languageName: node linkType: hard -"@jest/transform@npm:^25.2.3": - version: 25.2.3 - resolution: "@jest/transform@npm:25.2.3" +"@jest/transform@npm:^25.2.4": + version: 25.2.4 + resolution: "@jest/transform@npm:25.2.4" dependencies: "@babel/core": ^7.1.0 "@jest/types": ^25.2.3 @@ -1620,7 +1620,7 @@ __metadata: slash: ^3.0.0 source-map: ^0.6.1 write-file-atomic: ^3.0.0 - checksum: 2/51e10af2f8d64024a87bc8e83ea478ba2f3acb4c60f4695ff2ab1eef7f4286d8b9316c9dc440c380b27117dbbf66b4daa562e2d231202265393f917f2f0584c2 + checksum: 2/b7541b128602b7cf6b22fe4a6dc16c70473e33bcee5f8011a67b33fa58894f54c3ba0ddfb18991fef5943541f763fbdc724b2dd17d4ecb3d663a4c5a08ead7a2 languageName: node linkType: hard @@ -2632,9 +2632,9 @@ __metadata: languageName: unknown linkType: soft -"@polkadot/dev@npm:^0.51.9": - version: 0.51.9 - resolution: "@polkadot/dev@npm:0.51.9" +"@polkadot/dev@npm:^0.52.3": + version: 0.52.3 + resolution: "@polkadot/dev@npm:0.52.3" dependencies: "@babel/cli": ^7.8.4 "@babel/core": ^7.9.0 @@ -2656,31 +2656,32 @@ __metadata: "@babel/preset-typescript": ^7.9.0 "@babel/register": ^7.9.0 "@babel/runtime": ^7.9.2 - "@typescript-eslint/eslint-plugin": 2.25.0 - "@typescript-eslint/parser": 2.25.0 + "@typescript-eslint/eslint-plugin": 2.26.0 + "@typescript-eslint/parser": 2.26.0 "@vue/component-compiler-utils": ^3.1.1 babel-core: ^7.0.0-bridge.0 - babel-jest: ^25.2.3 + babel-jest: ^25.2.4 babel-plugin-module-resolver: ^4.0.0 babel-plugin-styled-components: ^1.10.7 - browserslist: ^4.11.0 + browserslist: ^4.11.1 chalk: ^3.0.0 coveralls: ^3.0.11 cpx: ^1.5.0 eslint: ^6.8.0 eslint-config-standard: ^14.1.1 eslint-import-resolver-node: ^0.3.3 - eslint-plugin-import: ^2.20.1 - eslint-plugin-node: ^11.0.0 + eslint-plugin-import: ^2.20.2 + eslint-plugin-node: ^11.1.0 eslint-plugin-promise: ^4.2.1 eslint-plugin-react: ^7.19.0 eslint-plugin-react-hooks: ^3.0.0 + eslint-plugin-sort-destructure-keys: ^1.3.3 eslint-plugin-standard: ^4.0.1 fs-extra: ^9.0.0 gh-pages: ^2.2.0 - jest: ^25.2.3 - jest-cli: ^25.2.3 - jest-config: ^25.2.3 + jest: ^25.2.4 + jest-cli: ^25.2.4 + jest-config: ^25.2.4 jest-haste-map: ^25.2.3 jest-resolve: ^25.2.3 lerna: ^3.20.2 @@ -2714,7 +2715,7 @@ __metadata: polkadot-exec-typedoc: scripts/polkadot-exec-typedoc.js polkadot-exec-vuepress: scripts/polkadot-exec-vuepress.js polkadot-exec-webpack: scripts/polkadot-exec-webpack.js - checksum: 2/34e23d8b643d6f8368917c2e9aa3314ad39c9fd6e8ef18792b6a0aea45bd615da1a9a7d399d64951492f55ca0980a7c6e92112e90b34267cc2652db41363ee7b + checksum: 2/aeb6078c70026ea90323925491fe3f6d09ec69d7336655779e56480950013bff880ee64f2a917d0f9850aeb2fc837c7dfa7e717c67b5c237ddfce4ae76aee5a0 languageName: node linkType: hard @@ -3133,11 +3134,11 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:2.25.0": - version: 2.25.0 - resolution: "@typescript-eslint/eslint-plugin@npm:2.25.0" +"@typescript-eslint/eslint-plugin@npm:2.26.0": + version: 2.26.0 + resolution: "@typescript-eslint/eslint-plugin@npm:2.26.0" dependencies: - "@typescript-eslint/experimental-utils": 2.25.0 + "@typescript-eslint/experimental-utils": 2.26.0 functional-red-black-tree: ^1.0.1 regexpp: ^3.0.0 tsutils: ^3.17.1 @@ -3148,31 +3149,31 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 2/7ca02b7aa06326488583e4b1078fbf39b0d5a909c689e87e4a8f9def05720b8ef91faee12fe09b344c149f068fb00ca9692d7f918ffc3b9bfc1c0b79632959af + checksum: 2/0cb2632af0f6983e6b00d45ce6dca034a30172add8da0b99d30c8525b38a8cffb2cceeaa13d723fc4269c717d7533b27b262c70b0cfbc9a89ada6e9c2f7c1f53 languageName: node linkType: hard -"@typescript-eslint/experimental-utils@npm:2.25.0": - version: 2.25.0 - resolution: "@typescript-eslint/experimental-utils@npm:2.25.0" +"@typescript-eslint/experimental-utils@npm:2.26.0": + version: 2.26.0 + resolution: "@typescript-eslint/experimental-utils@npm:2.26.0" dependencies: "@types/json-schema": ^7.0.3 - "@typescript-eslint/typescript-estree": 2.25.0 + "@typescript-eslint/typescript-estree": 2.26.0 eslint-scope: ^5.0.0 eslint-utils: ^2.0.0 peerDependencies: eslint: "*" - checksum: 2/1b221a91d887a2217dd4f9c6f15664b1d6bb37ce024e71cdfd90a4a356af974d92a17805af255f18e98ac314cbd32cc4387f45234c908e04ac632e03dfc51a1f + checksum: 2/b2df423dcc28946c9977f174e36c079ac4dc2250e5878b149be1627cbf1e3a9cabd91288d61c56b9d4d7cd88d036869f48d58efb8054e3db543d8936b84d8776 languageName: node linkType: hard -"@typescript-eslint/parser@npm:2.25.0": - version: 2.25.0 - resolution: "@typescript-eslint/parser@npm:2.25.0" +"@typescript-eslint/parser@npm:2.26.0": + version: 2.26.0 + resolution: "@typescript-eslint/parser@npm:2.26.0" dependencies: "@types/eslint-visitor-keys": ^1.0.0 - "@typescript-eslint/experimental-utils": 2.25.0 - "@typescript-eslint/typescript-estree": 2.25.0 + "@typescript-eslint/experimental-utils": 2.26.0 + "@typescript-eslint/typescript-estree": 2.26.0 eslint-visitor-keys: ^1.1.0 peerDependencies: eslint: ^5.0.0 || ^6.0.0 @@ -3180,11 +3181,31 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 2/e0202f663b146db3ac245613ab782e47e2db6ce4daa84e618286d7f9acb8b9343684ee4dcd675abd0fa839c721fbb200eef90ae4617b3e162c6ac355ca42ec98 + checksum: 2/2b751d3d3f0e2fdd741249fe8d926e6c9d62fee8f98dfad73d6cc116bb28825c8fc4d4d2b4bb8483baf6ad1e492ef0ef69c0fe8b0115423ca289a0f76aeca522 languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:2.25.0, @typescript-eslint/typescript-estree@npm:^2.4.0": +"@typescript-eslint/typescript-estree@npm:2.26.0": + version: 2.26.0 + resolution: "@typescript-eslint/typescript-estree@npm:2.26.0" + dependencies: + debug: ^4.1.1 + eslint-visitor-keys: ^1.1.0 + glob: ^7.1.6 + is-glob: ^4.0.1 + lodash: ^4.17.15 + semver: ^6.3.0 + tsutils: ^3.17.1 + peerDependencies: + typescript: "*" + peerDependenciesMeta: + typescript: + optional: true + checksum: 2/89285c28301337187c6a093a72757de633acd74771421c0a4ed02a0f942737314549122b424893e0f60720c44b07d6768617ad3e898464e49424e3cd855a3092 + languageName: node + linkType: hard + +"@typescript-eslint/typescript-estree@npm:^2.4.0": version: 2.25.0 resolution: "@typescript-eslint/typescript-estree@npm:2.25.0" dependencies: @@ -4333,11 +4354,11 @@ __metadata: languageName: node linkType: hard -"babel-jest@npm:^25.2.3": - version: 25.2.3 - resolution: "babel-jest@npm:25.2.3" +"babel-jest@npm:^25.2.4": + version: 25.2.4 + resolution: "babel-jest@npm:25.2.4" dependencies: - "@jest/transform": ^25.2.3 + "@jest/transform": ^25.2.4 "@jest/types": ^25.2.3 "@types/babel__core": ^7.1.0 babel-plugin-istanbul: ^6.0.0 @@ -4346,7 +4367,7 @@ __metadata: slash: ^3.0.0 peerDependencies: "@babel/core": ^7.0.0 - checksum: 2/10d76005713011f13ea61614141657d1c1675251c0ccd190d83ec7879a52f72665a15f205b9706a22650d07e9e21cce2a102962bb92190413c50a2e2da189dff + checksum: 2/8f77bb04cfa871cea8ae576dcaa5e5630f2663f6e38c6f2fea92903cb15a476bbe09ab4f926ad7692a573abeae4d14199c43adbd4c7e6c299631db766fb1c07e languageName: node linkType: hard @@ -4796,6 +4817,20 @@ __metadata: languageName: node linkType: hard +"browserslist@npm:^4.11.1": + version: 4.11.1 + resolution: "browserslist@npm:4.11.1" + dependencies: + caniuse-lite: ^1.0.30001038 + electron-to-chromium: ^1.3.390 + node-releases: ^1.1.53 + pkg-up: ^2.0.0 + bin: + browserslist: cli.js + checksum: 2/fdf7a5ab90fac4dd9ffbcc5c219afbe30a8deb16b2d6fe4277cf4271e12b59f1b464ace29fb4ff24896a11e14a02f4cc27a6a560575d2767b77a629d073deea4 + languageName: node + linkType: hard + "bs58@npm:^4.0.1": version: 4.0.1 resolution: "bs58@npm:4.0.1" @@ -5083,7 +5118,7 @@ __metadata: languageName: node linkType: hard -"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001035, caniuse-lite@npm:^1.0.30001036": +"caniuse-lite@npm:^1.0.0, caniuse-lite@npm:^1.0.30001035, caniuse-lite@npm:^1.0.30001036, caniuse-lite@npm:^1.0.30001038": version: 1.0.30001038 resolution: "caniuse-lite@npm:1.0.30001038" checksum: 2/ea241b85fe7f0c4bb98e0b505def4141d21b330203097e3ec7adaad33fb2839b0e7bcfa98269cd2a4050de892a10c3282d8f4ba21acabb2b068a16da8360cdc9 @@ -7040,6 +7075,13 @@ __metadata: languageName: node linkType: hard +"electron-to-chromium@npm:^1.3.390": + version: 1.3.392 + resolution: "electron-to-chromium@npm:1.3.392" + checksum: 2/bc1296d31caf80eef819ab0cba4c015db5a7d422a4ec67d97abf72fa76be07f50b86106ab07d7bb465f738fa62065da9f2152abdab92fd7f5c85559b4c09a665 + languageName: node + linkType: hard + "elliptic@npm:^6.0.0, elliptic@npm:^6.5.2": version: 6.5.2 resolution: "elliptic@npm:6.5.2" @@ -7381,9 +7423,9 @@ __metadata: languageName: node linkType: hard -"eslint-plugin-import@npm:^2.20.1": - version: 2.20.1 - resolution: "eslint-plugin-import@npm:2.20.1" +"eslint-plugin-import@npm:^2.20.2": + version: 2.20.2 + resolution: "eslint-plugin-import@npm:2.20.2" dependencies: array-includes: ^3.0.3 array.prototype.flat: ^1.2.1 @@ -7399,13 +7441,13 @@ __metadata: resolve: ^1.12.0 peerDependencies: eslint: 2.x - 6.x - checksum: 2/d35b8171ff4611f19749f12f7fcb680a6cd583c6df90a5702116d5502152bd6f8d3c41431e5dc7260d29905c79fa0cf417386d80aa4074a511e371ef9b915348 + checksum: 2/be55da3d409d24a5b21b9d999271c7c9080bc9c3547743d5897663a1d59a14ceac6be70f3d89ef5a997009d3c661189c63d7c9e8889c140b3cef0dbe03b37eea languageName: node linkType: hard -"eslint-plugin-node@npm:^11.0.0": - version: 11.0.0 - resolution: "eslint-plugin-node@npm:11.0.0" +"eslint-plugin-node@npm:^11.1.0": + version: 11.1.0 + resolution: "eslint-plugin-node@npm:11.1.0" dependencies: eslint-plugin-es: ^3.0.0 eslint-utils: ^2.0.0 @@ -7415,7 +7457,7 @@ __metadata: semver: ^6.1.0 peerDependencies: eslint: ">=5.16.0" - checksum: 2/fabfc5896b84d047ac3133bbe595a1b6506e47a951a565c9d75d0ea72a1ec20950f2f9d01a503bb567731c3b32e7b3f4c68ee951449bf8cfdb74fffca89d8496 + checksum: 2/634e03613a4aa0ffd5ccf0807a375840a915797781a4e5d44fb1c4d331cd2a5e6b3da41924a0d6a2123c1a51626db032a038210153fbba6a0012e0b7c7f26499 languageName: node linkType: hard @@ -7457,6 +7499,17 @@ __metadata: languageName: node linkType: hard +"eslint-plugin-sort-destructure-keys@npm:^1.3.3": + version: 1.3.3 + resolution: "eslint-plugin-sort-destructure-keys@npm:1.3.3" + dependencies: + natural-compare-lite: ^1.4.0 + peerDependencies: + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 + checksum: 2/bcf1e4c8d9ebd692269cfbec29fbd321eec86f13273b313c46d5cff6c9434873941db4dfa117f7b71a60e247c3be5df2cdc324d4216b824ac19e3fad259370fd + languageName: node + linkType: hard + "eslint-plugin-standard@npm:^4.0.1": version: 4.0.1 resolution: "eslint-plugin-standard@npm:4.0.1" @@ -7772,17 +7825,17 @@ __metadata: languageName: node linkType: hard -"expect@npm:^25.2.3": - version: 25.2.3 - resolution: "expect@npm:25.2.3" +"expect@npm:^25.2.4": + version: 25.2.4 + resolution: "expect@npm:25.2.4" dependencies: "@jest/types": ^25.2.3 ansi-styles: ^4.0.0 jest-get-type: ^25.2.1 jest-matcher-utils: ^25.2.3 - jest-message-util: ^25.2.3 + jest-message-util: ^25.2.4 jest-regex-util: ^25.2.1 - checksum: 2/108ae91b74279ad5569372ea51ea0c3083dda3cd22947c215aa4bac381bdf4048cdd7cf8b7d2b1439adf36d52a07c83dfb3cc1e740be17a1130f2797f3945750 + checksum: 2/ea758b5414b22728ad7b73fb384a6b6d878d70a8dcce04c2a83999a9ae66cb0650bc3e17efe44d8db6b5e51067db8d105f2cc1fcd96c73fbbd78fed6e14e6a5b languageName: node linkType: hard @@ -10425,18 +10478,18 @@ __metadata: languageName: node linkType: hard -"jest-cli@npm:^25.2.3": - version: 25.2.3 - resolution: "jest-cli@npm:25.2.3" +"jest-cli@npm:^25.2.4": + version: 25.2.4 + resolution: "jest-cli@npm:25.2.4" dependencies: - "@jest/core": ^25.2.3 - "@jest/test-result": ^25.2.3 + "@jest/core": ^25.2.4 + "@jest/test-result": ^25.2.4 "@jest/types": ^25.2.3 chalk: ^3.0.0 exit: ^0.1.2 import-local: ^3.0.2 is-ci: ^2.0.0 - jest-config: ^25.2.3 + jest-config: ^25.2.4 jest-util: ^25.2.3 jest-validate: ^25.2.3 prompts: ^2.0.1 @@ -10444,25 +10497,25 @@ __metadata: yargs: ^15.3.1 bin: jest: bin/jest.js - checksum: 2/a7a82ece67c5b0b8bb07ac4e44e36efddedfdc4fbfc0fc251627cc015fb49da30246a80a07e4c232260f7205634d26466879849d38234344ec12db8cdbcb5237 + checksum: 2/12b872723071c6014d1907dbd5c3e792acf9c631e2af364bc5d5eeb5cb85d01e633cbb77092699a52d35e44e064aae2a42249b20bb6160a87c278581b2df272c languageName: node linkType: hard -"jest-config@npm:^25.2.3": - version: 25.2.3 - resolution: "jest-config@npm:25.2.3" +"jest-config@npm:^25.2.4": + version: 25.2.4 + resolution: "jest-config@npm:25.2.4" dependencies: "@babel/core": ^7.1.0 - "@jest/test-sequencer": ^25.2.3 + "@jest/test-sequencer": ^25.2.4 "@jest/types": ^25.2.3 - babel-jest: ^25.2.3 + babel-jest: ^25.2.4 chalk: ^3.0.0 deepmerge: ^4.2.2 glob: ^7.1.1 - jest-environment-jsdom: ^25.2.3 - jest-environment-node: ^25.2.3 + jest-environment-jsdom: ^25.2.4 + jest-environment-node: ^25.2.4 jest-get-type: ^25.2.1 - jest-jasmine2: ^25.2.3 + jest-jasmine2: ^25.2.4 jest-regex-util: ^25.2.1 jest-resolve: ^25.2.3 jest-util: ^25.2.3 @@ -10470,7 +10523,7 @@ __metadata: micromatch: ^4.0.2 pretty-format: ^25.2.3 realpath-native: ^2.0.0 - checksum: 2/6b480d183842f5744de9ccbd2c2f9c24cffef00acad1e02ca539cb42ffc29d6f5e41e94d0bf05298ec5ad0bbabfd85f7929dcf9460ec74a07512e7024feb89d0 + checksum: 2/2a2cdbad8d96c60b64c3a6104546432b739afc221a654174df91df3c75d80381a9088ea4f7d93fb23710bfbae307343001f2373b059671e5e409754c4266ba60 languageName: node linkType: hard @@ -10508,31 +10561,31 @@ __metadata: languageName: node linkType: hard -"jest-environment-jsdom@npm:^25.2.3": - version: 25.2.3 - resolution: "jest-environment-jsdom@npm:25.2.3" +"jest-environment-jsdom@npm:^25.2.4": + version: 25.2.4 + resolution: "jest-environment-jsdom@npm:25.2.4" dependencies: - "@jest/environment": ^25.2.3 - "@jest/fake-timers": ^25.2.3 + "@jest/environment": ^25.2.4 + "@jest/fake-timers": ^25.2.4 "@jest/types": ^25.2.3 jest-mock: ^25.2.3 jest-util: ^25.2.3 jsdom: ^15.2.1 - checksum: 2/f29cabba108c496d966315330be4affe23133cfd1ada410e88f66acf81e7e5b111e2c600bc39007036b16250cce7803dacaeaa8df962217e7ed53123bab1449b + checksum: 2/b68ffc4a00343951ba29725c0d851ad61b7221a6d9e70d6144d4168cac0c27f7a38d08bd809e6c60429acc5e144afd5661afadad4d2ad60f4cd67b66e0d86996 languageName: node linkType: hard -"jest-environment-node@npm:^25.2.3": - version: 25.2.3 - resolution: "jest-environment-node@npm:25.2.3" +"jest-environment-node@npm:^25.2.4": + version: 25.2.4 + resolution: "jest-environment-node@npm:25.2.4" dependencies: - "@jest/environment": ^25.2.3 - "@jest/fake-timers": ^25.2.3 + "@jest/environment": ^25.2.4 + "@jest/fake-timers": ^25.2.4 "@jest/types": ^25.2.3 jest-mock: ^25.2.3 jest-util: ^25.2.3 semver: ^6.3.0 - checksum: 2/7e3bdbb6b660fceae1ba947b2574dfcd6efdde3df359283f3c324471f0ef59e6acbcdccd54750ca301eb9a2556b68455bf2c1cc19a4bace88edd5ec49d7e3e21 + checksum: 2/df323050406be8801e81db9da86c2ed3d508a077c98778b73fe827c48ad7c22291ae64248ce7806135e2ffcb957423de886a42020383b10873005da66111e0ca languageName: node linkType: hard @@ -10566,28 +10619,28 @@ __metadata: languageName: node linkType: hard -"jest-jasmine2@npm:^25.2.3": - version: 25.2.3 - resolution: "jest-jasmine2@npm:25.2.3" +"jest-jasmine2@npm:^25.2.4": + version: 25.2.4 + resolution: "jest-jasmine2@npm:25.2.4" dependencies: "@babel/traverse": ^7.1.0 - "@jest/environment": ^25.2.3 + "@jest/environment": ^25.2.4 "@jest/source-map": ^25.2.1 - "@jest/test-result": ^25.2.3 + "@jest/test-result": ^25.2.4 "@jest/types": ^25.2.3 chalk: ^3.0.0 co: ^4.6.0 - expect: ^25.2.3 + expect: ^25.2.4 is-generator-fn: ^2.0.0 jest-each: ^25.2.3 jest-matcher-utils: ^25.2.3 - jest-message-util: ^25.2.3 - jest-runtime: ^25.2.3 - jest-snapshot: ^25.2.3 + jest-message-util: ^25.2.4 + jest-runtime: ^25.2.4 + jest-snapshot: ^25.2.4 jest-util: ^25.2.3 pretty-format: ^25.2.3 throat: ^5.0.0 - checksum: 2/41bf7f81ee3dce93c79b0c012bdf2bde4bfa5f7fa2e11bfee6b560b9fa2f32800c1c22db85b8db8624809bb330986feacb11c9e7544ee11254fd4af85b4f3e89 + checksum: 2/c8e82c2c12e3e498f5f4dea078d8ae8226f0b8526fedd65a10258ff1f3c0399ddd0951668497d44432e50d8054e228b06845bcbfb0b689a13ecb0f4927481797 languageName: node linkType: hard @@ -10613,19 +10666,19 @@ __metadata: languageName: node linkType: hard -"jest-message-util@npm:^25.2.3": - version: 25.2.3 - resolution: "jest-message-util@npm:25.2.3" +"jest-message-util@npm:^25.2.4": + version: 25.2.4 + resolution: "jest-message-util@npm:25.2.4" dependencies: "@babel/code-frame": ^7.0.0 - "@jest/test-result": ^25.2.3 + "@jest/test-result": ^25.2.4 "@jest/types": ^25.2.3 "@types/stack-utils": ^1.0.1 chalk: ^3.0.0 micromatch: ^4.0.2 slash: ^3.0.0 stack-utils: ^1.0.1 - checksum: 2/83fd8597017373d2982083959580028823333590d55925522c6c6beaa5290aaa18b8232a1551e706045e0115d91841464ec3dab5db268fa9b1a12b30c6f8a099 + checksum: 2/d64ae966e8e63b0ca9b9ddf90794389a0d8273a4a8bd16a7036d0e2b35d244dbc067e2d78c54399e112ce74889703638b8674699c58c9c87f7ec98d1c31beb17 languageName: node linkType: hard @@ -10657,14 +10710,14 @@ __metadata: languageName: node linkType: hard -"jest-resolve-dependencies@npm:^25.2.3": - version: 25.2.3 - resolution: "jest-resolve-dependencies@npm:25.2.3" +"jest-resolve-dependencies@npm:^25.2.4": + version: 25.2.4 + resolution: "jest-resolve-dependencies@npm:25.2.4" dependencies: "@jest/types": ^25.2.3 jest-regex-util: ^25.2.1 - jest-snapshot: ^25.2.3 - checksum: 2/b8942c074e46984870433116a3f5db7a8bc09b0ffc380ba0175e058200a14283326fd127cd4c295eebe11559b6f7570ce45f37b5aeddc598bb0484ccb9c1813b + jest-snapshot: ^25.2.4 + checksum: 2/1e7d8648cbe8e76bd2fa879e8c09d5db883700791a1b294f046ad30d93ba319f4a04fec86b962df8429338055e13c3e8550626e607da261ffd124221b344603b languageName: node linkType: hard @@ -10682,42 +10735,42 @@ __metadata: languageName: node linkType: hard -"jest-runner@npm:^25.2.3": - version: 25.2.3 - resolution: "jest-runner@npm:25.2.3" +"jest-runner@npm:^25.2.4": + version: 25.2.4 + resolution: "jest-runner@npm:25.2.4" dependencies: "@jest/console": ^25.2.3 - "@jest/environment": ^25.2.3 - "@jest/test-result": ^25.2.3 + "@jest/environment": ^25.2.4 + "@jest/test-result": ^25.2.4 "@jest/types": ^25.2.3 chalk: ^3.0.0 exit: ^0.1.2 graceful-fs: ^4.2.3 - jest-config: ^25.2.3 + jest-config: ^25.2.4 jest-docblock: ^25.2.3 jest-haste-map: ^25.2.3 - jest-jasmine2: ^25.2.3 + jest-jasmine2: ^25.2.4 jest-leak-detector: ^25.2.3 - jest-message-util: ^25.2.3 + jest-message-util: ^25.2.4 jest-resolve: ^25.2.3 - jest-runtime: ^25.2.3 + jest-runtime: ^25.2.4 jest-util: ^25.2.3 jest-worker: ^25.2.1 source-map-support: ^0.5.6 throat: ^5.0.0 - checksum: 2/d5bae8af753d672b6997039a9bf84ec37f539fb600cce18a2f994c949d0a40b98c3f363899c0c0a3997436106576350f56ccfce6a7e49fc27c8ca8c3329defd2 + checksum: 2/735aff025cfd0386725af0ad049df33ef7eea3ac0e780053981b500204a35942af063f20921cc71eadc16f5a23c9cdeb96f2931ab2600addb993ec74b39bd36b languageName: node linkType: hard -"jest-runtime@npm:^25.2.3": - version: 25.2.3 - resolution: "jest-runtime@npm:25.2.3" +"jest-runtime@npm:^25.2.4": + version: 25.2.4 + resolution: "jest-runtime@npm:25.2.4" dependencies: "@jest/console": ^25.2.3 - "@jest/environment": ^25.2.3 + "@jest/environment": ^25.2.4 "@jest/source-map": ^25.2.1 - "@jest/test-result": ^25.2.3 - "@jest/transform": ^25.2.3 + "@jest/test-result": ^25.2.4 + "@jest/transform": ^25.2.4 "@jest/types": ^25.2.3 "@types/yargs": ^15.0.0 chalk: ^3.0.0 @@ -10725,13 +10778,13 @@ __metadata: exit: ^0.1.2 glob: ^7.1.3 graceful-fs: ^4.2.3 - jest-config: ^25.2.3 + jest-config: ^25.2.4 jest-haste-map: ^25.2.3 - jest-message-util: ^25.2.3 + jest-message-util: ^25.2.4 jest-mock: ^25.2.3 jest-regex-util: ^25.2.1 jest-resolve: ^25.2.3 - jest-snapshot: ^25.2.3 + jest-snapshot: ^25.2.4 jest-util: ^25.2.3 jest-validate: ^25.2.3 realpath-native: ^2.0.0 @@ -10740,7 +10793,7 @@ __metadata: yargs: ^15.3.1 bin: jest-runtime: bin/jest-runtime.js - checksum: 2/4cd74d5a3e80582d9d7b5d445f06b56dc6f1ab2d637d41ae06aaf4c992cbe9b525ee6b94b3a4cd558d57d60f765f27abb96f6fc43034b6ba2c7e392e2e0bb112 + checksum: 2/0ed90b776e096971a0015eba481d28558a5c0fb5dcdf06cbd2051422880bbf3db69e7c8c9b63d426ccb93142472405f472b3fe49287d85ac2f33b8fe57f28f28 languageName: node linkType: hard @@ -10751,25 +10804,25 @@ __metadata: languageName: node linkType: hard -"jest-snapshot@npm:^25.2.3": - version: 25.2.3 - resolution: "jest-snapshot@npm:25.2.3" +"jest-snapshot@npm:^25.2.4": + version: 25.2.4 + resolution: "jest-snapshot@npm:25.2.4" dependencies: "@babel/types": ^7.0.0 "@jest/types": ^25.2.3 "@types/prettier": ^1.19.0 chalk: ^3.0.0 - expect: ^25.2.3 + expect: ^25.2.4 jest-diff: ^25.2.3 jest-get-type: ^25.2.1 jest-matcher-utils: ^25.2.3 - jest-message-util: ^25.2.3 + jest-message-util: ^25.2.4 jest-resolve: ^25.2.3 make-dir: ^3.0.0 natural-compare: ^1.4.0 pretty-format: ^25.2.3 semver: ^6.3.0 - checksum: 2/45e21ea1bc4e4f07e599f869bd95d8ddf7202e3e42036aa78518f9c814d79c66699a4d3eaac53b9cec3e0455ca62cc3a42108264c14b13c8592de82be2220f64 + checksum: 2/1ca44804af97bfe9703e34dca0e6d9b2b3bfb39a532eed2b60b9bc2cab57232690a0eb30e84e164776291fab51f02f9e9a3829c2af4d40f74ba3df9459cde47f languageName: node linkType: hard @@ -10799,17 +10852,17 @@ __metadata: languageName: node linkType: hard -"jest-watcher@npm:^25.2.3": - version: 25.2.3 - resolution: "jest-watcher@npm:25.2.3" +"jest-watcher@npm:^25.2.4": + version: 25.2.4 + resolution: "jest-watcher@npm:25.2.4" dependencies: - "@jest/test-result": ^25.2.3 + "@jest/test-result": ^25.2.4 "@jest/types": ^25.2.3 ansi-escapes: ^4.2.1 chalk: ^3.0.0 jest-util: ^25.2.3 string-length: ^3.1.0 - checksum: 2/8ca07dadc3d51d161e20af766e0322e48b2610bd6764b07269190175e6bd7ded16822c78770da62705c63b012a0af6eb741473844c1030d4b2421a37349015dc + checksum: 2/1575dd30e1f7c0976a314bdc942aff8d9040cd52e6eb82bf7c52a20a9111f8c9df0d4df73a2678e0f9476a53825bc2f852b0bfcbed12145ee46f19b86dd85953 languageName: node linkType: hard @@ -10823,16 +10876,16 @@ __metadata: languageName: node linkType: hard -"jest@npm:^25.2.3": - version: 25.2.3 - resolution: "jest@npm:25.2.3" +"jest@npm:^25.2.4": + version: 25.2.4 + resolution: "jest@npm:25.2.4" dependencies: - "@jest/core": ^25.2.3 + "@jest/core": ^25.2.4 import-local: ^3.0.2 - jest-cli: ^25.2.3 + jest-cli: ^25.2.4 bin: jest: bin/jest.js - checksum: 2/d519913f1505e79a14d63b1c8b62fbe5311625ad631f345a181193a29f2f029b4a71ffab24475ed0ccfa5d5ca96977c6d8966d6148f298fe2567fe3b32912cfd + checksum: 2/a41dd598dc7e06c2e25d6091f98f1b2b052d66759aa35822c52825ad3fc5e50bf9ccbe27bb5ca76fe7413dfeda18c1047d5f9cbd539aeab8837ea2b2f7f7ca6f languageName: node linkType: hard @@ -12369,6 +12422,13 @@ __metadata: languageName: node linkType: hard +"natural-compare-lite@npm:^1.4.0": + version: 1.4.0 + resolution: "natural-compare-lite@npm:1.4.0" + checksum: 2/18c1c37b8523b08e9ea51043f3f6a7a50c9354fcc0b3ff4ec3437f017f766325e935cf427fd3b39657491f6174a8701c498235acb642c752537ddca5d378ff1f + languageName: node + linkType: hard + "natural-compare@npm:^1.4.0": version: 1.4.0 resolution: "natural-compare@npm:1.4.0" @@ -12609,6 +12669,13 @@ __metadata: languageName: node linkType: hard +"node-releases@npm:^1.1.53": + version: 1.1.53 + resolution: "node-releases@npm:1.1.53" + checksum: 2/744ff9662695845bb0c14abad46d4b77b63b70bec75ef2af59539c5e7b80faf7a87552092bc8917292c34dcf5153d53988939409065686d5a220cc340be17260 + languageName: node + linkType: hard + "node-source-walk@npm:^4.0.0, node-source-walk@npm:^4.2.0": version: 4.2.0 resolution: "node-source-walk@npm:4.2.0" @@ -13699,6 +13766,15 @@ __metadata: languageName: node linkType: hard +"pkg-up@npm:^2.0.0": + version: 2.0.0 + resolution: "pkg-up@npm:2.0.0" + dependencies: + find-up: ^2.1.0 + checksum: 2/0a8fcbebf0f1aadc7a52c576352a698abef6c389cb00a0847db2d370d05d4c005f855e196d29618b088062f1394711ca6dadd232692ed225511d7e75a198d246 + languageName: node + linkType: hard + "pkg-up@npm:^3.1.0": version: 3.1.0 resolution: "pkg-up@npm:3.1.0" @@ -15329,7 +15405,7 @@ __metadata: "@babel/core": ^7.9.0 "@babel/register": ^7.9.0 "@babel/runtime": ^7.9.2 - "@polkadot/dev": ^0.51.9 + "@polkadot/dev": ^0.52.3 "@polkadot/ts": ^0.3.14 "@polkadot/typegen": "workspace:packages/typegen" "@types/jest": ^25.1.4