Bump metadata (incl. lazy payouts) (#1995)

* Bump metadata (inl. lazy payouts)

* Fix currentElected via generic

* Update tests for latest metadata
This commit is contained in:
Jaco Greeff
2020-03-03 16:13:28 +01:00
committed by GitHub
parent d462a1d6c0
commit 4feed1db5d
14 changed files with 660 additions and 159 deletions
+4 -1
View File
@@ -29,7 +29,7 @@ import { ApiId, BlockHash, ChainProperties, ExtrinsicOrHash, ExtrinsicStatus, He
import { AccountId, AccountIdOf, AccountIndex, Address, AssetId, Balance, BalanceOf, Block, BlockNumber, Call, ChangesTrieConfiguration, Consensus, ConsensusEngineId, Digest, DigestItem, DispatchClass, DispatchInfo, DispatchInfoTo190, Fixed64, H160, H256, H512, Hash, Header, Index, Justification, KeyTypeId, KeyValue, LockIdentifier, LookupSource, LookupTarget, Moment, Origin, Perbill, Percent, Permill, Perquintill, Phantom, PhantomData, PreRuntime, Seal, SealV0, SignedBlock, StorageData, ValidatorId, Weight, WeightMultiplier } from '@polkadot/types/interfaces/runtime';
import { FullIdentification, IdentificationTuple, Keys, SessionIndex, SessionKeys1, SessionKeys2, SessionKeys3, SessionKeys4, SessionKeys5, SessionKeys6 } from '@polkadot/types/interfaces/session';
import { Bid, BidKind, SocietyJudgement, SocietyVote, StrikeCount, VouchingStatus } from '@polkadot/types/interfaces/society';
import { CompactAssignments, CompactScore, ElectionCompute, ElectionResult, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, PhragmenScore, Points, RewardDestination, RewardPoint, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SpanIndex, SpanRecord, StakingLedger, StakingLedgerNew, StakingLedgerTo223, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196 } from '@polkadot/types/interfaces/staking';
import { ActiveEraInfo, CompactAssignments, CompactScore, ElectionCompute, ElectionResult, ElectionStatus, EraIndex, EraPoints, EraRewardPoints, EraRewards, Exposure, Forcing, IndividualExposure, KeyType, MomentOf, Nominations, PhragmenScore, Points, RewardDestination, RewardPoint, SlashJournalEntry, SlashingSpans, SlashingSpansTo204, SpanIndex, SpanRecord, StakingLedger, StakingLedgerNew, StakingLedgerTo223, UnappliedSlash, UnappliedSlashOther, UnlockChunk, ValidatorIndex, ValidatorPrefs, ValidatorPrefsTo145, ValidatorPrefsTo196 } from '@polkadot/types/interfaces/staking';
import { AccountInfo, DigestOf, DispatchError, DispatchErrorModule, DispatchErrorTo198, DispatchResult, DispatchResultOf, DispatchResultTo198, Event, EventId, EventIndex, EventRecord, EventRecordTo76, Key, Phase, RefCount } from '@polkadot/types/interfaces/system';
import { OpenTip, OpenTipFinder, OpenTipTip, TreasuryProposal } from '@polkadot/types/interfaces/treasury';
import { Multiplier } from '@polkadot/types/interfaces/txpayment';
@@ -698,6 +698,9 @@ declare module '@polkadot/types/types/registry' {
EraPoints: EraPoints;
'Option<EraPoints>': Option<EraPoints>;
'Vec<EraPoints>': Vec<EraPoints>;
ActiveEraInfo: ActiveEraInfo;
'Option<ActiveEraInfo>': Option<ActiveEraInfo>;
'Vec<ActiveEraInfo>': Vec<ActiveEraInfo>;
CompactAssignments: CompactAssignments;
'Option<CompactAssignments>': Option<CompactAssignments>;
'Vec<CompactAssignments>': Vec<CompactAssignments>;
@@ -22,7 +22,10 @@ describe('ExtrinsicV2', (): void => {
it('constructs a sane Uint8Array (default)', (): void => {
expect(
new Extrinsic(registry).toU8a()
).toEqual(new Uint8Array([0, 0]));
).toEqual(new Uint8Array([
0, 0, // index
0, 0, 0, 0 // fillBlock Perbill
]));
});
it('creates a unsigned extrinsic', (): void => {
@@ -22,7 +22,10 @@ describe('ExtrinsicV3', (): void => {
it('constructs a sane Uint8Array (default)', (): void => {
expect(
new Extrinsic(registry).toU8a()
).toEqual(new Uint8Array([0, 0]));
).toEqual(new Uint8Array([
0, 0, // index
0, 0, 0, 0 // fillBlock Perbill
]));
});
it('creates a unsigned extrinsic', (): void => {
@@ -19,10 +19,13 @@ const keyring = testingPairs({ type: 'ed25519' }, false);
new Metadata(registry, metadataStatic);
describe('ExtrinsicV4', (): void => {
it('constructs a sane Uint8Array (default)', (): void => {
it.only('constructs a sane Uint8Array (default)', (): void => {
expect(
new Extrinsic(registry).toU8a()
).toEqual(new Uint8Array([0, 0]));
).toEqual(new Uint8Array([
0, 0, // index
0, 0, 0, 0 // fillBlock Perbill
]));
});
it('creates a unsigned extrinsic', (): void => {
@@ -13,6 +13,10 @@ const deprecated = {
export default {
types: {
...deprecated,
ActiveEraInfo: {
index: 'EraIndex',
start: 'Option<Moment>'
},
CompactAssignments: {
votes1: 'Vec<(AccountId, [CompactScore; 0], AccountId)>',
votes2: 'Vec<(AccountId, [CompactScore; 1], AccountId)>',
@@ -2,10 +2,16 @@
/* eslint-disable @typescript-eslint/no-empty-interface */
import { ITuple } from '@polkadot/types/types';
import { BTreeMap, Compact, Enum, Struct, Vec } from '@polkadot/types/codec';
import { BTreeMap, Compact, Enum, Option, Struct, Vec } from '@polkadot/types/codec';
import { bool, u128, u16, u32 } from '@polkadot/types/primitive';
import { AccountId, Balance, BlockNumber, Moment, Perbill } from '@polkadot/types/interfaces/runtime';
/** @name ActiveEraInfo */
export interface ActiveEraInfo extends Struct {
readonly index: EraIndex;
readonly start: Option<Moment>;
}
/** @name CompactAssignments */
export interface CompactAssignments extends Struct {
readonly votes1: Vec<ITuple<[AccountId, Vec<CompactScore>, AccountId]>>;