From b9142bcf837b116c26850611cfa1e57eda06bf90 Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Tue, 13 Aug 2019 07:36:56 +0200 Subject: [PATCH] Add Forcing enum (staking) (#1300) --- packages/types/src/interfaceRegistry.ts | 5 ++++- packages/types/src/interfaces/staking/definitions.ts | 7 +++++++ packages/types/src/interfaces/staking/types.ts | 10 ++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/types/src/interfaceRegistry.ts b/packages/types/src/interfaceRegistry.ts index 5e7b05fcb1..0ef131d275 100644 --- a/packages/types/src/interfaceRegistry.ts +++ b/packages/types/src/interfaceRegistry.ts @@ -19,7 +19,7 @@ import { AssetOptions, Owner, PermissionLatest, PermissionVersions, PermissionsV import { AuthorityWeight, NextAuthority, PendingPause, PendingResume, StoredPendingChange, StoredState } from './interfaces/grandpa'; import { AuthIndex, AuthoritySignature, Heartbeat, OpaqueMultiaddr, OpaqueNetworkState, OpaquePeerId } from './interfaces/imOnline'; import { Keys, SessionIndex, SessionKeysPolkadot, SessionKeysSubstrate } from './interfaces/session'; -import { EraIndex, EraRewards, Exposure, IndividualExposure, MomentOf, RewardDestination, StakingLedger, UnlockChunk, ValidatorPrefs } from './interfaces/staking'; +import { EraIndex, EraRewards, Exposure, Forcing, IndividualExposure, MomentOf, RewardDestination, StakingLedger, UnlockChunk, ValidatorPrefs } from './interfaces/staking'; import { DigestOf, Event, EventId, EventIndex, EventRecord, EventRecord0to76, Key, Phase } from './interfaces/system'; import { TreasuryProposal } from './interfaces/treasury'; import { BlockAttestations, IncludedBlocks, MoreAttestations } from './interfaces/attestations'; @@ -472,6 +472,9 @@ export interface InterfaceRegistry { Exposure: Exposure; 'Option': Option; 'Vec': Vec; + Forcing: Forcing; + 'Option': Option; + 'Vec': Vec; IndividualExposure: IndividualExposure; 'Option': Option; 'Vec': Vec; diff --git a/packages/types/src/interfaces/staking/definitions.ts b/packages/types/src/interfaces/staking/definitions.ts index 3f84400d55..38688d7dee 100644 --- a/packages/types/src/interfaces/staking/definitions.ts +++ b/packages/types/src/interfaces/staking/definitions.ts @@ -14,6 +14,13 @@ export default { own: 'Compact', others: 'Vec' }, + Forcing: { + _enum: [ + 'NotForcing', + 'ForceNew', + 'ForceNone' + ] + }, IndividualExposure: { who: 'AccountId', value: 'Compact' diff --git a/packages/types/src/interfaces/staking/types.ts b/packages/types/src/interfaces/staking/types.ts index c0bac42c1e..5ef2a2ca6b 100644 --- a/packages/types/src/interfaces/staking/types.ts +++ b/packages/types/src/interfaces/staking/types.ts @@ -26,6 +26,16 @@ export interface Exposure extends Struct { readonly others: Vec; } +/** Enum */ +export interface Forcing extends Enum { + /** 0:: NotForcing */ + readonly isNotForcing: boolean; + /** 1:: ForceNew */ + readonly isForceNew: boolean; + /** 2:: ForceNone */ + readonly isForceNone: boolean; +} + /** Struct */ export interface IndividualExposure extends Struct { /** AccountId */