Add correct election Phase type (#3280)
This commit is contained in:
@@ -44,7 +44,7 @@ import type { SiField, SiLookupTypeId, SiPath, SiType, SiTypeDef, SiTypeDefArray
|
||||
import type { Period, Priority, SchedulePeriod, SchedulePriority, Scheduled, ScheduledTo254, TaskAddress } from '@polkadot/types/interfaces/scheduler';
|
||||
import type { FullIdentification, IdentificationTuple, Keys, MembershipProof, SessionIndex, SessionKeys1, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6, SessionKeys7, SessionKeys8, SessionKeys9, ValidatorCount } from '@polkadot/types/interfaces/session';
|
||||
import type { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society';
|
||||
import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactScore, CompactScoreCompact, ElectionCompute, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, ExtendedBalance, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RawSolution, ReadySolution, RewardDestination, RewardPoint, RoundSnapshot, SeatHolder, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SolutionOrSnapshotSize, SolutionSupport, SolutionSupports, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, VoteWeight, Voter } from '@polkadot/types/interfaces/staking';
|
||||
import type { ActiveEraInfo, CompactAssignments, CompactAssignmentsTo257, CompactScore, CompactScoreCompact, ElectionCompute, ElectionPhase, ElectionResult, ElectionScore, ElectionSize, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, ExtendedBalance, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, NominatorIndex, NominatorIndexCompact, OffchainAccuracy, OffchainAccuracyCompact, PhragmenScore, Points, RawSolution, ReadySolution, RewardDestination, RewardPoint, RoundSnapshot, SeatHolder, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SolutionOrSnapshotSize, SolutionSupport, SolutionSupports, SpanIndex, SpanRecord, StakingLedger, StakingLedgerTo223, StakingLedgerTo240, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorIndexCompact, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196, ValidatorPrefsWithBlocked, ValidatorPrefsWithCommission, VoteWeight, Voter } from '@polkadot/types/interfaces/staking';
|
||||
import type { ApiId, KeyValueOption, ReadProof, RuntimeVersion, RuntimeVersionApi, StorageChangeSet } from '@polkadot/types/interfaces/state';
|
||||
import type { WeightToFeeCoefficient } from '@polkadot/types/interfaces/support';
|
||||
import type { AccountInfo, AccountInfoWithDualRefCount, AccountInfoWithProviders, AccountInfoWithRefCount, AccountInfoWithTripleRefCount, ApplyExtrinsicResult, BlockLength, BlockWeights, ChainProperties, ChainType, ConsumedWeight, DigestOf, DispatchClass, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchInfo, DispatchInfoTo190, DispatchInfoTo244, DispatchOutcome, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, Health, InvalidTransaction, Key, LastRuntimeUpgradeInfo, NetworkState, NetworkStatePeerset, NetworkStatePeersetInfo, NodeRole, NotConnectedPeer, Peer, PeerEndpoint, PeerEndpointAddr, PeerInfo, PeerPing, PerDispatchClassU32, PerDispatchClassWeight, PerDispatchClassWeightsPerClass, Phase, RawOrigin, RefCount, RefCountTo259, SyncState, SystemOrigin, TransactionValidityError, UnknownTransaction, WeightPerClass } from '@polkadot/types/interfaces/system';
|
||||
@@ -325,6 +325,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Option<EcdsaSignature>': Option<EcdsaSignature>;
|
||||
'Option<Ed25519Signature>': Option<Ed25519Signature>;
|
||||
'Option<ElectionCompute>': Option<ElectionCompute>;
|
||||
'Option<ElectionPhase>': Option<ElectionPhase>;
|
||||
'Option<ElectionResult>': Option<ElectionResult>;
|
||||
'Option<ElectionScore>': Option<ElectionScore>;
|
||||
'Option<ElectionSize>': Option<ElectionSize>;
|
||||
@@ -1070,6 +1071,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
'Vec<EcdsaSignature>': Vec<EcdsaSignature>;
|
||||
'Vec<Ed25519Signature>': Vec<Ed25519Signature>;
|
||||
'Vec<ElectionCompute>': Vec<ElectionCompute>;
|
||||
'Vec<ElectionPhase>': Vec<ElectionPhase>;
|
||||
'Vec<ElectionResult>': Vec<ElectionResult>;
|
||||
'Vec<ElectionScore>': Vec<ElectionScore>;
|
||||
'Vec<ElectionSize>': Vec<ElectionSize>;
|
||||
@@ -1815,6 +1817,7 @@ declare module '@polkadot/types/types/registry' {
|
||||
EcdsaSignature: EcdsaSignature;
|
||||
Ed25519Signature: Ed25519Signature;
|
||||
ElectionCompute: ElectionCompute;
|
||||
ElectionPhase: ElectionPhase;
|
||||
ElectionResult: ElectionResult;
|
||||
ElectionScore: ElectionScore;
|
||||
ElectionSize: ElectionSize;
|
||||
|
||||
@@ -54,7 +54,16 @@ const phragmen = {
|
||||
CompactScore: '(ValidatorIndex, OffchainAccuracy)',
|
||||
CompactScoreCompact: '(ValidatorIndexCompact, OffchainAccuracyCompact)',
|
||||
ElectionCompute: {
|
||||
_enum: ['OnChain', 'Signed', 'Authority']
|
||||
// in previous versions the last entry was "AuthorityId"
|
||||
// (since no data attached, and it is via SCALE can rename)
|
||||
_enum: ['OnChain', 'Signed', 'Unsigned']
|
||||
},
|
||||
ElectionPhase: {
|
||||
_enum: {
|
||||
Off: null,
|
||||
Signed: null,
|
||||
Unsigned: '(bool, BlockNumber)'
|
||||
}
|
||||
},
|
||||
ElectionResult: {
|
||||
compute: 'ElectionCompute',
|
||||
|
||||
@@ -61,7 +61,15 @@ export interface CompactScoreCompact extends ITuple<[ValidatorIndexCompact, Offc
|
||||
export interface ElectionCompute extends Enum {
|
||||
readonly isOnChain: boolean;
|
||||
readonly isSigned: boolean;
|
||||
readonly isAuthority: boolean;
|
||||
readonly isUnsigned: boolean;
|
||||
}
|
||||
|
||||
/** @name ElectionPhase */
|
||||
export interface ElectionPhase extends Enum {
|
||||
readonly isOff: boolean;
|
||||
readonly isSigned: boolean;
|
||||
readonly isUnsigned: boolean;
|
||||
readonly asUnsigned: ITuple<[bool, BlockNumber]>;
|
||||
}
|
||||
|
||||
/** @name ElectionResult */
|
||||
|
||||
Reference in New Issue
Block a user