Skip to content

Commit 2906b02

Browse files
authored
IndicesLookupSource (#2867)
1 parent 683c37b commit 2906b02

File tree

10 files changed

+32
-14
lines changed

10 files changed

+32
-14
lines changed

packages/types-known/src/spec/centrifuge-chain.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
// Copyright 2017-2020 @polkadot/types-known authors & contributors
22
// SPDX-License-Identifier: Apache-2.0
33

4+
/* eslint-disable sort-keys */
5+
46
import { OverrideVersionedType } from '@polkadot/types/types';
57

68
const sharedTypes = {
9+
// substrate
710
Address: 'LookupSource',
11+
LookupSource: 'IndicesLookupSource',
12+
813
AnchorData: {
914
anchoredBlock: 'u64',
1015
docRoot: 'H256',

packages/types-known/src/spec/kusama.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright 2017-2020 @polkadot/types-known authors & contributors
22
// SPDX-License-Identifier: Apache-2.0
33

4+
/* eslint-disable sort-keys */
5+
46
import { OverrideVersionedType } from '@polkadot/types/types';
57

68
const sharedTypes = {
@@ -23,6 +25,7 @@ const versioned: OverrideVersionedType[] = [
2325
DispatchError: 'DispatchErrorTo198',
2426
DispatchInfo: 'DispatchInfoTo244',
2527
Keys: 'SessionKeys5',
28+
LookupSource: 'IndicesLookupSource',
2629
Multiplier: 'Fixed64',
2730
OpenTip: 'OpenTipTo225',
2831
RefCount: 'RefCountTo259',
@@ -42,6 +45,7 @@ const versioned: OverrideVersionedType[] = [
4245
CompactAssignments: 'CompactAssignmentsTo257',
4346
DispatchInfo: 'DispatchInfoTo244',
4447
Keys: 'SessionKeys5',
48+
LookupSource: 'IndicesLookupSource',
4549
Multiplier: 'Fixed64',
4650
OpenTip: 'OpenTipTo225',
4751
RefCount: 'RefCountTo259',
@@ -62,6 +66,7 @@ const versioned: OverrideVersionedType[] = [
6266
CompactAssignments: 'CompactAssignmentsTo257',
6367
DispatchInfo: 'DispatchInfoTo244',
6468
Keys: 'SessionKeys5',
69+
LookupSource: 'IndicesLookupSource',
6570
Multiplier: 'Fixed64',
6671
OpenTip: 'OpenTipTo225',
6772
RefCount: 'RefCountTo259',

packages/types-known/src/spec/node-template.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright 2017-2020 @polkadot/types-known authors & contributors
22
// SPDX-License-Identifier: Apache-2.0
33

4+
/* eslint-disable sort-keys */
5+
46
import { OverrideVersionedType } from '@polkadot/types/types';
57

68
const versioned: OverrideVersionedType[] = [

packages/types-known/src/spec/polkadot.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright 2017-2020 @polkadot/types-known authors & contributors
22
// SPDX-License-Identifier: Apache-2.0
33

4+
/* eslint-disable sort-keys */
5+
46
import { OverrideVersionedType } from '@polkadot/types/types';
57

68
const sharedTypes = {

packages/types-known/src/spec/rococo.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright 2017-2020 @polkadot/types-known authors & contributors
22
// SPDX-License-Identifier: Apache-2.0
33

4+
/* eslint-disable sort-keys */
5+
46
import { OverrideVersionedType } from '@polkadot/types/types';
57

68
// structs need to be in order

packages/types-known/src/spec/westend.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Copyright 2017-2020 @polkadot/types-known authors & contributors
22
// SPDX-License-Identifier: Apache-2.0
33

4+
/* eslint-disable sort-keys */
5+
46
import { OverrideVersionedType } from '@polkadot/types/types';
57

68
const sharedTypes = {

packages/types/src/augment/registry.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import type { ProxyAnnouncement, ProxyDefinition, ProxyType } from '@polkadot/ty
3535
import type { AccountStatus, AccountValidity } from '@polkadot/types/interfaces/purchase';
3636
import type { ActiveRecovery, RecoveryConfig } from '@polkadot/types/interfaces/recovery';
3737
import type { RpcMethods } from '@polkadot/types/interfaces/rpc';
38-
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';
38+
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';
3939
import type { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray, SiTypeDefComposite, SiTypeDefPrimitive, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiVariant } from '@polkadot/types/interfaces/scaleInfo';
4040
import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler';
4141
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' {
283283
ExtrinsicsWeight: ExtrinsicsWeight;
284284
'Option<ExtrinsicsWeight>': Option<ExtrinsicsWeight>;
285285
'Vec<ExtrinsicsWeight>': Vec<ExtrinsicsWeight>;
286-
GenericAddress: GenericAddress;
287-
'Option<GenericAddress>': Option<GenericAddress>;
288-
'Vec<GenericAddress>': Vec<GenericAddress>;
289286
H160: H160;
290287
'Option<H160>': Option<H160>;
291288
'Vec<H160>': Vec<H160>;
@@ -301,6 +298,9 @@ declare module '@polkadot/types/types/registry' {
301298
Header: Header;
302299
'Option<Header>': Option<Header>;
303300
'Vec<Header>': Vec<Header>;
301+
IndicesLookupSource: IndicesLookupSource;
302+
'Option<IndicesLookupSource>': Option<IndicesLookupSource>;
303+
'Vec<IndicesLookupSource>': Vec<IndicesLookupSource>;
304304
Index: Index;
305305
'Compact<Index>': Compact<Index>;
306306
'Option<Index>': Option<Index>;

packages/types/src/generic/LookupSource.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
import { TypeRegistry } from '../create';
5-
import { GenericAccountId as AccountId, GenericAccountIndex as AccountIndex, GenericLookupSource as LookuoSource } from '.';
5+
import { GenericAccountId as AccountId, GenericAccountIndex as AccountIndex, GenericLookupSource as LookupSource } from '.';
66

77
describe('LookupSource', (): void => {
88
const registry = new TypeRegistry();
99

10-
const testDecode = (type: string, input: LookuoSource | AccountId | AccountIndex | number[] | Uint8Array, expected: string): void =>
10+
const testDecode = (type: string, input: LookupSource | AccountId | AccountIndex | number[] | Uint8Array, expected: string): void =>
1111
it(`can decode from ${type}`, (): void => {
1212
const a = registry.createType('Address', input);
1313

packages/types/src/interfaces/runtime/definitions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default {
2929
AccountId: 'GenericAccountId',
3030
AccountIdOf: 'AccountId',
3131
AccountIndex: 'GenericAccountIndex',
32-
Address: 'GenericAddress',
32+
Address: 'LookupSource',
3333
AssetId: 'u32',
3434
Balance: 'UInt<128, Balance>',
3535
BalanceOf: 'Balance',
@@ -61,7 +61,6 @@ export default {
6161
normal: 'Weight',
6262
operational: 'Weight'
6363
},
64-
GenericAddress: 'LookupSource',
6564
H160: '[u8; 20; H160]',
6665
H256: '[u8; 32; H256]',
6766
H512: '[u8; 64; H512]',
@@ -73,12 +72,13 @@ export default {
7372
extrinsicsRoot: 'Hash',
7473
digest: 'Digest'
7574
},
75+
IndicesLookupSource: 'GenericLookupSource',
7676
Index: 'u32',
7777
Justification: 'Bytes',
7878
KeyValue: '(StorageKey, StorageData)',
7979
KeyTypeId: 'u32',
8080
LockIdentifier: '[u8; 8]',
81-
LookupSource: 'GenericLookupSource',
81+
LookupSource: 'IndicesLookupSource',
8282
LookupTarget: 'AccountId',
8383
ModuleId: 'LockIdentifier',
8484
MultiAddress: 'GenericMultiAddress',

packages/types/src/interfaces/runtime/types.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ export interface AccountIdOf extends AccountId {}
1717
export interface AccountIndex extends GenericAccountIndex {}
1818

1919
/** @name Address */
20-
export interface Address extends GenericAddress {}
20+
export interface Address extends LookupSource {}
2121

2222
/** @name AssetId */
2323
export interface AssetId extends u32 {}
@@ -102,9 +102,6 @@ export interface FixedU128 extends UInt {}
102102
/** @name FixedU64 */
103103
export interface FixedU64 extends UInt {}
104104

105-
/** @name GenericAddress */
106-
export interface GenericAddress extends LookupSource {}
107-
108105
/** @name H160 */
109106
export interface H160 extends U8aFixed {}
110107

@@ -132,6 +129,9 @@ export interface I32F32 extends Int {}
132129
/** @name Index */
133130
export interface Index extends u32 {}
134131

132+
/** @name IndicesLookupSource */
133+
export interface IndicesLookupSource extends GenericLookupSource {}
134+
135135
/** @name Justification */
136136
export interface Justification extends Bytes {}
137137

@@ -145,7 +145,7 @@ export interface KeyValue extends ITuple<[StorageKey, StorageData]> {}
145145
export interface LockIdentifier extends U8aFixed {}
146146

147147
/** @name LookupSource */
148-
export interface LookupSource extends GenericLookupSource {}
148+
export interface LookupSource extends IndicesLookupSource {}
149149

150150
/** @name LookupTarget */
151151
export interface LookupTarget extends AccountId {}

0 commit comments

Comments
 (0)