From a33e10f0b950bb68e52788dabdfc9945eb6ba542 Mon Sep 17 00:00:00 2001 From: Jaco Date: Thu, 16 Dec 2021 11:20:06 +0100 Subject: [PATCH] Adjust type imports from types-codec (#4335) --- packages/types/src/codec/BTreeSet.spec.ts | 2 +- packages/types/src/codec/Date.spec.ts | 2 +- packages/types/src/codec/Map.spec.ts | 2 +- packages/types/src/codec/Raw.spec.ts | 2 +- packages/types/src/codec/Struct.spec.ts | 2 +- packages/types/src/codec/Tuple.spec.ts | 3 +-- packages/types/src/extrinsic/Extrinsic.ts | 4 ++-- packages/types/src/extrinsic/ExtrinsicEra.ts | 4 ++-- packages/types/src/extrinsic/ExtrinsicPayload.ts | 4 ++-- packages/types/src/extrinsic/types.ts | 2 +- packages/types/src/generic/Block.ts | 3 +-- packages/types/src/generic/Call.ts | 4 ++-- packages/types/src/generic/ConsensusEngineId.ts | 3 +-- packages/types/src/generic/Vote.ts | 4 ++-- packages/types/src/metadata/MetadataVersioned.ts | 3 +-- packages/types/src/metadata/decorate/events/index.spec.ts | 3 ++- packages/types/src/metadata/decorate/events/index.ts | 4 ++-- .../types/src/metadata/decorate/extrinsics/createUnchecked.ts | 4 ++-- packages/types/src/metadata/decorate/types.ts | 4 ++-- packages/types/src/metadata/util/toCallsOnly.ts | 3 +-- packages/types/src/primitive/Bool.spec.ts | 2 +- packages/types/src/primitive/Text.spec.ts | 2 +- packages/types/src/types/calls.ts | 2 +- packages/types/src/types/extrinsic.ts | 2 +- 24 files changed, 33 insertions(+), 37 deletions(-) diff --git a/packages/types/src/codec/BTreeSet.spec.ts b/packages/types/src/codec/BTreeSet.spec.ts index 82fcc08a59..c5d3ab8742 100644 --- a/packages/types/src/codec/BTreeSet.spec.ts +++ b/packages/types/src/codec/BTreeSet.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CodecTo } from '../types'; +import type { CodecTo } from '@polkadot/types-codec/types'; import { TypeRegistry } from '../create'; import { I32, Text, U32 } from '../primitive'; diff --git a/packages/types/src/codec/Date.spec.ts b/packages/types/src/codec/Date.spec.ts index b871c5c094..130a9b7265 100644 --- a/packages/types/src/codec/Date.spec.ts +++ b/packages/types/src/codec/Date.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CodecTo } from '../types'; +import type { CodecTo } from '@polkadot/types-codec/types'; import { CodecDate } from '@polkadot/types-codec'; import { BN } from '@polkadot/util'; diff --git a/packages/types/src/codec/Map.spec.ts b/packages/types/src/codec/Map.spec.ts index 237ec34e39..f9f9ab609b 100644 --- a/packages/types/src/codec/Map.spec.ts +++ b/packages/types/src/codec/Map.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CodecTo } from '../types'; +import type { CodecTo } from '@polkadot/types-codec/types'; import { TypeRegistry } from '../create'; import { Text, U32 } from '../primitive'; diff --git a/packages/types/src/codec/Raw.spec.ts b/packages/types/src/codec/Raw.spec.ts index e1c69d3ab4..5b6f6b320c 100644 --- a/packages/types/src/codec/Raw.spec.ts +++ b/packages/types/src/codec/Raw.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AnyU8a, CodecTo } from '../types'; +import type { AnyU8a, CodecTo } from '@polkadot/types-codec/types'; import { TypeRegistry } from '../create'; import { Raw } from '.'; diff --git a/packages/types/src/codec/Struct.spec.ts b/packages/types/src/codec/Struct.spec.ts index 2be02e4a6f..2e6e7404fe 100644 --- a/packages/types/src/codec/Struct.spec.ts +++ b/packages/types/src/codec/Struct.spec.ts @@ -3,7 +3,7 @@ /* eslint-disable sort-keys */ -import type { CodecTo } from '../types'; +import type { CodecTo } from '@polkadot/types-codec/types'; import { TypeRegistry } from '../create'; import { Text, U32 } from '../primitive'; diff --git a/packages/types/src/codec/Tuple.spec.ts b/packages/types/src/codec/Tuple.spec.ts index 29efd2b930..ce319f2351 100644 --- a/packages/types/src/codec/Tuple.spec.ts +++ b/packages/types/src/codec/Tuple.spec.ts @@ -1,10 +1,9 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AnyTupleValue } from '@polkadot/types-codec/types'; +import type { AnyTupleValue, CodecTo } from '@polkadot/types-codec/types'; import type { VoteThreshold } from '../interfaces/elections'; import type { BlockNumber } from '../interfaces/runtime'; -import type { CodecTo } from '../types'; import rpcMetadata from '@polkadot/types-support/metadata/static-substrate'; diff --git a/packages/types/src/extrinsic/Extrinsic.ts b/packages/types/src/extrinsic/Extrinsic.ts index 2c6a8a392c..d5999376aa 100644 --- a/packages/types/src/extrinsic/Extrinsic.ts +++ b/packages/types/src/extrinsic/Extrinsic.ts @@ -2,12 +2,12 @@ // SPDX-License-Identifier: Apache-2.0 import type { Compact } from '@polkadot/types-codec'; -import type { CodecRegistry, IMethod } from '@polkadot/types-codec/types'; +import type { AnyJson, AnyTuple, AnyU8a, ArgsDef, CodecRegistry, IMethod } from '@polkadot/types-codec/types'; import type { HexString } from '@polkadot/util/types'; import type { EcdsaSignature, Ed25519Signature, ExtrinsicUnknown, ExtrinsicV4, Sr25519Signature } from '../interfaces/extrinsics'; import type { FunctionMetadataLatest } from '../interfaces/metadata'; import type { Address, Balance, Call, CodecHash, Index } from '../interfaces/runtime'; -import type { AnyJson, AnyTuple, AnyU8a, ArgsDef, CallBase, ExtrinsicPayloadValue, IExtrinsic, IKeyringPair, SignatureOptions } from '../types'; +import type { CallBase, ExtrinsicPayloadValue, IExtrinsic, IKeyringPair, SignatureOptions } from '../types'; import type { GenericExtrinsicEra } from './ExtrinsicEra'; import type { ExtrinsicValueV4 } from './v4/Extrinsic'; diff --git a/packages/types/src/extrinsic/ExtrinsicEra.ts b/packages/types/src/extrinsic/ExtrinsicEra.ts index b89e7d8c82..de066caafa 100644 --- a/packages/types/src/extrinsic/ExtrinsicEra.ts +++ b/packages/types/src/extrinsic/ExtrinsicEra.ts @@ -1,9 +1,9 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CodecRegistry } from '@polkadot/types-codec/types'; +import type { AnyU8a, CodecRegistry } from '@polkadot/types-codec/types'; import type { BN } from '@polkadot/util'; -import type { AnyU8a, IExtrinsicEra } from '../types'; +import type { IExtrinsicEra } from '../types'; import { Enum, Raw, Tuple, U64 } from '@polkadot/types-codec'; import { assert, bnToBn, formatNumber, hexToU8a, isHex, isObject, isU8a, u8aToBn, u8aToU8a } from '@polkadot/util'; diff --git a/packages/types/src/extrinsic/ExtrinsicPayload.ts b/packages/types/src/extrinsic/ExtrinsicPayload.ts index bd685dbb54..b38f2381f9 100644 --- a/packages/types/src/extrinsic/ExtrinsicPayload.ts +++ b/packages/types/src/extrinsic/ExtrinsicPayload.ts @@ -1,11 +1,11 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CodecRegistry } from '@polkadot/types-codec/types'; +import type { AnyJson, BareOpts, CodecRegistry } from '@polkadot/types-codec/types'; import type { HexString } from '@polkadot/util/types'; import type { ExtrinsicPayloadV4 } from '../interfaces/extrinsics'; import type { Balance, Hash, Index } from '../interfaces/runtime'; -import type { AnyJson, BareOpts, ExtrinsicPayloadValue, IKeyringPair } from '../types'; +import type { ExtrinsicPayloadValue, IKeyringPair } from '../types'; import { Base, Compact, Raw, u32 } from '@polkadot/types-codec'; import { u8aToHex } from '@polkadot/util'; diff --git a/packages/types/src/extrinsic/types.ts b/packages/types/src/extrinsic/types.ts index 57e2d00541..91c3081d4b 100644 --- a/packages/types/src/extrinsic/types.ts +++ b/packages/types/src/extrinsic/types.ts @@ -1,7 +1,7 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AnyNumber } from '../types'; +import type { AnyNumber } from '@polkadot/types-codec/types'; export interface ExtrinsicOptions { isSigned: boolean; diff --git a/packages/types/src/generic/Block.ts b/packages/types/src/generic/Block.ts index 7b4cf9a62b..bc33f41a8b 100644 --- a/packages/types/src/generic/Block.ts +++ b/packages/types/src/generic/Block.ts @@ -2,10 +2,9 @@ // SPDX-License-Identifier: Apache-2.0 import type { Vec } from '@polkadot/types-codec'; -import type { CodecRegistry, IU8a } from '@polkadot/types-codec/types'; +import type { AnyNumber, AnyU8a, CodecRegistry, IU8a } from '@polkadot/types-codec/types'; import type { GenericExtrinsic } from '../extrinsic/Extrinsic'; import type { Digest, DigestItem, Header } from '../interfaces/runtime'; -import type { AnyNumber, AnyU8a } from '../types'; import { Struct } from '@polkadot/types-codec'; diff --git a/packages/types/src/generic/Call.ts b/packages/types/src/generic/Call.ts index 71782b316c..ea127e9ec3 100644 --- a/packages/types/src/generic/Call.ts +++ b/packages/types/src/generic/Call.ts @@ -1,9 +1,9 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CodecRegistry, IMethod } from '@polkadot/types-codec/types'; +import type { AnyJson, AnyTuple, AnyU8a, ArgsDef, Codec, CodecRegistry, IMethod } from '@polkadot/types-codec/types'; import type { FunctionMetadataLatest } from '../interfaces/metadata'; -import type { AnyJson, AnyTuple, AnyU8a, ArgsDef, CallBase, CallFunction, Codec, InterfaceTypes, Registry } from '../types'; +import type { CallBase, CallFunction, InterfaceTypes, Registry } from '../types'; import { Struct, U8aFixed } from '@polkadot/types-codec'; import { isHex, isObject, isU8a, objectSpread, u8aToU8a } from '@polkadot/util'; diff --git a/packages/types/src/generic/ConsensusEngineId.ts b/packages/types/src/generic/ConsensusEngineId.ts index c59f418ad0..c630e68646 100644 --- a/packages/types/src/generic/ConsensusEngineId.ts +++ b/packages/types/src/generic/ConsensusEngineId.ts @@ -1,9 +1,8 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CodecRegistry } from '@polkadot/types-codec/types'; +import type { AnyU8a, CodecRegistry } from '@polkadot/types-codec/types'; import type { AccountId, RawAuraPreDigest, RawBabePreDigestCompat } from '../interfaces'; -import type { AnyU8a } from '../types'; import { Bytes, U8aFixed, u32 } from '@polkadot/types-codec'; import { BN, bnToU8a, isNumber, stringToU8a, u8aToHex, u8aToString } from '@polkadot/util'; diff --git a/packages/types/src/generic/Vote.ts b/packages/types/src/generic/Vote.ts index f0cc8b98fa..74f4c849e9 100644 --- a/packages/types/src/generic/Vote.ts +++ b/packages/types/src/generic/Vote.ts @@ -1,10 +1,10 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CodecRegistry } from '@polkadot/types-codec/types'; +import type { AnyJson, CodecRegistry } from '@polkadot/types-codec/types'; import type { Conviction } from '../interfaces/democracy'; import type { AllConvictions } from '../interfaces/democracy/definitions'; -import type { AnyJson, ArrayElementType } from '../types'; +import type { ArrayElementType } from '../types'; import { Bool, U8aFixed } from '@polkadot/types-codec'; import { isBoolean, isNumber, isU8a, isUndefined } from '@polkadot/util'; diff --git a/packages/types/src/metadata/MetadataVersioned.ts b/packages/types/src/metadata/MetadataVersioned.ts index d682c0cd0b..1c97a56af7 100644 --- a/packages/types/src/metadata/MetadataVersioned.ts +++ b/packages/types/src/metadata/MetadataVersioned.ts @@ -1,9 +1,8 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CodecRegistry } from '@polkadot/types-codec/types'; +import type { AnyJson, CodecRegistry } from '@polkadot/types-codec/types'; import type { MetadataAll, MetadataLatest, MetadataV9, MetadataV10, MetadataV11, MetadataV12, MetadataV13, MetadataV14 } from '../interfaces/metadata'; -import type { AnyJson } from '../types'; import { Struct } from '@polkadot/types-codec'; import { assert } from '@polkadot/util'; diff --git a/packages/types/src/metadata/decorate/events/index.spec.ts b/packages/types/src/metadata/decorate/events/index.spec.ts index ff2052e673..f3ebfdac8d 100644 --- a/packages/types/src/metadata/decorate/events/index.spec.ts +++ b/packages/types/src/metadata/decorate/events/index.spec.ts @@ -1,7 +1,8 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { AnyTuple, IEvent } from '../../../types'; +import type { AnyTuple } from '@polkadot/types-codec/types'; +import type { IEvent } from '../../../types'; import rpcMetadata from '@polkadot/types-support/metadata/static-substrate'; diff --git a/packages/types/src/metadata/decorate/events/index.ts b/packages/types/src/metadata/decorate/events/index.ts index a1d0bc93ec..cf90617800 100644 --- a/packages/types/src/metadata/decorate/events/index.ts +++ b/packages/types/src/metadata/decorate/events/index.ts @@ -1,9 +1,9 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CodecRegistry } from '@polkadot/types-codec/types'; +import type { AnyTuple, CodecRegistry } from '@polkadot/types-codec/types'; import type { MetadataLatest, PalletMetadataLatest, SiVariant } from '../../../interfaces'; -import type { AnyTuple, IEvent } from '../../../types'; +import type { IEvent } from '../../../types'; import type { Events, IsEvent } from '../types'; import { lazyMethod, stringCamelCase } from '@polkadot/util'; diff --git a/packages/types/src/metadata/decorate/extrinsics/createUnchecked.ts b/packages/types/src/metadata/decorate/extrinsics/createUnchecked.ts index 342ef86458..2ffceca377 100644 --- a/packages/types/src/metadata/decorate/extrinsics/createUnchecked.ts +++ b/packages/types/src/metadata/decorate/extrinsics/createUnchecked.ts @@ -1,9 +1,9 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CodecRegistry } from '@polkadot/types-codec/types'; +import type { AnyJson, AnyTuple, CodecRegistry } from '@polkadot/types-codec/types'; import type { Call, FunctionMetadataLatest } from '../../../interfaces'; -import type { AnyJson, AnyTuple, CallFunction, IMethod } from '../../../types'; +import type { CallFunction, IMethod } from '../../../types'; import { assert, stringCamelCase } from '@polkadot/util'; diff --git a/packages/types/src/metadata/decorate/types.ts b/packages/types/src/metadata/decorate/types.ts index 87ac083865..cd009e796a 100644 --- a/packages/types/src/metadata/decorate/types.ts +++ b/packages/types/src/metadata/decorate/types.ts @@ -1,10 +1,10 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CodecRegistry } from '@polkadot/types-codec/types'; +import type { AnyTuple, Codec, CodecRegistry } from '@polkadot/types-codec/types'; import type { DispatchErrorModule, ErrorMetadataLatest, EventMetadataLatest, PalletConstantMetadataLatest } from '../../interfaces'; import type { StorageEntry } from '../../primitive/types'; -import type { AnyTuple, CallFunction, Codec, IEvent } from '../../types'; +import type { CallFunction, IEvent } from '../../types'; export interface ConstantCodec extends Codec { readonly meta: PalletConstantMetadataLatest; diff --git a/packages/types/src/metadata/util/toCallsOnly.ts b/packages/types/src/metadata/util/toCallsOnly.ts index 4ba2d2454e..425de36a68 100644 --- a/packages/types/src/metadata/util/toCallsOnly.ts +++ b/packages/types/src/metadata/util/toCallsOnly.ts @@ -1,9 +1,8 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CodecRegistry } from '@polkadot/types-codec/types'; +import type { AnyJson, CodecRegistry } from '@polkadot/types-codec/types'; import type { MetadataLatest, PalletCallMetadataLatest } from '../../interfaces/metadata'; -import type { AnyJson } from '../../types'; import { Option, Text } from '@polkadot/types-codec'; diff --git a/packages/types/src/primitive/Bool.spec.ts b/packages/types/src/primitive/Bool.spec.ts index d2c6d6588d..93aa3591c9 100644 --- a/packages/types/src/primitive/Bool.spec.ts +++ b/packages/types/src/primitive/Bool.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CodecTo } from '../types'; +import type { CodecTo } from '@polkadot/types-codec/types'; import { TypeRegistry } from '../create'; import { Bool } from '.'; diff --git a/packages/types/src/primitive/Text.spec.ts b/packages/types/src/primitive/Text.spec.ts index da27d61d3a..fedd71b499 100644 --- a/packages/types/src/primitive/Text.spec.ts +++ b/packages/types/src/primitive/Text.spec.ts @@ -1,7 +1,7 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 -import type { CodecTo } from '../types'; +import type { CodecTo } from '@polkadot/types-codec/types'; import { Raw } from '@polkadot/types-codec'; diff --git a/packages/types/src/types/calls.ts b/packages/types/src/types/calls.ts index d00e202dd2..3631fd16a9 100644 --- a/packages/types/src/types/calls.ts +++ b/packages/types/src/types/calls.ts @@ -1,8 +1,8 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AnyTuple } from '@polkadot/types-codec/types'; import type { Call } from '../interfaces/runtime'; -import type { AnyTuple } from './codec'; import type { IMethod } from './interfaces'; export interface CallBase extends IMethod { diff --git a/packages/types/src/types/extrinsic.ts b/packages/types/src/types/extrinsic.ts index 862ec4652c..ff2d4cdf5a 100644 --- a/packages/types/src/types/extrinsic.ts +++ b/packages/types/src/types/extrinsic.ts @@ -1,12 +1,12 @@ // Copyright 2017-2021 @polkadot/types authors & contributors // SPDX-License-Identifier: Apache-2.0 +import type { AnyJson, AnyNumber, AnyTuple, AnyU8a, Codec } from '@polkadot/types-codec/types'; import type { HexString } from '@polkadot/util/types'; import type { ExtrinsicStatus } from '../interfaces/author'; import type { EcdsaSignature, Ed25519Signature, Sr25519Signature } from '../interfaces/extrinsics'; import type { Address, Balance, Call, H256, Index } from '../interfaces/runtime'; import type { DispatchError, DispatchInfo, EventRecord } from '../interfaces/system'; -import type { AnyJson, AnyNumber, AnyTuple, AnyU8a, Codec } from './codec'; import type { ICompact, IKeyringPair, IMethod, IRuntimeVersion } from './interfaces'; export interface ISubmittableResult {