From cac8f0601ca7bd12c14fadd96ccd2426a197dd38 Mon Sep 17 00:00:00 2001 From: Arjun Porwal Date: Fri, 14 Nov 2025 14:09:08 +0530 Subject: [PATCH] fix: initialize all createType and createTypeUnsafe with some default values --- packages/api-derive/src/balances/account.ts | 6 +++--- packages/api-derive/src/balances/all.ts | 6 +++--- packages/api-derive/src/contracts/fees.ts | 20 +++++++++---------- packages/api-derive/src/council/votes.ts | 2 +- packages/api-derive/src/council/votesOf.ts | 2 +- .../src/crowdloan/ownContributions.ts | 2 +- .../src/democracy/referendumsInfo.ts | 4 ++-- packages/api-derive/src/elections/info.ts | 2 +- packages/api-derive/src/session/indexes.ts | 16 +++++++-------- packages/api-derive/src/session/progress.ts | 4 ++-- .../api-derive/src/staking/ownExposure.ts | 6 +++--- packages/api-derive/src/staking/query.ts | 14 ++++++------- .../api-derive/src/staking/stakerPoints.ts | 2 +- .../api-derive/src/staking/stakerRewards.ts | 2 +- .../api-derive/src/staking/stakerSlashes.ts | 2 +- packages/api-derive/src/test/bountyFactory.ts | 2 +- packages/api-derive/src/treasury/proposals.ts | 2 +- packages/rpc-provider/src/mock/index.ts | 4 ++-- packages/types/src/create/registry.ts | 4 ++-- .../types/src/extrinsic/ExtrinsicPayload.ts | 8 ++++---- .../src/extrinsic/v4/ExtrinsicPayload.ts | 2 +- packages/types/src/generic/ChainProperties.ts | 6 +++--- packages/types/src/metadata/v15/toV16.ts | 6 +++--- 23 files changed, 62 insertions(+), 62 deletions(-) diff --git a/packages/api-derive/src/balances/account.ts b/packages/api-derive/src/balances/account.ts index 86957667d18..5bbf23789bb 100644 --- a/packages/api-derive/src/balances/account.ts +++ b/packages/api-derive/src/balances/account.ts @@ -25,7 +25,7 @@ type DeriveCustomAccount = DeriveApi['derive'] & Record function zeroBalance (api: DeriveApi) { - return api.registry.createType('Balance'); + return api.registry.createType('Balance', 0); } function getBalance (api: DeriveApi, [freeBalance, reservedBalance, frozenFeeOrFrozen, frozenMiscOrFlags]: BalanceResult, accType: AccountType): DeriveBalancesAccountData { @@ -92,7 +92,7 @@ function queryNonceOnly (api: DeriveApi, accountId: AccountId): Observable(accountId).pipe( map((nonce) => fill(nonce)) ) - : of(fill(api.registry.createType('Index'))); + : of(fill(api.registry.createType('Index', 0))); } function queryBalancesAccount (api: DeriveApi, accountId: AccountId, modules: string[] = ['balances']): Observable { @@ -199,7 +199,7 @@ export function account (instanceId: string, api: DeriveApi): (address: AccountI : queryNonceOnly(api, accountId) ]) : of([api.registry.createType('AccountId'), [ - api.registry.createType('Index'), + api.registry.createType('Index', 0), [[zeroBalance(api), zeroBalance(api), zeroBalance(api), zeroBalance(api)]], { isFrameAccountData: false } ]]) diff --git a/packages/api-derive/src/balances/all.ts b/packages/api-derive/src/balances/all.ts index 2888babe102..b99f1f9f511 100644 --- a/packages/api-derive/src/balances/all.ts +++ b/packages/api-derive/src/balances/all.ts @@ -30,9 +30,9 @@ type DeriveCustomLocks = DeriveApi['derive'] & Record')), + : of(api.registry.createType('Option', null)), lockQueries.length ? combineLatest(lockQueries.map((c) => c(accountId))) : of([] as Vec[]), diff --git a/packages/api-derive/src/contracts/fees.ts b/packages/api-derive/src/contracts/fees.ts index f03e7671df4..ce19817c892 100644 --- a/packages/api-derive/src/contracts/fees.ts +++ b/packages/api-derive/src/contracts/fees.ts @@ -15,18 +15,18 @@ type ResultV2 = [BN, BN, BN, BN, BN, BN, BN, BN, BN, BN]; function queryConstants (api: DeriveApi): Observable { return of([ // deprecated - api.consts.contracts['callBaseFee'] || api.registry.createType('Balance'), - api.consts.contracts['contractFee'] || api.registry.createType('Balance'), - api.consts.contracts['creationFee'] || api.registry.createType('Balance'), - api.consts.contracts['transactionBaseFee'] || api.registry.createType('Balance'), - api.consts.contracts['transactionByteFee'] || api.registry.createType('Balance'), - api.consts.contracts['transferFee'] || api.registry.createType('Balance'), + api.consts.contracts['callBaseFee'] || api.registry.createType('Balance', 0), + api.consts.contracts['contractFee'] || api.registry.createType('Balance', 0), + api.consts.contracts['creationFee'] || api.registry.createType('Balance', 0), + api.consts.contracts['transactionBaseFee'] || api.registry.createType('Balance', 0), + api.consts.contracts['transactionByteFee'] || api.registry.createType('Balance', 0), + api.consts.contracts['transferFee'] || api.registry.createType('Balance', 0), // current - api.consts.contracts['rentByteFee'] || api.registry.createType('Balance'), - api.consts.contracts['rentDepositOffset'] || api.registry.createType('Balance'), - api.consts.contracts['surchargeReward'] || api.registry.createType('Balance'), - api.consts.contracts['tombstoneDeposit'] || api.registry.createType('Balance') + api.consts.contracts['rentByteFee'] || api.registry.createType('Balance', 0), + api.consts.contracts['rentDepositOffset'] || api.registry.createType('Balance', 0), + api.consts.contracts['surchargeReward'] || api.registry.createType('Balance', 0), + api.consts.contracts['tombstoneDeposit'] || api.registry.createType('Balance, 0') ]) as unknown as Observable; } diff --git a/packages/api-derive/src/council/votes.ts b/packages/api-derive/src/council/votes.ts index 3a192e08357..b44b9f1aecf 100644 --- a/packages/api-derive/src/council/votes.ts +++ b/packages/api-derive/src/council/votes.ts @@ -45,7 +45,7 @@ function retrievePrev (api: DeriveApi, elections: DeriveApi['query']['elections' const result: DeriveCouncilVotes = []; votes.forEach(([voter, votes]): void => { - result.push([voter, { stake: api.registry.createType('Balance'), votes }]); + result.push([voter, { stake: api.registry.createType('Balance', 0), votes }]); }); stakes.forEach(([staker, stake]): void => { diff --git a/packages/api-derive/src/council/votesOf.ts b/packages/api-derive/src/council/votesOf.ts index 9b819a0491d..8d3dc23753e 100644 --- a/packages/api-derive/src/council/votesOf.ts +++ b/packages/api-derive/src/council/votesOf.ts @@ -27,7 +27,7 @@ export function votesOf (instanceId: string, api: DeriveApi): (accountId: string map((votes): DeriveCouncilVote => ( votes.find(([from]) => from.eq(accountId)) || - [null, { stake: api.registry.createType('Balance'), votes: [] as AccountId[] }] + [null, { stake: api.registry.createType('Balance', 0), votes: [] as AccountId[] }] )[1] ) ) diff --git a/packages/api-derive/src/crowdloan/ownContributions.ts b/packages/api-derive/src/crowdloan/ownContributions.ts index b4f55b6b7ae..9e982aabb39 100644 --- a/packages/api-derive/src/crowdloan/ownContributions.ts +++ b/packages/api-derive/src/crowdloan/ownContributions.ts @@ -21,7 +21,7 @@ function _getValues (api: DeriveApi, childKey: string, keys: string[]): Observab .map((o) => o.isSome ? api.registry.createType('Balance', o.unwrap()) - : api.registry.createType('Balance') + : api.registry.createType('Balance', 0) ) .reduce((all: DeriveOwnContributions, b, index): DeriveOwnContributions => objectSpread(all, { [keys[index]]: b }), {}) diff --git a/packages/api-derive/src/democracy/referendumsInfo.ts b/packages/api-derive/src/democracy/referendumsInfo.ts index f83e481b036..b80903b7c44 100644 --- a/packages/api-derive/src/democracy/referendumsInfo.ts +++ b/packages/api-derive/src/democracy/referendumsInfo.ts @@ -37,9 +37,9 @@ function votesPrev (api: DeriveApi, referendumId: BN): Observable votersFor.map((accountId, index): DeriveReferendumVote => ({ accountId, - balance: balances[index].votingBalance || api.registry.createType('Balance'), + balance: balances[index].votingBalance || api.registry.createType('Balance', 0), isDelegating: false, - vote: votes[index] || api.registry.createType('Vote') + vote: votes[index] || api.registry.createType('Vote', {}) })) ) ); diff --git a/packages/api-derive/src/elections/info.ts b/packages/api-derive/src/elections/info.ts index 13be1023c58..bbda61ecd6c 100644 --- a/packages/api-derive/src/elections/info.ts +++ b/packages/api-derive/src/elections/info.ts @@ -117,7 +117,7 @@ export function info (instanceId: string, api: DeriveApi): () => Observable [a, api.registry.createType('Balance')]), + : councilMembers.map((a): [AccountId32, Balance] => [a, api.registry.createType('Balance', 0)]), runnersUp: runnersUp.map(getAccountTuple).sort(sortAccounts) }) ) diff --git a/packages/api-derive/src/session/indexes.ts b/packages/api-derive/src/session/indexes.ts index 6aff51fe8a8..3cf4c2f85a0 100644 --- a/packages/api-derive/src/session/indexes.ts +++ b/packages/api-derive/src/session/indexes.ts @@ -48,10 +48,10 @@ function querySession (api: DeriveApi): Observable { return api.query.session.currentIndex().pipe( map((currentIndex): DeriveSessionIndexes => parse([ currentIndex, - api.registry.createType('EraIndex'), - api.registry.createType('Option'), - api.registry.createType('EraIndex'), - api.registry.createType('u32') + api.registry.createType('EraIndex', 0), + api.registry.createType('Option', null), + api.registry.createType('EraIndex', 0), + api.registry.createType('u32', 0) ])) ); } @@ -60,10 +60,10 @@ function querySession (api: DeriveApi): Observable { function empty (api: DeriveApi): Observable { return of(parse([ api.registry.createType('SessionIndex', 1), - api.registry.createType('EraIndex'), - api.registry.createType('Option'), - api.registry.createType('EraIndex'), - api.registry.createType('u32') + api.registry.createType('EraIndex', 0), + api.registry.createType('Option', null), + api.registry.createType('EraIndex', 0), + api.registry.createType('u32', 0) ])); } diff --git a/packages/api-derive/src/session/progress.ts b/packages/api-derive/src/session/progress.ts index 60280b98933..bcd68b8381b 100644 --- a/packages/api-derive/src/session/progress.ts +++ b/packages/api-derive/src/session/progress.ts @@ -40,8 +40,8 @@ function queryAura (api: DeriveApi): Observable { return api.derive.session.info().pipe( map((info): DeriveSessionProgress => objectSpread({ - eraProgress: api.registry.createType('BlockNumber'), - sessionProgress: api.registry.createType('BlockNumber') + eraProgress: api.registry.createType('BlockNumber', 0), + sessionProgress: api.registry.createType('BlockNumber', 0) }, info) ) ); diff --git a/packages/api-derive/src/staking/ownExposure.ts b/packages/api-derive/src/staking/ownExposure.ts index 61fabe8a214..5a176abca31 100644 --- a/packages/api-derive/src/staking/ownExposure.ts +++ b/packages/api-derive/src/staking/ownExposure.ts @@ -15,11 +15,11 @@ import { erasHistoricApplyAccount } from './util.js'; export function _ownExposures (instanceId: string, api: DeriveApi): (accountId: Uint8Array | string, eras: EraIndex[], withActive: boolean, page: u32 | AnyNumber) => Observable { return memo(instanceId, (accountId: Uint8Array | string, eras: EraIndex[], _withActive: boolean, page: u32 | AnyNumber): Observable => { - const emptyStakingExposure = api.registry.createType('Exposure'); + const emptyStakingExposure = api.registry.createType('Exposure', {}); // The reason we don't explicitly make the actual types is for compatibility. If the chain doesn't have the noted type it will fail // on construction. Therefore we just make an empty option. - const emptyOptionPage = api.registry.createType>('Option'); - const emptyOptionMeta = api.registry.createType>('Option'); + const emptyOptionPage = api.registry.createType>('Option', null); + const emptyOptionMeta = api.registry.createType>('Option', null); return eras.length ? combineLatest([ diff --git a/packages/api-derive/src/staking/query.ts b/packages/api-derive/src/staking/query.ts index e97fb068202..896ddc8127d 100644 --- a/packages/api-derive/src/staking/query.ts +++ b/packages/api-derive/src/staking/query.ts @@ -98,7 +98,7 @@ function getLedgers (api: DeriveApi, optIds: (Option | null)[], { wit const ids = optIds .filter((o): o is Option => withLedger && !!o && o.isSome) .map((o) => o.unwrap()); - const emptyLed = api.registry.createType>('Option'); + const emptyLed = api.registry.createType>('Option', null); return ( ids.length @@ -118,14 +118,14 @@ function getLedgers (api: DeriveApi, optIds: (Option | null)[], { wit } function getStashInfo (api: DeriveApi, stashIds: AccountId[], activeEra: EraIndex, { withClaimedRewardsEras, withController, withDestination, withExposure, withExposureErasStakersLegacy, withExposureMeta, withLedger, withNominations, withPrefs }: StakingQueryFlags, page: u32 | AnyNumber): Observable<[(Option | null)[], Option[], Option[], PalletStakingValidatorPrefs[], Option[], Option[], number[][], SpStakingExposure[]]> { - const emptyNoms = api.registry.createType>('Option'); - const emptyRewa = api.registry.createType>('RewardDestination'); - const emptyExpoEraStakers = api.registry.createType('Exposure'); - const emptyPrefs = api.registry.createType('ValidatorPrefs'); + const emptyNoms = api.registry.createType>('Option', null); + const emptyRewa = api.registry.createType>('RewardDestination', null); + const emptyExpoEraStakers = api.registry.createType('Exposure', {}); + const emptyPrefs = api.registry.createType('ValidatorPrefs', {}); // The reason we don't explicitly make the actual types is for compatibility. If the chain doesn't have the noted type it will fail // on construction. Therefore we just make an empty option. - const emptyExpo = api.registry.createType>('Option'); - const emptyExpoMeta = api.registry.createType>('Option'); + const emptyExpo = api.registry.createType>('Option', null); + const emptyExpoMeta = api.registry.createType>('Option', null); const emptyClaimedRewards = [-1]; const depth = Number(api.consts.staking.historyDepth.toNumber()); diff --git a/packages/api-derive/src/staking/stakerPoints.ts b/packages/api-derive/src/staking/stakerPoints.ts index 52c91cfde2d..331bb1a1c12 100644 --- a/packages/api-derive/src/staking/stakerPoints.ts +++ b/packages/api-derive/src/staking/stakerPoints.ts @@ -19,7 +19,7 @@ export function _stakerPoints (instanceId: string, api: DeriveApi): (accountId: points.map(({ era, eraPoints, validators }): DeriveStakerPoints => ({ era, eraPoints, - points: validators[stakerId] || api.registry.createType('RewardPoint') + points: validators[stakerId] || api.registry.createType('RewardPoint', 0) })) ) ); diff --git a/packages/api-derive/src/staking/stakerRewards.ts b/packages/api-derive/src/staking/stakerRewards.ts index 3ceaee749b4..aac3206f2a5 100644 --- a/packages/api-derive/src/staking/stakerRewards.ts +++ b/packages/api-derive/src/staking/stakerRewards.ts @@ -32,7 +32,7 @@ function extractCompatRewards (claimedRewardsEras: Vec, ledger?: PalletStak function parseRewards (api: DeriveApi, stashId: AccountId, [erasPoints, erasPrefs, erasRewards]: ErasResult, exposures: DeriveStakerExposure[], claimedRewardsEras: Vec): DeriveStakerReward[] { return exposures.map(({ era, isEmpty, isValidator, nominating, validators: eraValidators }): DeriveStakerReward => { const { eraPoints, validators: allValPoints } = erasPoints.find((p) => p.era.eq(era)) || { eraPoints: BN_ZERO, validators: {} as DeriveEraValPoints }; - const { eraReward } = erasRewards.find((r) => r.era.eq(era)) || { eraReward: api.registry.createType('Balance') }; + const { eraReward } = erasRewards.find((r) => r.era.eq(era)) || { eraReward: api.registry.createType('Balance', 0) }; const { validators: allValPrefs } = erasPrefs.find((p) => p.era.eq(era)) || { validators: {} as DeriveEraValPrefs }; const validators: Record = {}; const stakerId = stashId.toString(); diff --git a/packages/api-derive/src/staking/stakerSlashes.ts b/packages/api-derive/src/staking/stakerSlashes.ts index 383ed9563a5..568422e6e68 100644 --- a/packages/api-derive/src/staking/stakerSlashes.ts +++ b/packages/api-derive/src/staking/stakerSlashes.ts @@ -18,7 +18,7 @@ export function _stakerSlashes (instanceId: string, api: DeriveApi): (accountId: map((slashes): DeriveStakerSlashes[] => slashes.map(({ era, nominators, validators }): DeriveStakerSlashes => ({ era, - total: nominators[stakerId] || validators[stakerId] || api.registry.createType('Balance') + total: nominators[stakerId] || validators[stakerId] || api.registry.createType('Balance', 0) })) ) ); diff --git a/packages/api-derive/src/test/bountyFactory.ts b/packages/api-derive/src/test/bountyFactory.ts index 30b214ee757..8cc6f4253ed 100644 --- a/packages/api-derive/src/test/bountyFactory.ts +++ b/packages/api-derive/src/test/bountyFactory.ts @@ -26,7 +26,7 @@ export class BountyFactory { this.#registry.createType('BountyIndex', index); public defaultBounty = (): Bounty => - this.#registry.createType('Bounty'); + this.#registry.createType('Bounty', {}); public optionOf = (value: T): Option => { const typeName = this.#registry.getClassName(value.constructor as CodecClass); diff --git a/packages/api-derive/src/treasury/proposals.ts b/packages/api-derive/src/treasury/proposals.ts index 736a09ca411..513b01494a6 100644 --- a/packages/api-derive/src/treasury/proposals.ts +++ b/packages/api-derive/src/treasury/proposals.ts @@ -102,7 +102,7 @@ export function proposals (instanceId: string, api: DeriveApi): () => Observable ) : of({ approvals: [], - proposalCount: api.registry.createType('ProposalIndex'), + proposalCount: api.registry.createType('ProposalIndex', 0), proposals: [] } as DeriveTreasuryProposals) ); diff --git a/packages/rpc-provider/src/mock/index.ts b/packages/rpc-provider/src/mock/index.ts index 7d048aaa764..f7869d35eed 100644 --- a/packages/rpc-provider/src/mock/index.ts +++ b/packages/rpc-provider/src/mock/index.ts @@ -60,11 +60,11 @@ export class MockProvider implements ProviderInterface { chain_getFinalizedHead: () => this.registry.createType('Header', rpcHeader.result).hash, // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access chain_getHeader: () => this.registry.createType('Header', rpcHeader.result).toJSON(), - rpc_methods: () => this.registry.createType('RpcMethods').toJSON(), + rpc_methods: () => this.registry.createType('RpcMethods', {}).toJSON(), state_getKeys: () => [], state_getKeysPaged: () => [], state_getMetadata: () => rpcMetadata, - state_getRuntimeVersion: () => this.registry.createType('RuntimeVersion').toHex(), + state_getRuntimeVersion: () => this.registry.createType('RuntimeVersion', {}).toHex(), state_getStorage: (storage: MockStateDb, [key]: string[]) => u8aToHex(storage[key]), system_chain: () => 'mockChain', system_health: () => ({}), diff --git a/packages/types/src/create/registry.ts b/packages/types/src/create/registry.ts index f2d99a98c33..522b3739006 100644 --- a/packages/types/src/create/registry.ts +++ b/packages/types/src/create/registry.ts @@ -556,14 +556,14 @@ export class TypeRegistry implements Registry { if (this.hasType('SpWeightsWeightV2Weight')) { // detection for WeightV2 type based on latest naming - const weightv2 = this.createType('SpWeightsWeightV2Weight'); + const weightv2 = this.createType('SpWeightsWeightV2Weight', {}); 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'))) { + } 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) diff --git a/packages/types/src/extrinsic/ExtrinsicPayload.ts b/packages/types/src/extrinsic/ExtrinsicPayload.ts index 0542ed5b9f0..b99d1cd6b3a 100644 --- a/packages/types/src/extrinsic/ExtrinsicPayload.ts +++ b/packages/types/src/extrinsic/ExtrinsicPayload.ts @@ -108,7 +108,7 @@ export class GenericExtrinsicPayload extends AbstractBase { */ public get genesisHash (): BlockHash { // NOTE only v3+ - return this.inner.genesisHash || this.registry.createTypeUnsafe('Hash', []); + return this.inner.genesisHash || this.registry.createTypeUnsafe('Hash', [new Uint8Array(256)]); } /** @@ -130,7 +130,7 @@ export class GenericExtrinsicPayload extends AbstractBase { */ public get specVersion (): INumber { // NOTE only v3+ - return this.inner.specVersion || this.registry.createTypeUnsafe('u32', []); + return this.inner.specVersion || this.registry.createTypeUnsafe('u32', [0]); } /** @@ -138,7 +138,7 @@ export class GenericExtrinsicPayload extends AbstractBase { */ public get tip (): ICompact { // NOTE from v2+ - return this.inner.tip || this.registry.createTypeUnsafe('Compact', []); + return this.inner.tip || this.registry.createTypeUnsafe('Compact', [0]); } /** @@ -146,7 +146,7 @@ export class GenericExtrinsicPayload extends AbstractBase { */ public get transactionVersion (): INumber { // NOTE only v4+ - return this.inner.transactionVersion || this.registry.createTypeUnsafe('u32', []); + return this.inner.transactionVersion || this.registry.createTypeUnsafe('u32', [0]); } /** diff --git a/packages/types/src/extrinsic/v4/ExtrinsicPayload.ts b/packages/types/src/extrinsic/v4/ExtrinsicPayload.ts index b54ef990ec3..b3f138ce07c 100644 --- a/packages/types/src/extrinsic/v4/ExtrinsicPayload.ts +++ b/packages/types/src/extrinsic/v4/ExtrinsicPayload.ts @@ -36,7 +36,7 @@ export class GenericExtrinsicPayloadV4 extends Struct { // this is an enum, in the case of AnySignature, this is a Hash only // (which may be 64 or 65 bytes) this.#signOptions = { - withType: registry.createTypeUnsafe('ExtrinsicSignature', []) instanceof Enum + withType: registry.createTypeUnsafe('ExtrinsicSignature', [{}]) instanceof Enum }; } diff --git a/packages/types/src/generic/ChainProperties.ts b/packages/types/src/generic/ChainProperties.ts index 3155f6879db..1f394dd1954 100644 --- a/packages/types/src/generic/ChainProperties.ts +++ b/packages/types/src/generic/ChainProperties.ts @@ -52,9 +52,9 @@ function decode (registry: Registry, value?: Map | Record', []), - tokenDecimals: registry.createTypeUnsafe('Option>', []), - tokenSymbol: registry.createTypeUnsafe('Option>', []) + ss58Format: registry.createTypeUnsafe('Option', [null]), + tokenDecimals: registry.createTypeUnsafe('Option>', [null]), + tokenSymbol: registry.createTypeUnsafe('Option>', [null]) }); } diff --git a/packages/types/src/metadata/v15/toV16.ts b/packages/types/src/metadata/v15/toV16.ts index 40c80c05295..82a14897776 100644 --- a/packages/types/src/metadata/v15/toV16.ts +++ b/packages/types/src/metadata/v15/toV16.ts @@ -42,7 +42,7 @@ function convertStorage (registry: Registry, storage: PalletStorageMetadataV14): } function convertCalls (registry: Registry, calls: PalletCallMetadataV14): PalletCallMetadataV16 { - const deprecationInfo = registry.createTypeUnsafe('EnumDeprecationInfoV16', []); + const deprecationInfo = registry.createTypeUnsafe('EnumDeprecationInfoV16', [{}]); return registry.createTypeUnsafe('PalletCallMetadataV16', [{ deprecationInfo, @@ -51,7 +51,7 @@ function convertCalls (registry: Registry, calls: PalletCallMetadataV14): Pallet } function convertEvents (registry: Registry, events: PalletEventMetadataV14): PalletEventMetadataV16 { - const deprecationInfo = registry.createTypeUnsafe('EnumDeprecationInfoV16', []); + const deprecationInfo = registry.createTypeUnsafe('EnumDeprecationInfoV16', [{}]); return registry.createTypeUnsafe('PalletEventMetadataV16', [{ deprecationInfo, @@ -70,7 +70,7 @@ function convertConstants (registry: Registry, constants: Vec