diff --git a/packages/types-known/src/spec/centrifuge-chain.ts b/packages/types-known/src/spec/centrifuge-chain.ts index f6845344f8..f2bdff5d35 100644 --- a/packages/types-known/src/spec/centrifuge-chain.ts +++ b/packages/types-known/src/spec/centrifuge-chain.ts @@ -1,10 +1,15 @@ // Copyright 2017-2020 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 +/* eslint-disable sort-keys */ + import { OverrideVersionedType } from '@polkadot/types/types'; const sharedTypes = { + // substrate Address: 'LookupSource', + LookupSource: 'IndicesLookupSource', + AnchorData: { anchoredBlock: 'u64', docRoot: 'H256', diff --git a/packages/types-known/src/spec/kusama.ts b/packages/types-known/src/spec/kusama.ts index 9d50b751c5..f65f7cb944 100644 --- a/packages/types-known/src/spec/kusama.ts +++ b/packages/types-known/src/spec/kusama.ts @@ -1,6 +1,8 @@ // Copyright 2017-2020 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 +/* eslint-disable sort-keys */ + import { OverrideVersionedType } from '@polkadot/types/types'; const sharedTypes = { @@ -23,6 +25,7 @@ const versioned: OverrideVersionedType[] = [ DispatchError: 'DispatchErrorTo198', DispatchInfo: 'DispatchInfoTo244', Keys: 'SessionKeys5', + LookupSource: 'IndicesLookupSource', Multiplier: 'Fixed64', OpenTip: 'OpenTipTo225', RefCount: 'RefCountTo259', @@ -42,6 +45,7 @@ const versioned: OverrideVersionedType[] = [ CompactAssignments: 'CompactAssignmentsTo257', DispatchInfo: 'DispatchInfoTo244', Keys: 'SessionKeys5', + LookupSource: 'IndicesLookupSource', Multiplier: 'Fixed64', OpenTip: 'OpenTipTo225', RefCount: 'RefCountTo259', @@ -62,6 +66,7 @@ const versioned: OverrideVersionedType[] = [ CompactAssignments: 'CompactAssignmentsTo257', DispatchInfo: 'DispatchInfoTo244', Keys: 'SessionKeys5', + LookupSource: 'IndicesLookupSource', Multiplier: 'Fixed64', OpenTip: 'OpenTipTo225', RefCount: 'RefCountTo259', diff --git a/packages/types-known/src/spec/node-template.ts b/packages/types-known/src/spec/node-template.ts index d8ee3d7062..98d7858daa 100644 --- a/packages/types-known/src/spec/node-template.ts +++ b/packages/types-known/src/spec/node-template.ts @@ -1,6 +1,8 @@ // Copyright 2017-2020 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 +/* eslint-disable sort-keys */ + import { OverrideVersionedType } from '@polkadot/types/types'; const versioned: OverrideVersionedType[] = [ diff --git a/packages/types-known/src/spec/polkadot.ts b/packages/types-known/src/spec/polkadot.ts index a5f86d79e8..c344f37470 100644 --- a/packages/types-known/src/spec/polkadot.ts +++ b/packages/types-known/src/spec/polkadot.ts @@ -1,6 +1,8 @@ // Copyright 2017-2020 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 +/* eslint-disable sort-keys */ + import { OverrideVersionedType } from '@polkadot/types/types'; const sharedTypes = { diff --git a/packages/types-known/src/spec/rococo.ts b/packages/types-known/src/spec/rococo.ts index f6f9848d53..72fda6b40f 100644 --- a/packages/types-known/src/spec/rococo.ts +++ b/packages/types-known/src/spec/rococo.ts @@ -1,6 +1,8 @@ // Copyright 2017-2020 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 +/* eslint-disable sort-keys */ + import { OverrideVersionedType } from '@polkadot/types/types'; // structs need to be in order diff --git a/packages/types-known/src/spec/westend.ts b/packages/types-known/src/spec/westend.ts index b907b1f1b6..ece9c06e63 100644 --- a/packages/types-known/src/spec/westend.ts +++ b/packages/types-known/src/spec/westend.ts @@ -1,6 +1,8 @@ // Copyright 2017-2020 @polkadot/types-known authors & contributors // SPDX-License-Identifier: Apache-2.0 +/* eslint-disable sort-keys */ + import { OverrideVersionedType } from '@polkadot/types/types'; const sharedTypes = { diff --git a/packages/types/src/augment/registry.ts b/packages/types/src/augment/registry.ts index 6f41a953a3..ac57a24ce1 100644 --- a/packages/types/src/augment/registry.ts +++ b/packages/types/src/augment/registry.ts @@ -35,7 +35,7 @@ import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/ty import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase'; import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery'; import type { RpcMethods } from '@polkadot/types/interfaces/rpc'; -import type { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, Consensus, ConsensusEngineId, Digest, DigestItem, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, GenericAddress, H160, H256, H512, Hash, Header, I32F32, Index, Justification, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, OpaqueCall, Origin, OriginCaller, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, StorageData, TransactionPriority, U32F32, ValidatorId, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime'; +import type { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, CallHash, CallHashOf, ChangesTrieConfiguration, Consensus, ConsensusEngineId, Digest, DigestItem, ExtrinsicsWeight, Fixed128, Fixed64, FixedI128, FixedI64, FixedU128, FixedU64, H160, H256, H512, Hash, Header, I32F32, Index, IndicesLookupSource, Justification, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, ModuleId, Moment, MultiAddress, OpaqueCall, Origin, OriginCaller, PalletVersion, PalletsOrigin, Pays, PerU16, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Releases, RuntimeDbWeight, Seal, SealV0, SignedBlock, StorageData, TransactionPriority, U32F32, ValidatorId, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime'; import type { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiVariant } from '@polkadot/types/interfaces/scaleInfo'; import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler'; import type { FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, ValidatorCount } from '@polkadot/types/interfaces/session'; @@ -283,9 +283,6 @@ declare module '@polkadot/types/types/registry' { ExtrinsicsWeight: ExtrinsicsWeight; 'Option': Option; 'Vec': Vec; - GenericAddress: GenericAddress; - 'Option': Option; - 'Vec': Vec; H160: H160; 'Option': Option; 'Vec': Vec; @@ -301,6 +298,9 @@ declare module '@polkadot/types/types/registry' { Header: Header; 'Option
': Option
; 'Vec
': Vec
; + IndicesLookupSource: IndicesLookupSource; + 'Option': Option; + 'Vec': Vec; Index: Index; 'Compact': Compact; 'Option': Option; diff --git a/packages/types/src/generic/LookupSource.spec.ts b/packages/types/src/generic/LookupSource.spec.ts index 8567e654d0..f9a4020bc2 100644 --- a/packages/types/src/generic/LookupSource.spec.ts +++ b/packages/types/src/generic/LookupSource.spec.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 import { TypeRegistry } from '../create'; -import { GenericAccountId as AccountId, GenericAccountIndex as AccountIndex, GenericLookupSource as LookuoSource } from '.'; +import { GenericAccountId as AccountId, GenericAccountIndex as AccountIndex, GenericLookupSource as LookupSource } from '.'; describe('LookupSource', (): void => { const registry = new TypeRegistry(); - const testDecode = (type: string, input: LookuoSource | AccountId | AccountIndex | number[] | Uint8Array, expected: string): void => + const testDecode = (type: string, input: LookupSource | AccountId | AccountIndex | number[] | Uint8Array, expected: string): void => it(`can decode from ${type}`, (): void => { const a = registry.createType('Address', input); diff --git a/packages/types/src/interfaces/runtime/definitions.ts b/packages/types/src/interfaces/runtime/definitions.ts index 50125dcb6c..46db59f966 100644 --- a/packages/types/src/interfaces/runtime/definitions.ts +++ b/packages/types/src/interfaces/runtime/definitions.ts @@ -29,7 +29,7 @@ export default { AccountId: 'GenericAccountId', AccountIdOf: 'AccountId', AccountIndex: 'GenericAccountIndex', - Address: 'GenericAddress', + Address: 'LookupSource', AssetId: 'u32', Balance: 'UInt<128, Balance>', BalanceOf: 'Balance', @@ -61,7 +61,6 @@ export default { normal: 'Weight', operational: 'Weight' }, - GenericAddress: 'LookupSource', H160: '[u8; 20; H160]', H256: '[u8; 32; H256]', H512: '[u8; 64; H512]', @@ -73,12 +72,13 @@ export default { extrinsicsRoot: 'Hash', digest: 'Digest' }, + IndicesLookupSource: 'GenericLookupSource', Index: 'u32', Justification: 'Bytes', KeyValue: '(StorageKey, StorageData)', KeyTypeId: 'u32', LockIdentifier: '[u8; 8]', - LookupSource: 'GenericLookupSource', + LookupSource: 'IndicesLookupSource', LookupTarget: 'AccountId', ModuleId: 'LockIdentifier', MultiAddress: 'GenericMultiAddress', diff --git a/packages/types/src/interfaces/runtime/types.ts b/packages/types/src/interfaces/runtime/types.ts index e34fb81860..f9eb40d2df 100644 --- a/packages/types/src/interfaces/runtime/types.ts +++ b/packages/types/src/interfaces/runtime/types.ts @@ -17,7 +17,7 @@ export interface AccountIdOf extends AccountId {} export interface AccountIndex extends GenericAccountIndex {} /** @name Address */ -export interface Address extends GenericAddress {} +export interface Address extends LookupSource {} /** @name AssetId */ export interface AssetId extends u32 {} @@ -102,9 +102,6 @@ export interface FixedU128 extends UInt {} /** @name FixedU64 */ export interface FixedU64 extends UInt {} -/** @name GenericAddress */ -export interface GenericAddress extends LookupSource {} - /** @name H160 */ export interface H160 extends U8aFixed {} @@ -132,6 +129,9 @@ export interface I32F32 extends Int {} /** @name Index */ export interface Index extends u32 {} +/** @name IndicesLookupSource */ +export interface IndicesLookupSource extends GenericLookupSource {} + /** @name Justification */ export interface Justification extends Bytes {} @@ -145,7 +145,7 @@ export interface KeyValue extends ITuple<[StorageKey, StorageData]> {} export interface LockIdentifier extends U8aFixed {} /** @name LookupSource */ -export interface LookupSource extends GenericLookupSource {} +export interface LookupSource extends IndicesLookupSource {} /** @name LookupTarget */ export interface LookupTarget extends AccountId {}