diff --git a/packages/types/src/augment/registry.ts b/packages/types/src/augment/registry.ts index 0a74c7f6aa..7039b1d4f0 100644 --- a/packages/types/src/augment/registry.ts +++ b/packages/types/src/augment/registry.ts @@ -7,7 +7,7 @@ import { BlockAttestations, IncludedBlocks, MoreAttestations } from '@polkadot/t import { RawAuraPreDigest } from '@polkadot/types/interfaces/aura'; import { ExtrinsicOrHash, ExtrinsicStatus } from '@polkadot/types/interfaces/author'; import { UncleEntryItem } from '@polkadot/types/interfaces/authorship'; -import { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, BabeWeight, EpochAuthorship, MaybeRandomness, MaybeVrf, NextConfigDescriptor, NextConfigDescriptorV1, Randomness, RawBabePreDigest, RawBabePreDigestCompat, RawBabePreDigestPrimary, RawBabePreDigestPrimaryTo159, RawBabePreDigestSecondary, RawBabePreDigestSecondaryTo159, RawBabePreDigestTo159, SlotNumber, VrfData, VrfProof } from '@polkadot/types/interfaces/babe'; +import { AllowedSlots, BabeAuthorityWeight, BabeBlockWeight, 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 { AccountData, BalanceLock, BalanceLockTo212, Reasons, ReleasesBalances, VestingSchedule, WithdrawReasons } from '@polkadot/types/interfaces/balances'; import { BlockHash } from '@polkadot/types/interfaces/chain'; import { PrefixedStorageKey } from '@polkadot/types/interfaces/childstate'; @@ -341,9 +341,12 @@ declare module '@polkadot/types/types/registry' { RawBabePreDigestPrimary: RawBabePreDigestPrimary; 'Option': Option; 'Vec': Vec; - RawBabePreDigestSecondary: RawBabePreDigestSecondary; - 'Option': Option; - 'Vec': Vec; + RawBabePreDigestSecondaryPlain: RawBabePreDigestSecondaryPlain; + 'Option': Option; + 'Vec': Vec; + RawBabePreDigestSecondaryVRF: RawBabePreDigestSecondaryVRF; + 'Option': Option; + 'Vec': Vec; RawBabePreDigestTo159: RawBabePreDigestTo159; 'Option': Option; 'Vec': Vec; @@ -363,6 +366,9 @@ declare module '@polkadot/types/types/registry' { VrfData: VrfData; 'Option': Option; 'Vec': Vec; + VrfOutput: VrfOutput; + 'Option': Option; + 'Vec': Vec; VrfProof: VrfProof; 'Option': Option; 'Vec': Vec; diff --git a/packages/types/src/interfaces/babe/definitions.ts b/packages/types/src/interfaces/babe/definitions.ts index 49c98434e6..48fdd68f86 100644 --- a/packages/types/src/interfaces/babe/definitions.ts +++ b/packages/types/src/interfaces/babe/definitions.ts @@ -44,19 +44,26 @@ export default { _enum: { Phantom: 'Null', // index starts at 1... empty slot at 0 Primary: 'RawBabePreDigestPrimary', - Secondary: 'RawBabePreDigestSecondary' + SecondaryPlain: 'RawBabePreDigestSecondaryPlain', + SecondaryVRF: 'RawBabePreDigestSecondaryVRF' } }, RawBabePreDigestPrimary: { authorityIndex: 'u32', // AuthorityIndex (also in aura) slotNumber: 'SlotNumber', - vrfOutput: 'VrfData', + vrfOutput: 'VrfOutput', vrfProof: 'VrfProof' }, - RawBabePreDigestSecondary: { + RawBabePreDigestSecondaryPlain: { authorityIndex: 'u32', // AuthorityIndex (also in aura) slotNumber: 'SlotNumber' }, + RawBabePreDigestSecondaryVRF: { + authorityIndex: 'u32', + slotNumber: 'SlotNumber', + vrfOutput: 'VrfOutput', + vrfProof: 'VrfProof' + }, RawBabePreDigestTo159: { _enum: { Primary: 'RawBabePreDigestPrimaryTo159', @@ -67,7 +74,7 @@ export default { authorityIndex: 'u32', slotNumber: 'SlotNumber', weight: 'BabeBlockWeight', - vrfOutput: 'VrfData', + vrfOutput: 'VrfOutput', vrfProof: 'VrfProof' }, RawBabePreDigestSecondaryTo159: { @@ -83,11 +90,13 @@ export default { _enum: { Zero: 'u32', One: 'u32', - Two: 'u32' + Two: 'u32', + Three: 'u32' } }, SlotNumber: 'u64', VrfData: '[u8; 32]', + VrfOutput: '[u8; 32]', VrfProof: '[u8; 64]' } } as Definitions; diff --git a/packages/types/src/interfaces/babe/types.ts b/packages/types/src/interfaces/babe/types.ts index 3b0ddce458..d6350accac 100644 --- a/packages/types/src/interfaces/babe/types.ts +++ b/packages/types/src/interfaces/babe/types.ts @@ -55,8 +55,10 @@ export interface RawBabePreDigest extends Enum { readonly isPhantom: boolean; readonly isPrimary: boolean; readonly asPrimary: RawBabePreDigestPrimary; - readonly isSecondary: boolean; - readonly asSecondary: RawBabePreDigestSecondary; + readonly isSecondaryPlain: boolean; + readonly asSecondaryPlain: RawBabePreDigestSecondaryPlain; + readonly isSecondaryVrf: boolean; + readonly asSecondaryVrf: RawBabePreDigestSecondaryVRF; } /** @name RawBabePreDigestCompat */ @@ -67,13 +69,15 @@ export interface RawBabePreDigestCompat extends Enum { readonly asOne: u32; readonly isTwo: boolean; readonly asTwo: u32; + readonly isThree: boolean; + readonly asThree: u32; } /** @name RawBabePreDigestPrimary */ export interface RawBabePreDigestPrimary extends Struct { readonly authorityIndex: u32; readonly slotNumber: SlotNumber; - readonly vrfOutput: VrfData; + readonly vrfOutput: VrfOutput; readonly vrfProof: VrfProof; } @@ -82,12 +86,12 @@ export interface RawBabePreDigestPrimaryTo159 extends Struct { readonly authorityIndex: u32; readonly slotNumber: SlotNumber; readonly weight: BabeBlockWeight; - readonly vrfOutput: VrfData; + readonly vrfOutput: VrfOutput; readonly vrfProof: VrfProof; } -/** @name RawBabePreDigestSecondary */ -export interface RawBabePreDigestSecondary extends Struct { +/** @name RawBabePreDigestSecondaryPlain */ +export interface RawBabePreDigestSecondaryPlain extends Struct { readonly authorityIndex: u32; readonly slotNumber: SlotNumber; } @@ -99,6 +103,14 @@ export interface RawBabePreDigestSecondaryTo159 extends Struct { readonly weight: BabeBlockWeight; } +/** @name RawBabePreDigestSecondaryVRF */ +export interface RawBabePreDigestSecondaryVRF extends Struct { + readonly authorityIndex: u32; + readonly slotNumber: SlotNumber; + readonly vrfOutput: VrfOutput; + readonly vrfProof: VrfProof; +} + /** @name RawBabePreDigestTo159 */ export interface RawBabePreDigestTo159 extends Enum { readonly isPrimary: boolean; @@ -113,6 +125,9 @@ export interface SlotNumber extends u64 {} /** @name VrfData */ export interface VrfData extends U8aFixed {} +/** @name VrfOutput */ +export interface VrfOutput extends U8aFixed {} + /** @name VrfProof */ export interface VrfProof extends U8aFixed {}