diff --git a/CHANGELOG.md b/CHANGELOG.md index fd6fcfa3dc..4c9458cad9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # CHANGELOG +## 9.13.5 Feb 2, 2023 + +Changes: + +- Adjust `Weight` alias for 1.5 chains +- Ensure correct registry is pass through for runtime TS generation + + ## 9.13.4 Feb 1, 2023 Changes: diff --git a/package.json b/package.json index b3067f05ab..bca6d09a08 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "sideEffects": false, "type": "module", - "version": "9.13.4", + "version": "9.13.5", "versions": { "git": "9.13.4", "npm": "9.13.4" diff --git a/packages/api-augment/package.json b/packages/api-augment/package.json index d06434fa50..3c308a39eb 100644 --- a/packages/api-augment/package.json +++ b/packages/api-augment/package.json @@ -20,15 +20,15 @@ "./detectPackage.cjs" ], "type": "module", - "version": "9.13.4", + "version": "9.13.5", "main": "index.js", "dependencies": { "@babel/runtime": "^7.20.13", - "@polkadot/api-base": "9.13.4", - "@polkadot/rpc-augment": "9.13.4", - "@polkadot/types": "9.13.4", - "@polkadot/types-augment": "9.13.4", - "@polkadot/types-codec": "9.13.4", + "@polkadot/api-base": "9.13.5", + "@polkadot/rpc-augment": "9.13.5", + "@polkadot/types": "9.13.5", + "@polkadot/types-augment": "9.13.5", + "@polkadot/types-codec": "9.13.5", "@polkadot/util": "^10.3.1" } } diff --git a/packages/api-base/package.json b/packages/api-base/package.json index 27afe5e8ed..fb375142b2 100644 --- a/packages/api-base/package.json +++ b/packages/api-base/package.json @@ -20,12 +20,12 @@ "./detectPackage.cjs" ], "type": "module", - "version": "9.13.4", + "version": "9.13.5", "main": "index.js", "dependencies": { "@babel/runtime": "^7.20.13", - "@polkadot/rpc-core": "9.13.4", - "@polkadot/types": "9.13.4", + "@polkadot/rpc-core": "9.13.5", + "@polkadot/types": "9.13.5", "@polkadot/util": "^10.3.1", "rxjs": "^7.8.0" } diff --git a/packages/api-contract/package.json b/packages/api-contract/package.json index a35b724445..cd8814ec4a 100644 --- a/packages/api-contract/package.json +++ b/packages/api-contract/package.json @@ -20,20 +20,20 @@ "./detectPackage.cjs" ], "type": "module", - "version": "9.13.4", + "version": "9.13.5", "main": "index.js", "dependencies": { "@babel/runtime": "^7.20.13", - "@polkadot/api": "9.13.4", - "@polkadot/types": "9.13.4", - "@polkadot/types-codec": "9.13.4", - "@polkadot/types-create": "9.13.4", + "@polkadot/api": "9.13.5", + "@polkadot/types": "9.13.5", + "@polkadot/types-codec": "9.13.5", + "@polkadot/types-create": "9.13.5", "@polkadot/util": "^10.3.1", "@polkadot/util-crypto": "^10.3.1", "rxjs": "^7.8.0" }, "devDependencies": { - "@polkadot/api-augment": "9.13.4", + "@polkadot/api-augment": "9.13.5", "@polkadot/keyring": "^10.3.1" } } diff --git a/packages/api-derive/package.json b/packages/api-derive/package.json index c31da68173..e4232c8c97 100644 --- a/packages/api-derive/package.json +++ b/packages/api-derive/package.json @@ -20,25 +20,25 @@ "./detectPackage.cjs" ], "type": "module", - "version": "9.13.4", + "version": "9.13.5", "main": "index.js", "dependencies": { "@babel/runtime": "^7.20.13", - "@polkadot/api": "9.13.4", - "@polkadot/api-augment": "9.13.4", - "@polkadot/api-base": "9.13.4", - "@polkadot/rpc-core": "9.13.4", - "@polkadot/types": "9.13.4", - "@polkadot/types-codec": "9.13.4", + "@polkadot/api": "9.13.5", + "@polkadot/api-augment": "9.13.5", + "@polkadot/api-base": "9.13.5", + "@polkadot/rpc-core": "9.13.5", + "@polkadot/types": "9.13.5", + "@polkadot/types-codec": "9.13.5", "@polkadot/util": "^10.3.1", "@polkadot/util-crypto": "^10.3.1", "rxjs": "^7.8.0" }, "devDependencies": { - "@polkadot/api": "9.13.4", - "@polkadot/api-augment": "9.13.4", - "@polkadot/rpc-augment": "9.13.4", - "@polkadot/rpc-provider": "9.13.4", - "@polkadot/types-support": "9.13.4" + "@polkadot/api": "9.13.5", + "@polkadot/api-augment": "9.13.5", + "@polkadot/rpc-augment": "9.13.5", + "@polkadot/rpc-provider": "9.13.5", + "@polkadot/types-support": "9.13.5" } } diff --git a/packages/api/package.json b/packages/api/package.json index e73dbf2ad7..0a180066fb 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -20,29 +20,29 @@ "./detectPackage.cjs" ], "type": "module", - "version": "9.13.4", + "version": "9.13.5", "main": "index.js", "dependencies": { "@babel/runtime": "^7.20.13", - "@polkadot/api-augment": "9.13.4", - "@polkadot/api-base": "9.13.4", - "@polkadot/api-derive": "9.13.4", + "@polkadot/api-augment": "9.13.5", + "@polkadot/api-base": "9.13.5", + "@polkadot/api-derive": "9.13.5", "@polkadot/keyring": "^10.3.1", - "@polkadot/rpc-augment": "9.13.4", - "@polkadot/rpc-core": "9.13.4", - "@polkadot/rpc-provider": "9.13.4", - "@polkadot/types": "9.13.4", - "@polkadot/types-augment": "9.13.4", - "@polkadot/types-codec": "9.13.4", - "@polkadot/types-create": "9.13.4", - "@polkadot/types-known": "9.13.4", + "@polkadot/rpc-augment": "9.13.5", + "@polkadot/rpc-core": "9.13.5", + "@polkadot/rpc-provider": "9.13.5", + "@polkadot/types": "9.13.5", + "@polkadot/types-augment": "9.13.5", + "@polkadot/types-codec": "9.13.5", + "@polkadot/types-create": "9.13.5", + "@polkadot/types-known": "9.13.5", "@polkadot/util": "^10.3.1", "@polkadot/util-crypto": "^10.3.1", "eventemitter3": "^5.0.0", "rxjs": "^7.8.0" }, "devDependencies": { - "@polkadot/api-augment": "9.13.4", - "@polkadot/types-support": "9.13.4" + "@polkadot/api-augment": "9.13.5", + "@polkadot/types-support": "9.13.5" } } diff --git a/packages/rpc-augment/package.json b/packages/rpc-augment/package.json index 6556fac4d7..bf1cf766f1 100644 --- a/packages/rpc-augment/package.json +++ b/packages/rpc-augment/package.json @@ -20,13 +20,13 @@ "./detectPackage.cjs" ], "type": "module", - "version": "9.13.4", + "version": "9.13.5", "main": "index.js", "dependencies": { "@babel/runtime": "^7.20.13", - "@polkadot/rpc-core": "9.13.4", - "@polkadot/types": "9.13.4", - "@polkadot/types-codec": "9.13.4", + "@polkadot/rpc-core": "9.13.5", + "@polkadot/types": "9.13.5", + "@polkadot/types-codec": "9.13.5", "@polkadot/util": "^10.3.1" } } diff --git a/packages/rpc-core/package.json b/packages/rpc-core/package.json index b56a490dcb..7e2cfc2bc2 100644 --- a/packages/rpc-core/package.json +++ b/packages/rpc-core/package.json @@ -20,18 +20,18 @@ "./detectPackage.cjs" ], "type": "module", - "version": "9.13.4", + "version": "9.13.5", "main": "index.js", "dependencies": { "@babel/runtime": "^7.20.13", - "@polkadot/rpc-augment": "9.13.4", - "@polkadot/rpc-provider": "9.13.4", - "@polkadot/types": "9.13.4", + "@polkadot/rpc-augment": "9.13.5", + "@polkadot/rpc-provider": "9.13.5", + "@polkadot/types": "9.13.5", "@polkadot/util": "^10.3.1", "rxjs": "^7.8.0" }, "devDependencies": { "@polkadot/keyring": "^10.3.1", - "@polkadot/rpc-augment": "9.13.4" + "@polkadot/rpc-augment": "9.13.5" } } diff --git a/packages/rpc-provider/package.json b/packages/rpc-provider/package.json index d00ecaaa0d..84108f525f 100644 --- a/packages/rpc-provider/package.json +++ b/packages/rpc-provider/package.json @@ -20,13 +20,13 @@ "./detectPackage.cjs" ], "type": "module", - "version": "9.13.4", + "version": "9.13.5", "main": "index.js", "dependencies": { "@babel/runtime": "^7.20.13", "@polkadot/keyring": "^10.3.1", - "@polkadot/types": "9.13.4", - "@polkadot/types-support": "9.13.4", + "@polkadot/types": "9.13.5", + "@polkadot/types-support": "9.13.5", "@polkadot/util": "^10.3.1", "@polkadot/util-crypto": "^10.3.1", "@polkadot/x-fetch": "^10.3.1", diff --git a/packages/typegen/package.json b/packages/typegen/package.json index 56061f513f..e9fd891fed 100644 --- a/packages/typegen/package.json +++ b/packages/typegen/package.json @@ -20,7 +20,7 @@ "./detectPackage.cjs" ], "type": "module", - "version": "9.13.4", + "version": "9.13.5", "main": "index.js", "bin": { "polkadot-types-chain-info": "./scripts/polkadot-types-chain-info.cjs", @@ -33,15 +33,15 @@ "@babel/core": "^7.20.12", "@babel/register": "^7.18.9", "@babel/runtime": "^7.20.13", - "@polkadot/api": "9.13.4", - "@polkadot/api-augment": "9.13.4", - "@polkadot/rpc-augment": "9.13.4", - "@polkadot/rpc-provider": "9.13.4", - "@polkadot/types": "9.13.4", - "@polkadot/types-augment": "9.13.4", - "@polkadot/types-codec": "9.13.4", - "@polkadot/types-create": "9.13.4", - "@polkadot/types-support": "9.13.4", + "@polkadot/api": "9.13.5", + "@polkadot/api-augment": "9.13.5", + "@polkadot/rpc-augment": "9.13.5", + "@polkadot/rpc-provider": "9.13.5", + "@polkadot/types": "9.13.5", + "@polkadot/types-augment": "9.13.5", + "@polkadot/types-codec": "9.13.5", + "@polkadot/types-create": "9.13.5", + "@polkadot/types-support": "9.13.5", "@polkadot/util": "^10.3.1", "@polkadot/util-crypto": "^10.3.1", "@polkadot/x-ws": "^10.3.1", diff --git a/packages/typegen/src/fromChain.ts b/packages/typegen/src/fromChain.ts index a7e357eb8f..465bdba7c0 100644 --- a/packages/typegen/src/fromChain.ts +++ b/packages/typegen/src/fromChain.ts @@ -9,7 +9,7 @@ import yargs from 'yargs'; import { Definitions } from '@polkadot/types/types'; import { formatNumber } from '@polkadot/util'; -import { generateDefaultCalls, generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultQuery, generateDefaultRpc, generateDefaultTx } from './generate'; +import { generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultQuery, generateDefaultRpc, generateDefaultRuntime, generateDefaultTx } from './generate'; import { assertDir, assertFile, getMetadataViaWs, HEADER, writeFile } from './util'; function generate (metaHex: HexString, pkg: string | undefined, output: string, isStrict?: boolean): void { @@ -45,8 +45,8 @@ function generate (metaHex: HexString, pkg: string | undefined, output: string, generateDefaultEvents(path.join(outputPath, 'augment-api-events.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions); generateDefaultQuery(path.join(outputPath, 'augment-api-query.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions); generateDefaultRpc(path.join(outputPath, 'augment-api-rpc.ts'), extraTypes); + generateDefaultRuntime(path.join(outputPath, 'augment-api-runtime.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions); generateDefaultTx(path.join(outputPath, 'augment-api-tx.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions); - generateDefaultCalls(path.join(outputPath, 'augment-api-runtime.ts'), metaHex, extraTypes, isStrict, customLookupDefinitions); writeFile(path.join(outputPath, 'augment-api.ts'), (): string => [ diff --git a/packages/typegen/src/generate/index.ts b/packages/typegen/src/generate/index.ts index 8623fc058a..8d96cf4df0 100644 --- a/packages/typegen/src/generate/index.ts +++ b/packages/typegen/src/generate/index.ts @@ -8,6 +8,6 @@ export { generateDefaultInterface } from './interfaceRegistry'; export { generateDefaultLookup } from './lookup'; export { generateDefaultQuery } from './query'; export { generateDefaultRpc } from './rpc'; -export { generateDefaultCalls } from './runtime'; +export { generateDefaultRuntime } from './runtime'; export { generateDefaultTsDef } from './tsDef'; export { generateDefaultTx } from './tx'; diff --git a/packages/typegen/src/generate/runtime.ts b/packages/typegen/src/generate/runtime.ts index e6d492488e..0058e78d99 100644 --- a/packages/typegen/src/generate/runtime.ts +++ b/packages/typegen/src/generate/runtime.ts @@ -2,7 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import type { Metadata } from '@polkadot/types/metadata/Metadata'; -import type { DefinitionCallNamed, Definitions } from '@polkadot/types/types'; +import type { DefinitionCallNamed, Definitions, Registry } from '@polkadot/types/types'; import type { HexString } from '@polkadot/util/types'; import type { ExtraTypes } from './types'; @@ -67,7 +67,7 @@ function getDefs (apis: Apis | null, defs: Record): Record< } /** @internal */ -export function generateCallTypes (meta: Metadata, dest: string, extraTypes: ExtraTypes, isStrict: boolean, customLookupDefinitions?: Definitions): void { +export function generateCallTypes (registry: Registry, meta: Metadata, dest: string, extraTypes: ExtraTypes, isStrict: boolean, customLookupDefinitions?: Definitions): void { writeFile(dest, (): string => { const allTypes: ExtraTypes = { '@polkadot/types-augment': { @@ -83,8 +83,7 @@ export function generateCallTypes (meta: Metadata, dest: string, extraTypes: Ext // find the system.Version in metadata let apis: Apis | null = null; - const { pallets, registry } = meta.asLatest; - const sysp = pallets.find(({ name }) => name.eq('System')); + const sysp = meta.asLatest.pallets.find(({ name }) => name.eq('System')); if (sysp) { const verc = sysp.constants.find(({ name }) => name.eq('Version')); @@ -163,10 +162,11 @@ export function generateCallTypes (meta: Metadata, dest: string, extraTypes: Ext }); } -export function generateDefaultCalls (dest: string, data: HexString, extraTypes: ExtraTypes = {}, isStrict = false, customLookupDefinitions?: Definitions): void { - const { metadata } = initMeta(data, extraTypes); +export function generateDefaultRuntime (dest: string, data: HexString, extraTypes: ExtraTypes = {}, isStrict = false, customLookupDefinitions?: Definitions): void { + const { metadata, registry } = initMeta(data, extraTypes); generateCallTypes( + registry, metadata, dest, extraTypes, diff --git a/packages/typegen/src/interfacesTs.ts b/packages/typegen/src/interfacesTs.ts index 7d72d12eaf..75ee201a5d 100644 --- a/packages/typegen/src/interfacesTs.ts +++ b/packages/typegen/src/interfacesTs.ts @@ -7,7 +7,7 @@ import kusama from '@polkadot/types-support/metadata/static-kusama'; import polkadot from '@polkadot/types-support/metadata/static-polkadot'; import substrate from '@polkadot/types-support/metadata/static-substrate'; -import { generateDefaultCalls, generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultInterface, generateDefaultLookup, generateDefaultQuery, generateDefaultRpc, generateDefaultTsDef, generateDefaultTx } from './generate'; +import { generateDefaultConsts, generateDefaultErrors, generateDefaultEvents, generateDefaultInterface, generateDefaultLookup, generateDefaultQuery, generateDefaultRpc, generateDefaultRuntime, generateDefaultTsDef, generateDefaultTx } from './generate'; const BASE = 'packages/api-augment/src'; const METAS = Object.entries({ kusama, polkadot, substrate }); @@ -26,7 +26,7 @@ export function main (): void { generateDefaultErrors(`${BASE}/${name}/errors.ts`, staticMeta); generateDefaultEvents(`${BASE}/${name}/events.ts`, staticMeta); generateDefaultQuery(`${BASE}/${name}/query.ts`, staticMeta); + generateDefaultRuntime(`${BASE}/${name}/runtime.ts`, staticMeta); generateDefaultTx(`${BASE}/${name}/tx.ts`, staticMeta); - generateDefaultCalls(`${BASE}/${name}/runtime.ts`, staticMeta); } } diff --git a/packages/types-augment/package.json b/packages/types-augment/package.json index 3ea88c5d5b..d3c9d4bb8b 100644 --- a/packages/types-augment/package.json +++ b/packages/types-augment/package.json @@ -20,12 +20,12 @@ "./detectPackage.cjs" ], "type": "module", - "version": "9.13.4", + "version": "9.13.5", "main": "index.js", "dependencies": { "@babel/runtime": "^7.20.13", - "@polkadot/types": "9.13.4", - "@polkadot/types-codec": "9.13.4", + "@polkadot/types": "9.13.5", + "@polkadot/types-codec": "9.13.5", "@polkadot/util": "^10.3.1" } } diff --git a/packages/types-codec/package.json b/packages/types-codec/package.json index c142e5344f..da7e662412 100644 --- a/packages/types-codec/package.json +++ b/packages/types-codec/package.json @@ -20,7 +20,7 @@ "./detectPackage.cjs" ], "type": "module", - "version": "9.13.4", + "version": "9.13.5", "main": "index.js", "dependencies": { "@babel/runtime": "^7.20.13", @@ -28,9 +28,9 @@ "@polkadot/x-bigint": "^10.3.1" }, "devDependencies": { - "@polkadot/types": "9.13.4", - "@polkadot/types-augment": "9.13.4", - "@polkadot/types-support": "9.13.4", + "@polkadot/types": "9.13.5", + "@polkadot/types-augment": "9.13.5", + "@polkadot/types-support": "9.13.5", "@polkadot/util-crypto": "^10.3.1" } } diff --git a/packages/types-create/package.json b/packages/types-create/package.json index 4f53bcedfb..2f57b702b3 100644 --- a/packages/types-create/package.json +++ b/packages/types-create/package.json @@ -20,14 +20,14 @@ "./detectPackage.cjs" ], "type": "module", - "version": "9.13.4", + "version": "9.13.5", "main": "index.js", "dependencies": { "@babel/runtime": "^7.20.13", - "@polkadot/types-codec": "9.13.4", + "@polkadot/types-codec": "9.13.5", "@polkadot/util": "^10.3.1" }, "devDependencies": { - "@polkadot/types": "9.13.4" + "@polkadot/types": "9.13.5" } } diff --git a/packages/types-known/package.json b/packages/types-known/package.json index 0ccf8ea0e2..d7a7182eee 100644 --- a/packages/types-known/package.json +++ b/packages/types-known/package.json @@ -20,17 +20,17 @@ "./detectPackage.cjs" ], "type": "module", - "version": "9.13.4", + "version": "9.13.5", "main": "index.js", "dependencies": { "@babel/runtime": "^7.20.13", "@polkadot/networks": "^10.3.1", - "@polkadot/types": "9.13.4", - "@polkadot/types-codec": "9.13.4", - "@polkadot/types-create": "9.13.4", + "@polkadot/types": "9.13.5", + "@polkadot/types-codec": "9.13.5", + "@polkadot/types-create": "9.13.5", "@polkadot/util": "^10.3.1" }, "devDependencies": { - "@polkadot/api": "9.13.4" + "@polkadot/api": "9.13.5" } } diff --git a/packages/types-support/package.json b/packages/types-support/package.json index 9232ebc1ae..2c59be9bb1 100644 --- a/packages/types-support/package.json +++ b/packages/types-support/package.json @@ -20,7 +20,7 @@ "./detectPackage.cjs" ], "type": "module", - "version": "9.13.4", + "version": "9.13.5", "main": "index.js", "dependencies": { "@babel/runtime": "^7.20.13", diff --git a/packages/types/package.json b/packages/types/package.json index e86d6b6dbb..f25ea72705 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -20,20 +20,20 @@ "./detectPackage.cjs" ], "type": "module", - "version": "9.13.4", + "version": "9.13.5", "main": "index.js", "dependencies": { "@babel/runtime": "^7.20.13", "@polkadot/keyring": "^10.3.1", - "@polkadot/types-augment": "9.13.4", - "@polkadot/types-codec": "9.13.4", - "@polkadot/types-create": "9.13.4", + "@polkadot/types-augment": "9.13.5", + "@polkadot/types-codec": "9.13.5", + "@polkadot/types-create": "9.13.5", "@polkadot/util": "^10.3.1", "@polkadot/util-crypto": "^10.3.1", "rxjs": "^7.8.0" }, "devDependencies": { "@polkadot/keyring": "^10.3.1", - "@polkadot/types-support": "9.13.4" + "@polkadot/types-support": "9.13.5" } } diff --git a/packages/types/src/create/registry.ts b/packages/types/src/create/registry.ts index 6fafc11082..9ff617e1c1 100644 --- a/packages/types/src/create/registry.ts +++ b/packages/types/src/create/registry.ts @@ -540,24 +540,28 @@ export class TypeRegistry implements Registry { // attach the lookup before we register any types this.setLookup(lookup); - // default to V1 - this includes 1.5 (with single field) - let weightType = 'WeightV1'; - const WeightV2 = this.get('SpWeightsWeightV2Weight'); + // we detect based on runtime configuration + let Weight: string | null = null; - // detection for WeightV2 type - if (WeightV2) { - const weight = new WeightV2(this); + if (this.hasType('SpWeightsWeightV2Weight')) { + // detection for WeightV2 type based on latest naming + const weightv2 = this.createType('SpWeightsWeightV2Weight'); - if (weight.refTime && weight.proofSize) { - weightType = 'SpWeightsWeightV2Weight'; - } - } - - if (weightType !== 'WeightV1' || !isBn(this.createType('Weight'))) { - // where we have an already-supplied override, we don't clobber + Weight = weightv2.refTime && weightv2.proofSize + // with both refTime & proofSize we use as-is (WeightV2) + ? 'SpWeightsWeightV2Weight' + // fallback to WeightV1 (WeightV1.5 is a struct, single field) + : 'WeightV1'; + } else if (!isBn(this.createType('Weight'))) { + // where we have an already-supplied BN override, we don't clobber // it with our detected value (This protects against pre-defines // where Weight may be aliassed to WeightV0, e.g. in early Kusama chains) - this.register({ Weight: weightType }); + Weight = 'WeightV1'; + } + + if (Weight) { + // we have detected a version, adjust the definition + this.register({ Weight }); } }; diff --git a/packages/types/src/metadata/PortableRegistry/PortableRegistry.ts b/packages/types/src/metadata/PortableRegistry/PortableRegistry.ts index c8686093cd..57b514dfdc 100644 --- a/packages/types/src/metadata/PortableRegistry/PortableRegistry.ts +++ b/packages/types/src/metadata/PortableRegistry/PortableRegistry.ts @@ -47,9 +47,8 @@ const PATHS_ALIAS = splitNamespace([ 'sp_core::crypto::AccountId32', 'sp_runtime::generic::era::Era', 'sp_runtime::multiaddress::MultiAddress', - // weights 2 (1.5+) is a structure, potentially can be flatenned + // weights 1.5+ is a structure can be flatenned 'frame_support::weights::weight_v2::Weight', - 'sp_weights::weight_v2::Weight', // ethereum overrides (Frontier, Moonbeam, Polkadot claims) 'account::AccountId20', 'polkadot_runtime_common::claims::EthereumAddress', @@ -152,12 +151,7 @@ function matchParts (first: string[], second: (string | Text)[]): boolean { } /** @internal check if the path matches the PATHS_ALIAS (with wildcards) */ -function getAliasPath ({ def, path }: SiType): string | null { - // specific logic for weights - we only override when non-complex struct - if (path.join('::') === 'sp_weights::weight_v2::Weight' && def.isComposite && def.asComposite.fields.length !== 1) { - return null; - } - +function getAliasPath ({ path }: SiType): string | null { // TODO We need to handle ink! Balance in some way return path.length && PATHS_ALIAS.some((a) => matchParts(a, path)) ? path[path.length - 1].toString() diff --git a/yarn.lock b/yarn.lock index b1ca1e3ae4..b099e1efdd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1988,27 +1988,27 @@ __metadata: languageName: node linkType: hard -"@polkadot/api-augment@9.13.4, @polkadot/api-augment@workspace:packages/api-augment": +"@polkadot/api-augment@9.13.5, @polkadot/api-augment@workspace:packages/api-augment": version: 0.0.0-use.local resolution: "@polkadot/api-augment@workspace:packages/api-augment" dependencies: "@babel/runtime": ^7.20.13 - "@polkadot/api-base": 9.13.4 - "@polkadot/rpc-augment": 9.13.4 - "@polkadot/types": 9.13.4 - "@polkadot/types-augment": 9.13.4 - "@polkadot/types-codec": 9.13.4 + "@polkadot/api-base": 9.13.5 + "@polkadot/rpc-augment": 9.13.5 + "@polkadot/types": 9.13.5 + "@polkadot/types-augment": 9.13.5 + "@polkadot/types-codec": 9.13.5 "@polkadot/util": ^10.3.1 languageName: unknown linkType: soft -"@polkadot/api-base@9.13.4, @polkadot/api-base@workspace:packages/api-base": +"@polkadot/api-base@9.13.5, @polkadot/api-base@workspace:packages/api-base": version: 0.0.0-use.local resolution: "@polkadot/api-base@workspace:packages/api-base" dependencies: "@babel/runtime": ^7.20.13 - "@polkadot/rpc-core": 9.13.4 - "@polkadot/types": 9.13.4 + "@polkadot/rpc-core": 9.13.5 + "@polkadot/types": 9.13.5 "@polkadot/util": ^10.3.1 rxjs: ^7.8.0 languageName: unknown @@ -2019,56 +2019,56 @@ __metadata: resolution: "@polkadot/api-contract@workspace:packages/api-contract" dependencies: "@babel/runtime": ^7.20.13 - "@polkadot/api": 9.13.4 - "@polkadot/api-augment": 9.13.4 + "@polkadot/api": 9.13.5 + "@polkadot/api-augment": 9.13.5 "@polkadot/keyring": ^10.3.1 - "@polkadot/types": 9.13.4 - "@polkadot/types-codec": 9.13.4 - "@polkadot/types-create": 9.13.4 + "@polkadot/types": 9.13.5 + "@polkadot/types-codec": 9.13.5 + "@polkadot/types-create": 9.13.5 "@polkadot/util": ^10.3.1 "@polkadot/util-crypto": ^10.3.1 rxjs: ^7.8.0 languageName: unknown linkType: soft -"@polkadot/api-derive@9.13.4, @polkadot/api-derive@workspace:packages/api-derive": +"@polkadot/api-derive@9.13.5, @polkadot/api-derive@workspace:packages/api-derive": version: 0.0.0-use.local resolution: "@polkadot/api-derive@workspace:packages/api-derive" dependencies: "@babel/runtime": ^7.20.13 - "@polkadot/api": 9.13.4 - "@polkadot/api-augment": 9.13.4 - "@polkadot/api-base": 9.13.4 - "@polkadot/rpc-augment": 9.13.4 - "@polkadot/rpc-core": 9.13.4 - "@polkadot/rpc-provider": 9.13.4 - "@polkadot/types": 9.13.4 - "@polkadot/types-codec": 9.13.4 - "@polkadot/types-support": 9.13.4 + "@polkadot/api": 9.13.5 + "@polkadot/api-augment": 9.13.5 + "@polkadot/api-base": 9.13.5 + "@polkadot/rpc-augment": 9.13.5 + "@polkadot/rpc-core": 9.13.5 + "@polkadot/rpc-provider": 9.13.5 + "@polkadot/types": 9.13.5 + "@polkadot/types-codec": 9.13.5 + "@polkadot/types-support": 9.13.5 "@polkadot/util": ^10.3.1 "@polkadot/util-crypto": ^10.3.1 rxjs: ^7.8.0 languageName: unknown linkType: soft -"@polkadot/api@9.13.4, @polkadot/api@workspace:packages/api": +"@polkadot/api@9.13.5, @polkadot/api@workspace:packages/api": version: 0.0.0-use.local resolution: "@polkadot/api@workspace:packages/api" dependencies: "@babel/runtime": ^7.20.13 - "@polkadot/api-augment": 9.13.4 - "@polkadot/api-base": 9.13.4 - "@polkadot/api-derive": 9.13.4 + "@polkadot/api-augment": 9.13.5 + "@polkadot/api-base": 9.13.5 + "@polkadot/api-derive": 9.13.5 "@polkadot/keyring": ^10.3.1 - "@polkadot/rpc-augment": 9.13.4 - "@polkadot/rpc-core": 9.13.4 - "@polkadot/rpc-provider": 9.13.4 - "@polkadot/types": 9.13.4 - "@polkadot/types-augment": 9.13.4 - "@polkadot/types-codec": 9.13.4 - "@polkadot/types-create": 9.13.4 - "@polkadot/types-known": 9.13.4 - "@polkadot/types-support": 9.13.4 + "@polkadot/rpc-augment": 9.13.5 + "@polkadot/rpc-core": 9.13.5 + "@polkadot/rpc-provider": 9.13.5 + "@polkadot/types": 9.13.5 + "@polkadot/types-augment": 9.13.5 + "@polkadot/types-codec": 9.13.5 + "@polkadot/types-create": 9.13.5 + "@polkadot/types-known": 9.13.5 + "@polkadot/types-support": 9.13.5 "@polkadot/util": ^10.3.1 "@polkadot/util-crypto": ^10.3.1 eventemitter3: ^5.0.0 @@ -2200,40 +2200,40 @@ __metadata: languageName: node linkType: hard -"@polkadot/rpc-augment@9.13.4, @polkadot/rpc-augment@workspace:packages/rpc-augment": +"@polkadot/rpc-augment@9.13.5, @polkadot/rpc-augment@workspace:packages/rpc-augment": version: 0.0.0-use.local resolution: "@polkadot/rpc-augment@workspace:packages/rpc-augment" dependencies: "@babel/runtime": ^7.20.13 - "@polkadot/rpc-core": 9.13.4 - "@polkadot/types": 9.13.4 - "@polkadot/types-codec": 9.13.4 + "@polkadot/rpc-core": 9.13.5 + "@polkadot/types": 9.13.5 + "@polkadot/types-codec": 9.13.5 "@polkadot/util": ^10.3.1 languageName: unknown linkType: soft -"@polkadot/rpc-core@9.13.4, @polkadot/rpc-core@workspace:packages/rpc-core": +"@polkadot/rpc-core@9.13.5, @polkadot/rpc-core@workspace:packages/rpc-core": version: 0.0.0-use.local resolution: "@polkadot/rpc-core@workspace:packages/rpc-core" dependencies: "@babel/runtime": ^7.20.13 "@polkadot/keyring": ^10.3.1 - "@polkadot/rpc-augment": 9.13.4 - "@polkadot/rpc-provider": 9.13.4 - "@polkadot/types": 9.13.4 + "@polkadot/rpc-augment": 9.13.5 + "@polkadot/rpc-provider": 9.13.5 + "@polkadot/types": 9.13.5 "@polkadot/util": ^10.3.1 rxjs: ^7.8.0 languageName: unknown linkType: soft -"@polkadot/rpc-provider@9.13.4, @polkadot/rpc-provider@workspace:packages/rpc-provider": +"@polkadot/rpc-provider@9.13.5, @polkadot/rpc-provider@workspace:packages/rpc-provider": version: 0.0.0-use.local resolution: "@polkadot/rpc-provider@workspace:packages/rpc-provider" dependencies: "@babel/runtime": ^7.20.13 "@polkadot/keyring": ^10.3.1 - "@polkadot/types": 9.13.4 - "@polkadot/types-support": 9.13.4 + "@polkadot/types": 9.13.5 + "@polkadot/types-support": 9.13.5 "@polkadot/util": ^10.3.1 "@polkadot/util-crypto": ^10.3.1 "@polkadot/x-fetch": ^10.3.1 @@ -2256,15 +2256,15 @@ __metadata: "@babel/core": ^7.20.12 "@babel/register": ^7.18.9 "@babel/runtime": ^7.20.13 - "@polkadot/api": 9.13.4 - "@polkadot/api-augment": 9.13.4 - "@polkadot/rpc-augment": 9.13.4 - "@polkadot/rpc-provider": 9.13.4 - "@polkadot/types": 9.13.4 - "@polkadot/types-augment": 9.13.4 - "@polkadot/types-codec": 9.13.4 - "@polkadot/types-create": 9.13.4 - "@polkadot/types-support": 9.13.4 + "@polkadot/api": 9.13.5 + "@polkadot/api-augment": 9.13.5 + "@polkadot/rpc-augment": 9.13.5 + "@polkadot/rpc-provider": 9.13.5 + "@polkadot/types": 9.13.5 + "@polkadot/types-augment": 9.13.5 + "@polkadot/types-codec": 9.13.5 + "@polkadot/types-create": 9.13.5 + "@polkadot/types-support": 9.13.5 "@polkadot/util": ^10.3.1 "@polkadot/util-crypto": ^10.3.1 "@polkadot/x-ws": ^10.3.1 @@ -2282,57 +2282,57 @@ __metadata: languageName: unknown linkType: soft -"@polkadot/types-augment@9.13.4, @polkadot/types-augment@workspace:packages/types-augment": +"@polkadot/types-augment@9.13.5, @polkadot/types-augment@workspace:packages/types-augment": version: 0.0.0-use.local resolution: "@polkadot/types-augment@workspace:packages/types-augment" dependencies: "@babel/runtime": ^7.20.13 - "@polkadot/types": 9.13.4 - "@polkadot/types-codec": 9.13.4 + "@polkadot/types": 9.13.5 + "@polkadot/types-codec": 9.13.5 "@polkadot/util": ^10.3.1 languageName: unknown linkType: soft -"@polkadot/types-codec@9.13.4, @polkadot/types-codec@workspace:packages/types-codec": +"@polkadot/types-codec@9.13.5, @polkadot/types-codec@workspace:packages/types-codec": version: 0.0.0-use.local resolution: "@polkadot/types-codec@workspace:packages/types-codec" dependencies: "@babel/runtime": ^7.20.13 - "@polkadot/types": 9.13.4 - "@polkadot/types-augment": 9.13.4 - "@polkadot/types-support": 9.13.4 + "@polkadot/types": 9.13.5 + "@polkadot/types-augment": 9.13.5 + "@polkadot/types-support": 9.13.5 "@polkadot/util": ^10.3.1 "@polkadot/util-crypto": ^10.3.1 "@polkadot/x-bigint": ^10.3.1 languageName: unknown linkType: soft -"@polkadot/types-create@9.13.4, @polkadot/types-create@workspace:packages/types-create": +"@polkadot/types-create@9.13.5, @polkadot/types-create@workspace:packages/types-create": version: 0.0.0-use.local resolution: "@polkadot/types-create@workspace:packages/types-create" dependencies: "@babel/runtime": ^7.20.13 - "@polkadot/types": 9.13.4 - "@polkadot/types-codec": 9.13.4 + "@polkadot/types": 9.13.5 + "@polkadot/types-codec": 9.13.5 "@polkadot/util": ^10.3.1 languageName: unknown linkType: soft -"@polkadot/types-known@9.13.4, @polkadot/types-known@workspace:packages/types-known": +"@polkadot/types-known@9.13.5, @polkadot/types-known@workspace:packages/types-known": version: 0.0.0-use.local resolution: "@polkadot/types-known@workspace:packages/types-known" dependencies: "@babel/runtime": ^7.20.13 - "@polkadot/api": 9.13.4 + "@polkadot/api": 9.13.5 "@polkadot/networks": ^10.3.1 - "@polkadot/types": 9.13.4 - "@polkadot/types-codec": 9.13.4 - "@polkadot/types-create": 9.13.4 + "@polkadot/types": 9.13.5 + "@polkadot/types-codec": 9.13.5 + "@polkadot/types-create": 9.13.5 "@polkadot/util": ^10.3.1 languageName: unknown linkType: soft -"@polkadot/types-support@9.13.4, @polkadot/types-support@workspace:packages/types-support": +"@polkadot/types-support@9.13.5, @polkadot/types-support@workspace:packages/types-support": version: 0.0.0-use.local resolution: "@polkadot/types-support@workspace:packages/types-support" dependencies: @@ -2341,16 +2341,16 @@ __metadata: languageName: unknown linkType: soft -"@polkadot/types@9.13.4, @polkadot/types@workspace:packages/types": +"@polkadot/types@9.13.5, @polkadot/types@workspace:packages/types": version: 0.0.0-use.local resolution: "@polkadot/types@workspace:packages/types" dependencies: "@babel/runtime": ^7.20.13 "@polkadot/keyring": ^10.3.1 - "@polkadot/types-augment": 9.13.4 - "@polkadot/types-codec": 9.13.4 - "@polkadot/types-create": 9.13.4 - "@polkadot/types-support": 9.13.4 + "@polkadot/types-augment": 9.13.5 + "@polkadot/types-codec": 9.13.5 + "@polkadot/types-create": 9.13.5 + "@polkadot/types-support": 9.13.5 "@polkadot/util": ^10.3.1 "@polkadot/util-crypto": ^10.3.1 rxjs: ^7.8.0