diff --git a/packages/types/src/codec/create/createClass.ts b/packages/types/src/codec/create/createClass.ts index 0455e931c6..d6d5006611 100644 --- a/packages/types/src/codec/create/createClass.ts +++ b/packages/types/src/codec/create/createClass.ts @@ -24,5 +24,7 @@ export function ClassOfUnsafe (name: K): Constructor { - return ClassOfUnsafe(name) as Constructor; + // TS2589: Type instantiation is excessively deep and possibly infinite. + // The above happens with as Constructor; + return ClassOfUnsafe(name) as any; } diff --git a/packages/types/src/codec/create/createType.ts b/packages/types/src/codec/create/createType.ts index f02285c604..7e8c52f4e7 100644 --- a/packages/types/src/codec/create/createType.ts +++ b/packages/types/src/codec/create/createType.ts @@ -58,5 +58,7 @@ export function createTypeUnsafe (type: K, ...params: any[]): InterfaceRegistry[K] { - return createTypeUnsafe(type, params) as InterfaceRegistry[K]; + // error TS2589: Type instantiation is excessively deep and possibly infinite. + // The above happens with as Constructor; + return createTypeUnsafe(type, params) as any; } diff --git a/packages/types/src/interfaceRegistry.ts b/packages/types/src/interfaceRegistry.ts index 8e03cb5666..33a870d5d9 100644 --- a/packages/types/src/interfaceRegistry.ts +++ b/packages/types/src/interfaceRegistry.ts @@ -25,7 +25,7 @@ import { TreasuryProposal } from '@polkadot/types/interfaces/treasury'; import { DispatchResult, DispatchResultOf } from '@polkadot/types/interfaces/utility'; import { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/types/interfaces/attestations'; import { EcdsaSignature, EthereumAddress } from '@polkadot/types/interfaces/claims'; -import { AttestedCandidate, AuctionIndex, BalanceUpload, Bidder, CandidateReceipt, CollatorSignature, EgressQueueRoot, HeadData, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, LeasePeriod, LeasePeriodOf, NewBidder, ParaId, ParaIdOf, ParachainDispatchOrigin, SlotRange, SubId, UpwardMessage, ValidatorIndex, ValidityAttestation, ValidityVote, WinningData, WinningDataEntry } from '@polkadot/types/interfaces/parachains'; +import { AttestedCandidate, AuctionIndex, BalanceUpload, Bidder, CandidateReceipt, CollatorId, CollatorSignature, EgressQueueRoot, HeadData, IncomingParachain, IncomingParachainDeploy, IncomingParachainFixed, LeasePeriod, LeasePeriodOf, NewBidder, ParaId, ParaIdOf, ParaInfo, ParaScheduling, ParachainDispatchOrigin, Retriable, SlotRange, SubId, UpwardMessage, ValidatorIndex, ValidityAttestation, ValidityVote, WinningData, WinningDataEntry } from '@polkadot/types/interfaces/parachains'; import { CallMetadataV0, DoubleMapTypeV3, DoubleMapTypeV4, DoubleMapTypeV5, DoubleMapTypeV6, DoubleMapTypeV7, DoubleMapTypeV8, ErrorMetadataV8, EventMetadataLatest, EventMetadataV0, EventMetadataV1, EventMetadataV2, EventMetadataV3, EventMetadataV4, EventMetadataV5, EventMetadataV6, EventMetadataV7, EventMetadataV8, FunctionArgumentMetadataLatest, FunctionArgumentMetadataV0, FunctionArgumentMetadataV1, FunctionArgumentMetadataV2, FunctionArgumentMetadataV3, FunctionArgumentMetadataV4, FunctionArgumentMetadataV5, FunctionArgumentMetadataV6, FunctionArgumentMetadataV7, FunctionArgumentMetadataV8, FunctionMetadataLatest, FunctionMetadataV0, FunctionMetadataV1, FunctionMetadataV2, FunctionMetadataV3, FunctionMetadataV4, FunctionMetadataV5, FunctionMetadataV6, FunctionMetadataV7, FunctionMetadataV8, MapTypeV0, MapTypeV2, MapTypeV3, MapTypeV4, MapTypeV5, MapTypeV6, MapTypeV7, MapTypeV8, MetadataV0, MetadataV1, ModuleConstantMetadataLatest, ModuleConstantMetadataV6, ModuleConstantMetadataV7, ModuleConstantMetadataV8, ModuleMetadataV0, ModuleMetadataV1, OuterDispatchCallV0, OuterDispatchMetadataV0, OuterEventEventMetadataEventsV0, OuterEventEventMetadataV0, OuterEventMetadataV0, PlainTypeLatest, PlainTypeV0, PlainTypeV2, PlainTypeV3, PlainTypeV4, PlainTypeV5, PlainTypeV6, PlainTypeV7, PlainTypeV8, RuntimeModuleMetadataV0, StorageEntryModifierLatest, StorageEntryModifierV6, StorageEntryModifierV7, StorageEntryModifierV8, StorageFunctionMetadataV0, StorageFunctionMetadataV1, StorageFunctionModifierV0, StorageFunctionModifierV1, StorageFunctionModifierV2, StorageFunctionModifierV3, StorageFunctionModifierV4, StorageFunctionModifierV5, StorageFunctionTypeV0, StorageFunctionTypeV1, StorageMetadataV0 } from '@polkadot/types/interfaces/metadata'; import { ApiId, ChainProperties, ExtrinsicOrHash, ExtrinsicStatus, Health, KeyValueOption, NetworkState, PeerInfo, RpcMethods, RuntimeVersion, RuntimeVersionApi, StorageChangeSet } from '@polkadot/types/interfaces/rpc'; @@ -676,6 +676,9 @@ export interface InterfaceRegistry { CandidateReceipt: CandidateReceipt; 'Option': Option; 'Vec': Vec; + CollatorId: CollatorId; + 'Option': Option; + 'Vec': Vec; CollatorSignature: CollatorSignature; 'Option': Option; 'Vec': Vec; @@ -710,9 +713,18 @@ export interface InterfaceRegistry { ParaIdOf: ParaIdOf; 'Option': Option; 'Vec': Vec; + ParaInfo: ParaInfo; + 'Option': Option; + 'Vec': Vec; ParachainDispatchOrigin: ParachainDispatchOrigin; 'Option': Option; 'Vec': Vec; + ParaScheduling: ParaScheduling; + 'Option': Option; + 'Vec': Vec; + Retriable: Retriable; + 'Option': Option; + 'Vec': Vec; SlotRange: SlotRange; 'Option': Option; 'Vec': Vec; diff --git a/packages/types/src/interfaces/parachains/definitions.ts b/packages/types/src/interfaces/parachains/definitions.ts index 55844e267f..a7c3322c73 100644 --- a/packages/types/src/interfaces/parachains/definitions.ts +++ b/packages/types/src/interfaces/parachains/definitions.ts @@ -26,6 +26,7 @@ export default { fees: 'u64', blockDataHash: 'Hash' }, + CollatorId: 'H256', CollatorSignature: 'Signature', EgressQueueRoot: '(ParaId, Hash)', HeadData: 'Bytes', @@ -52,11 +53,20 @@ export default { }, ParaId: 'u32', ParaIdOf: 'ParaId', + ParaInfo: { + scheduling: 'ParaScheduling' + }, ParachainDispatchOrigin: { - _enum: [ - 'Signed', - 'Parachain' - ] + _enum: ['Signed', 'Parachain'] + }, + ParaScheduling: { + _enum: ['Always', 'Dynamic'] + }, + Retriable: { + _enum: { + Never: 'Null', + WithRetries: 'u32' + } }, SlotRange: { _enum: [ diff --git a/packages/types/src/interfaces/parachains/types.ts b/packages/types/src/interfaces/parachains/types.ts index b5b371e91e..6992d10460 100644 --- a/packages/types/src/interfaces/parachains/types.ts +++ b/packages/types/src/interfaces/parachains/types.ts @@ -3,7 +3,7 @@ import { ITuple } from '@polkadot/types/types'; import { Enum, Struct, Vec } from '@polkadot/types/codec'; -import { Bytes, u32, u64 } from '@polkadot/types/primitive'; +import { Bytes, H256, u32, u64 } from '@polkadot/types/primitive'; import { AccountId, BalanceOf, BlockNumber, Hash, Signature } from '@polkadot/types/interfaces/runtime'; /** Struct */ @@ -52,6 +52,9 @@ export interface CandidateReceipt extends Struct { readonly blockDataHash: Hash; } +/** H256 */ +export interface CollatorId extends H256 {} + /** Signature */ export interface CollatorSignature extends Signature {} @@ -121,6 +124,30 @@ export interface ParaId extends u32 {} /** ParaId */ export interface ParaIdOf extends ParaId {} +/** Struct */ +export interface ParaInfo extends Struct { + /** ParaScheduling */ + readonly scheduling: ParaScheduling; +} + +/** Enum */ +export interface ParaScheduling extends Enum { + /** 0:: Always */ + readonly isAlways: boolean; + /** 1:: Dynamic */ + readonly isDynamic: boolean; +} + +/** Enum */ +export interface Retriable extends Enum { + /** 0:: Never */ + readonly isNever: boolean; + /** 1:: WithRetries(u32) */ + readonly isWithRetries: boolean; + /** u32 */ + readonly asWithRetries: u32; +} + /** Enum */ export interface SlotRange extends Enum { /** 0:: ZeroZero */