From 36b217463a51fd43743964c95cb404646ed2fc6e Mon Sep 17 00:00:00 2001 From: Jaco Date: Thu, 29 Jul 2021 14:00:05 +0300 Subject: [PATCH] (some) Bridges types (#3823) --- packages/types/src/augment/registry.ts | 18 ++++++++++++++++- .../src/interfaces/bridges/definitions.ts | 10 ++++++++++ .../types/src/interfaces/bridges/types.ts | 20 ++++++++++++++++++- 3 files changed, 46 insertions(+), 2 deletions(-) diff --git a/packages/types/src/augment/registry.ts b/packages/types/src/augment/registry.ts index ec2bc89f6c..2cb0e91763 100644 --- a/packages/types/src/augment/registry.ts +++ b/packages/types/src/augment/registry.ts @@ -10,7 +10,7 @@ import type { UncleEntryItem } from '@polkadot/types/interfaces/authorship'; import type { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeEpochConfiguration, BabeEquivocationProof, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondaryPlain, RawBabePreDigestSecondaryTo159, RawBabePreDigestSecondaryVRF, RawBabePreDigestTo159, SlotNumber, VrfData, VrfOutput, VrfProof } from '@polkadot/types/interfaces/babe'; import type { AccountData, BalanceLock, BalanceLockTo212, BalanceStatus, Reasons, ReserveData, ReserveIdentifier, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances'; import type { BeefyCommitment, BeefyId, BeefyNextAuthoritySet, BeefyPayload, BeefySignedCommitment, MmrRootHash, ValidatorSetId } from '@polkadot/types/interfaces/beefy'; -import type { BridgedBlockHash, BridgedBlockNumber, BridgedHeader, InitializationData } from '@polkadot/types/interfaces/bridges'; +import type { BridgedBlockHash, BridgedBlockNumber, BridgedHeader, ChainId, Id, InitializationData, LaneId, MessageKey, MessageNonce } from '@polkadot/types/interfaces/bridges'; import type { BlockHash } from '@polkadot/types/interfaces/chain'; import type { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate'; import type { EthereumAddress, StatementKind } from '@polkadot/types/interfaces/claims'; @@ -98,6 +98,7 @@ declare module '@polkadot/types/types/registry' { 'Compact': Compact; 'Compact': Compact; 'Compact': Compact; + 'Compact': Compact; 'Compact': Compact; 'Compact': Compact; 'Compact': Compact; @@ -280,6 +281,7 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -544,6 +546,7 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -585,6 +588,7 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -602,6 +606,8 @@ declare module '@polkadot/types/types/registry' { 'Option': Option; 'Option': Option; 'Option': Option; + 'Option': Option; + 'Option': Option; 'Option': Option; 'Option': Option; 'Option': Option; @@ -1198,6 +1204,7 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1462,6 +1469,7 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1503,6 +1511,7 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -1520,6 +1529,8 @@ declare module '@polkadot/types/types/registry' { 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; + 'Vec': Vec; + 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; 'Vec': Vec; @@ -2116,6 +2127,7 @@ declare module '@polkadot/types/types/registry' { CandidateInfo: CandidateInfo; CandidatePendingAvailability: CandidatePendingAvailability; CandidateReceipt: CandidateReceipt; + ChainId: ChainId; ChainProperties: ChainProperties; ChainType: ChainType; ChangesTrieConfiguration: ChangesTrieConfiguration; @@ -2380,6 +2392,7 @@ declare module '@polkadot/types/types/registry' { I64: I64; i8: i8; I8: I8; + Id: Id; IdentificationTuple: IdentificationTuple; IdentityFields: IdentityFields; IdentityInfo: IdentityInfo; @@ -2421,6 +2434,7 @@ declare module '@polkadot/types/types/registry' { KeyValue: KeyValue; KeyValueOption: KeyValueOption; Kind: Kind; + LaneId: LaneId; LastContribution: LastContribution; LastRuntimeUpgradeInfo: LastRuntimeUpgradeInfo; LeasePeriod: LeasePeriod; @@ -2438,6 +2452,8 @@ declare module '@polkadot/types/types/registry' { MembershipProof: MembershipProof; MessageId: MessageId; MessageIngestionType: MessageIngestionType; + MessageKey: MessageKey; + MessageNonce: MessageNonce; MessageQueueChain: MessageQueueChain; MessagingStateSnapshot: MessagingStateSnapshot; MessagingStateSnapshotEgressEntry: MessagingStateSnapshotEgressEntry; diff --git a/packages/types/src/interfaces/bridges/definitions.ts b/packages/types/src/interfaces/bridges/definitions.ts index 1c015e38cd..ae484f5d87 100644 --- a/packages/types/src/interfaces/bridges/definitions.ts +++ b/packages/types/src/interfaces/bridges/definitions.ts @@ -17,6 +17,16 @@ export default { authorityList: 'AuthorityList', setId: 'SetId', isHalted: 'bool' + }, + Id: '[u8; 4]', + ChainId: 'Id', + LaneId: 'Id', + MessageNonce: 'u64', + // Overrides what is in cumulus, however needed - needs an alias + // MessageId: '(Id, u64)', + MessageKey: { + laneId: 'LaneId', + nonce: 'MessageNonce' } } } as Definitions; diff --git a/packages/types/src/interfaces/bridges/types.ts b/packages/types/src/interfaces/bridges/types.ts index ad175933ca..8939207d2d 100644 --- a/packages/types/src/interfaces/bridges/types.ts +++ b/packages/types/src/interfaces/bridges/types.ts @@ -1,7 +1,7 @@ // Auto-generated via `yarn polkadot-types-from-defs`, do not edit /* eslint-disable */ -import type { Struct, bool } from '@polkadot/types'; +import type { Struct, U8aFixed, bool, u64 } from '@polkadot/types'; import type { AuthorityList, SetId } from '@polkadot/types/interfaces/grandpa'; import type { BlockNumber, H256, Header } from '@polkadot/types/interfaces/runtime'; @@ -14,6 +14,12 @@ export interface BridgedBlockNumber extends BlockNumber {} /** @name BridgedHeader */ export interface BridgedHeader extends Header {} +/** @name ChainId */ +export interface ChainId extends Id {} + +/** @name Id */ +export interface Id extends U8aFixed {} + /** @name InitializationData */ export interface InitializationData extends Struct { readonly header: Header; @@ -22,4 +28,16 @@ export interface InitializationData extends Struct { readonly isHalted: bool; } +/** @name LaneId */ +export interface LaneId extends Id {} + +/** @name MessageKey */ +export interface MessageKey extends Struct { + readonly laneId: LaneId; + readonly nonce: MessageNonce; +} + +/** @name MessageNonce */ +export interface MessageNonce extends u64 {} + export type PHANTOM_BRIDGES = 'bridges';