Skip to content

Commit 55fe455

Browse files
authored
Small import cleanups (#4368)
1 parent 2a004e3 commit 55fe455

File tree

11 files changed

+26
-26
lines changed

11 files changed

+26
-26
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
"@babel/core": "^7.16.5",
3535
"@babel/register": "^7.16.5",
3636
"@babel/runtime": "^7.16.5",
37-
"@polkadot/dev": "^0.64.8",
37+
"@polkadot/dev": "^0.64.11",
3838
"@polkadot/ts": "^0.4.20",
3939
"@polkadot/typegen": "workspace:packages/typegen",
4040
"@types/jest": "^27.0.3",

packages/api/src/base/Init.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import type { Observable, Subscription } from 'rxjs';
55
import type { Text } from '@polkadot/types';
66
import type { ExtDef } from '@polkadot/types/extrinsic/signedExtensions/types';
7-
import type { ChainProperties, Hash, HeaderPartial, RuntimeVersion, RuntimeVersionPartial } from '@polkadot/types/interfaces';
7+
import type { ChainProperties, Hash, RuntimeVersion, RuntimeVersionPartial } from '@polkadot/types/interfaces';
88
import type { Registry } from '@polkadot/types/types';
99
import type { BN } from '@polkadot/util';
1010
import type { HexString } from '@polkadot/util/types';
@@ -151,7 +151,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
151151
this._genesisHash.eq(blockHash)
152152
? { number: BN_ZERO, parentHash: this._genesisHash }
153153
: await firstValueFrom(this._rpcCore.chain.getHeader.raw(blockHash))
154-
) as unknown as HeaderPartial;
154+
);
155155

156156
assert(!header.parentHash.isEmpty, 'Unable to retrieve header and parent from supplied hash');
157157

@@ -161,7 +161,7 @@ export abstract class Init<ApiType extends ApiTypes> extends Decorate<ApiType> {
161161
(firstVersion && (lastVersion || firstVersion.specVersion.eq(this._runtimeVersion.specVersion)))
162162
? { specName: this._runtimeVersion.specName, specVersion: firstVersion.specVersion }
163163
: await firstValueFrom(this._rpcCore.state.getRuntimeVersion.raw(header.parentHash))
164-
) as unknown as RuntimeVersionPartial;
164+
);
165165

166166
const existingViaVersion = this._getBlockRegistryViaVersion(blockHash, version);
167167

packages/types/src/checkTypes.manual.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33

44
import '@polkadot/types-augment';
55

6-
import type { Compact, Option } from './codec';
6+
import type { Bytes, Compact, Option, u32 } from '@polkadot/types-codec';
7+
import type { IOption, ITuple } from '@polkadot/types-codec/types';
78
import type { AccountId, BlockAttestations, SessionKeys7 } from './interfaces';
8-
import type { Bytes, u32 } from './primitive';
9-
import type { IOption, ITuple } from './types';
109

1110
import { assert } from '@polkadot/util';
1211

packages/types/src/metadata/PortableRegistry/PortableRegistry.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
// Copyright 2017-2021 @polkadot/types authors & contributors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import type { Vec } from '@polkadot/types-codec';
4+
import type { Text, Type, Vec } from '@polkadot/types-codec';
55
import type { CodecRegistry } from '@polkadot/types-codec/types';
66
import type { ILookup, TypeDef } from '@polkadot/types-create/types';
77
import type { PortableType } from '../../interfaces/metadata';
88
import type { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDefArray, SiTypeDefBitSequence, SiTypeDefCompact, SiTypeDefComposite, SiTypeDefSequence, SiTypeDefTuple, SiTypeDefVariant, SiTypeParameter, SiVariant } from '../../interfaces/scaleInfo';
9-
import type { Text, Type } from '../../primitive';
109

1110
import { sanitize, Struct, u32 } from '@polkadot/types-codec';
1211
import { getTypeDef, TypeDefInfo, withTypeString } from '@polkadot/types-create';

packages/types/src/metadata/decorate/errors/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
// Copyright 2017-2021 @polkadot/types authors & contributors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import type { Text } from '@polkadot/types-codec';
4+
import type { Text, u8 } from '@polkadot/types-codec';
55
import type { CodecRegistry } from '@polkadot/types-codec/types';
66
import type { DispatchErrorModule, MetadataLatest, SiField, SiVariant } from '../../../interfaces';
77
import type { PortableRegistry } from '../../../metadata';
8-
import type { u8 } from '../../../primitive';
98
import type { Errors, IsError } from '../types';
109

1110
import { lazyMethod, objectSpread, stringCamelCase } from '@polkadot/util';

packages/types/src/metadata/decorate/index.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
// Copyright 2017-2021 @polkadot/types authors & contributors
22
// SPDX-License-Identifier: Apache-2.0
33

4+
import { u32 } from '@polkadot/types-codec';
45
import json from '@polkadot/types-support/metadata/static-substrate';
56
import { u8aToHex } from '@polkadot/util';
67

78
import { TypeRegistry } from '../../create';
8-
import { u32 } from '../../primitive';
99
import { Metadata } from '../Metadata';
1010
import { decorateConstants, decorateExtrinsics, decorateStorage } from './';
1111

packages/types/src/metadata/decorate/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// Copyright 2017-2021 @polkadot/types authors & contributors
22
// SPDX-License-Identifier: Apache-2.0
33

4-
import type { Text } from '../../primitive';
4+
import type { Text } from '@polkadot/types-codec';
55

66
import { stringCamelCase, stringLowerFirst } from '@polkadot/util';
77

packages/types/src/metadata/util/toCallsOnly.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,7 @@
44
import type { AnyJson, CodecRegistry } from '@polkadot/types-codec/types';
55
import type { MetadataLatest, PalletCallMetadataLatest } from '../../interfaces/metadata';
66

7-
import { Option, Text } from '@polkadot/types-codec';
8-
9-
import { u8 } from '../../primitive';
7+
import { Option, Text, u8 } from '@polkadot/types-codec';
108

119
interface ModuleMetadataTrimmed {
1210
calls: Option<PalletCallMetadataLatest>;

packages/types/src/types/events.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
// Copyright 2017-2021 @polkadot/types authors & contributors
22
// SPDX-License-Identifier: Apache-2.0
33

4+
import type { Codec, ITuple } from '@polkadot/types-codec/types';
45
import type { EventMetadataLatest } from '../interfaces/metadata';
56
import type { Hash } from '../interfaces/runtime';
67
import type { EventId, Phase } from '../interfaces/system';
7-
import type { Codec } from './codec';
8-
import type { ITuple } from './interfaces';
98

109
export interface IEventRecord<T extends Codec[]> {
1110
readonly phase: Phase;

packages/types/src/types/registry.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@
33

44
import type { Observable } from 'rxjs';
55
import type { BitVec, Bool, bool, Bytes, I8, i8, I16, i16, I32, i32, I64, i64, I128, i128, I256, i256, Json, Null, Raw, Text, Type, U8, u8, U16, u16, U32, u32, U64, u64, U128, u128, U256, u256, USize, usize } from '@polkadot/types-codec';
6-
import type { RegistryError as RegistryErrorBase, RegistryTypes } from '@polkadot/types-codec/types';
6+
import type { Codec, CodecClass, RegistryError as RegistryErrorBase, RegistryTypes } from '@polkadot/types-codec/types';
77
import type { CreateRegistry, TypeDef } from '@polkadot/types-create/types';
88
import type { BN } from '@polkadot/util';
99
import type { GenericExtrinsic, GenericExtrinsicEra, GenericExtrinsicPayload, GenericSignerPayload } from '../extrinsic';
1010
import type { ExtDef } from '../extrinsic/signedExtensions/types';
11+
import type { GenericCall } from '../generic';
1112
import type { MetadataLatest } from '../interfaces/metadata';
13+
import type { HeaderPartial } from '../interfaces/runtime';
1214
import type { SiField, SiLookupTypeId } from '../interfaces/scaleInfo';
15+
import type { RuntimeVersionPartial } from '../interfaces/state';
1316
import type { ChainProperties } from '../interfaces/system';
1417
import type { Metadata, PortableRegistry } from '../metadata';
1518
import type { Data, StorageKey } from '../primitive';
1619
import type { CallFunction } from './calls';
17-
import type { Codec, CodecClass } from './codec';
1820
import type { DefinitionRpc, DefinitionRpcSub } from './definitions';
1921
import type { DetectCodec } from './detect';
2022

@@ -25,10 +27,14 @@ export interface InterfaceTypes {
2527
BitVec: BitVec, Bool: Bool, Bytes: Bytes, I128: I128, I16: I16, I256: I256, I32: I32, I64: I64, I8: I8, Json: Json, Null: Null, Raw: Raw, Text: Text, Type: Type, U128: U128, U16: U16, U256: U256, U32: U32, U64: U64, U8: U8, USize: USize, bool: bool, i128: i128, i16: i16, i256: i256, i32: i32, i64: i64, i8: i8, u128: u128, u16: u16, u256: u256, u32: u32, u64: u64, u8: u8, usize: usize,
2628
// extrinsic
2729
Extrinsic: GenericExtrinsic, ExtrinsicEra: GenericExtrinsicEra, ExtrinsicPayload: GenericExtrinsicPayload, SignerPayload: GenericSignerPayload,
30+
// generic
31+
Call: GenericCall,
2832
// primitive
2933
Data: Data, StorageKey: StorageKey,
3034
// metadata
31-
Metadata: Metadata, PortableRegistry: PortableRegistry
35+
Metadata: Metadata, PortableRegistry: PortableRegistry,
36+
// interfaces
37+
HeaderPartial: HeaderPartial, RuntimeVersionPartial: RuntimeVersionPartial
3238
}
3339

3440
export type CodecHasher = (data: Uint8Array) => Uint8Array;

0 commit comments

Comments
 (0)