Skip to content

Commit 84c70a8

Browse files
authored
Bump static metadata (#4844)
1 parent 937efb6 commit 84c70a8

32 files changed

+8032
-4935
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Changes:
77
- Adjust extrinsic inspect for signed/unsigned
88
- Add support for `mmr_generateBatchProof` RPC
99
- Add additional `isCodec` checks to error/event `.is`
10+
- Add support for `Vec<Option<X>>` in typegen
11+
- Update to latest Substrate, Kusama & Polkadot static metadata
1012

1113

1214
## 8.4.2 May 15, 2022

packages/api-augment/src/kusama/consts.ts

Lines changed: 73 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -63,58 +63,6 @@ declare module '@polkadot/api-base/types/consts' {
6363
**/
6464
[key: string]: Codec;
6565
};
66-
bagsList: {
67-
/**
68-
* The list of thresholds separating the various bags.
69-
*
70-
* Ids are separated into unsorted bags according to their score. This specifies the
71-
* thresholds separating the bags. An id's bag is the largest bag for which the id's score
72-
* is less than or equal to its upper threshold.
73-
*
74-
* When ids are iterated, higher bags are iterated completely before lower bags. This means
75-
* that iteration is _semi-sorted_: ids of higher score tend to come before ids of lower
76-
* score, but peer ids within a particular bag are sorted in insertion order.
77-
*
78-
* # Expressing the constant
79-
*
80-
* This constant must be sorted in strictly increasing order. Duplicate items are not
81-
* permitted.
82-
*
83-
* There is an implied upper limit of `Score::MAX`; that value does not need to be
84-
* specified within the bag. For any two threshold lists, if one ends with
85-
* `Score::MAX`, the other one does not, and they are otherwise equal, the two
86-
* lists will behave identically.
87-
*
88-
* # Calculation
89-
*
90-
* It is recommended to generate the set of thresholds in a geometric series, such that
91-
* there exists some constant ratio such that `threshold[k + 1] == (threshold[k] *
92-
* constant_ratio).max(threshold[k] + 1)` for all `k`.
93-
*
94-
* The helpers in the `/utils/frame/generate-bags` module can simplify this calculation.
95-
*
96-
* # Examples
97-
*
98-
* - If `BagThresholds::get().is_empty()`, then all ids are put into the same bag, and
99-
* iteration is strictly in insertion order.
100-
* - If `BagThresholds::get().len() == 64`, and the thresholds are determined according to
101-
* the procedure given above, then the constant ratio is equal to 2.
102-
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
103-
* the procedure given above, then the constant ratio is approximately equal to 1.248.
104-
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with score 0 or 1 will fall
105-
* into bag 0, an id with score 2 will fall into bag 1, etc.
106-
*
107-
* # Migration
108-
*
109-
* In the event that this list ever changes, a copy of the old bags list must be retained.
110-
* With that `List::migrate` can be called, which will perform the appropriate migration.
111-
**/
112-
bagThresholds: Vec<u64> & AugmentedConst<ApiType>;
113-
/**
114-
* Generic const
115-
**/
116-
[key: string]: Codec;
117-
};
11866
balances: {
11967
/**
12068
* The minimum amount required to keep an account open.
@@ -304,20 +252,6 @@ declare module '@polkadot/api-base/types/consts' {
304252
* take place over multiple blocks.
305253
**/
306254
maxElectingVoters: u32 & AugmentedConst<ApiType>;
307-
/**
308-
* Maximum length (bytes) that the mined solution should consume.
309-
*
310-
* The miner will ensure that the total length of the unsigned solution will not exceed
311-
* this value.
312-
**/
313-
minerMaxLength: u32 & AugmentedConst<ApiType>;
314-
/**
315-
* Maximum weight that the miner should consume.
316-
*
317-
* The miner will ensure that the total weight of the unsigned solution will not exceed
318-
* this value, based on [`WeightInfo::submit_unsigned`].
319-
**/
320-
minerMaxWeight: u64 & AugmentedConst<ApiType>;
321255
/**
322256
* The priority of the unsigned transaction submitted in the unsigned-phase
323257
**/
@@ -358,7 +292,9 @@ declare module '@polkadot/api-base/types/consts' {
358292
/**
359293
* Maximum weight of a signed solution.
360294
*
361-
* This should probably be similar to [`Config::MinerMaxWeight`].
295+
* If [`Config::MinerConfig`] is being implemented to submit signed solutions (outside of
296+
* this pallet), then [`MinerConfig::solution_weight`] is used to compare against
297+
* this value.
362298
**/
363299
signedMaxWeight: u64 & AugmentedConst<ApiType>;
364300
/**
@@ -519,6 +455,24 @@ declare module '@polkadot/api-base/types/consts' {
519455
**/
520456
[key: string]: Codec;
521457
};
458+
nominationPools: {
459+
/**
460+
* The minimum pool points-to-balance ratio that must be maintained for it to be `open`.
461+
* This is important in the event slashing takes place and the pool's points-to-balance
462+
* ratio becomes disproportional.
463+
* For a value of 10, the threshold would be a pool points-to-balance ratio of 10:1.
464+
* Such a scenario would also be the equivalent of the pool being 90% slashed.
465+
**/
466+
minPointsToBalance: u32 & AugmentedConst<ApiType>;
467+
/**
468+
* The nomination pool's pallet id.
469+
**/
470+
palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
471+
/**
472+
* Generic const
473+
**/
474+
[key: string]: Codec;
475+
};
522476
paras: {
523477
unsignedPriority: u64 & AugmentedConst<ApiType>;
524478
/**
@@ -945,5 +899,57 @@ declare module '@polkadot/api-base/types/consts' {
945899
**/
946900
[key: string]: Codec;
947901
};
902+
voterList: {
903+
/**
904+
* The list of thresholds separating the various bags.
905+
*
906+
* Ids are separated into unsorted bags according to their score. This specifies the
907+
* thresholds separating the bags. An id's bag is the largest bag for which the id's score
908+
* is less than or equal to its upper threshold.
909+
*
910+
* When ids are iterated, higher bags are iterated completely before lower bags. This means
911+
* that iteration is _semi-sorted_: ids of higher score tend to come before ids of lower
912+
* score, but peer ids within a particular bag are sorted in insertion order.
913+
*
914+
* # Expressing the constant
915+
*
916+
* This constant must be sorted in strictly increasing order. Duplicate items are not
917+
* permitted.
918+
*
919+
* There is an implied upper limit of `Score::MAX`; that value does not need to be
920+
* specified within the bag. For any two threshold lists, if one ends with
921+
* `Score::MAX`, the other one does not, and they are otherwise equal, the two
922+
* lists will behave identically.
923+
*
924+
* # Calculation
925+
*
926+
* It is recommended to generate the set of thresholds in a geometric series, such that
927+
* there exists some constant ratio such that `threshold[k + 1] == (threshold[k] *
928+
* constant_ratio).max(threshold[k] + 1)` for all `k`.
929+
*
930+
* The helpers in the `/utils/frame/generate-bags` module can simplify this calculation.
931+
*
932+
* # Examples
933+
*
934+
* - If `BagThresholds::get().is_empty()`, then all ids are put into the same bag, and
935+
* iteration is strictly in insertion order.
936+
* - If `BagThresholds::get().len() == 64`, and the thresholds are determined according to
937+
* the procedure given above, then the constant ratio is equal to 2.
938+
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
939+
* the procedure given above, then the constant ratio is approximately equal to 1.248.
940+
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with score 0 or 1 will fall
941+
* into bag 0, an id with score 2 will fall into bag 1, etc.
942+
*
943+
* # Migration
944+
*
945+
* In the event that this list ever changes, a copy of the old bags list must be retained.
946+
* With that `List::migrate` can be called, which will perform the appropriate migration.
947+
**/
948+
bagThresholds: Vec<u64> & AugmentedConst<ApiType>;
949+
/**
950+
* Generic const
951+
**/
952+
[key: string]: Codec;
953+
};
948954
} // AugmentedConsts
949955
} // declare module

packages/api-augment/src/kusama/errors.ts

Lines changed: 125 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ declare module '@polkadot/api-base/types/errors' {
7878
* A given equivocation report is valid but already previously reported.
7979
**/
8080
DuplicateOffenceReport: AugmentedError<ApiType>;
81+
/**
82+
* Submitted configuration is invalid.
83+
**/
84+
InvalidConfiguration: AugmentedError<ApiType>;
8185
/**
8286
* An equivocation proof provided as part of an equivocation report is invalid.
8387
**/
@@ -91,16 +95,6 @@ declare module '@polkadot/api-base/types/errors' {
9195
**/
9296
[key: string]: AugmentedError<ApiType>;
9397
};
94-
bagsList: {
95-
/**
96-
* A error in the list interface implementation.
97-
**/
98-
List: AugmentedError<ApiType>;
99-
/**
100-
* Generic error
101-
**/
102-
[key: string]: AugmentedError<ApiType>;
103-
};
10498
balances: {
10599
/**
106100
* Beneficiary account must pre-exist
@@ -895,6 +889,117 @@ declare module '@polkadot/api-base/types/errors' {
895889
**/
896890
[key: string]: AugmentedError<ApiType>;
897891
};
892+
nominationPools: {
893+
/**
894+
* An account is already delegating in another pool. An account may only belong to one
895+
* pool at a time.
896+
**/
897+
AccountBelongsToOtherPool: AugmentedError<ApiType>;
898+
/**
899+
* The member is already unbonding in this era.
900+
**/
901+
AlreadyUnbonding: AugmentedError<ApiType>;
902+
/**
903+
* The pools state cannot be changed.
904+
**/
905+
CanNotChangeState: AugmentedError<ApiType>;
906+
/**
907+
* None of the funds can be withdrawn yet because the bonding duration has not passed.
908+
**/
909+
CannotWithdrawAny: AugmentedError<ApiType>;
910+
/**
911+
* Some error occurred that should never happen. This should be reported to the
912+
* maintainers.
913+
**/
914+
DefensiveError: AugmentedError<ApiType>;
915+
/**
916+
* The caller does not have adequate permissions.
917+
**/
918+
DoesNotHavePermission: AugmentedError<ApiType>;
919+
/**
920+
* The member is fully unbonded (and thus cannot access the bonded and reward pool
921+
* anymore to, for example, collect rewards).
922+
**/
923+
FullyUnbonding: AugmentedError<ApiType>;
924+
/**
925+
* The pool has insufficient balance to bond as a nominator.
926+
**/
927+
InsufficientBond: AugmentedError<ApiType>;
928+
/**
929+
* Too many members in the pool or system.
930+
**/
931+
MaxPoolMembers: AugmentedError<ApiType>;
932+
/**
933+
* The system is maxed out on pools.
934+
**/
935+
MaxPools: AugmentedError<ApiType>;
936+
/**
937+
* The member cannot unbond further chunks due to reaching the limit.
938+
**/
939+
MaxUnbondingLimit: AugmentedError<ApiType>;
940+
/**
941+
* Metadata exceeds [`Config::MaxMetadataLen`]
942+
**/
943+
MetadataExceedsMaxLen: AugmentedError<ApiType>;
944+
/**
945+
* The amount does not meet the minimum bond to either join or create a pool.
946+
**/
947+
MinimumBondNotMet: AugmentedError<ApiType>;
948+
/**
949+
* A pool must be in [`PoolState::Destroying`] in order for the depositor to unbond or for
950+
* other members to be permissionlessly unbonded.
951+
**/
952+
NotDestroying: AugmentedError<ApiType>;
953+
/**
954+
* Not enough points. Ty unbonding less.
955+
**/
956+
NotEnoughPointsToUnbond: AugmentedError<ApiType>;
957+
/**
958+
* Either a) the caller cannot make a valid kick or b) the pool is not destroying.
959+
**/
960+
NotKickerOrDestroying: AugmentedError<ApiType>;
961+
/**
962+
* The caller does not have nominating permissions for the pool.
963+
**/
964+
NotNominator: AugmentedError<ApiType>;
965+
/**
966+
* The depositor must be the only member in the bonded pool in order to unbond. And the
967+
* depositor must be the only member in the sub pools in order to withdraw unbonded.
968+
**/
969+
NotOnlyPoolMember: AugmentedError<ApiType>;
970+
/**
971+
* The pool is not open to join
972+
**/
973+
NotOpen: AugmentedError<ApiType>;
974+
/**
975+
* The transaction could not be executed due to overflow risk for the pool.
976+
**/
977+
OverflowRisk: AugmentedError<ApiType>;
978+
/**
979+
* Partial unbonding now allowed permissionlessly.
980+
**/
981+
PartialUnbondNotAllowedPermissionlessly: AugmentedError<ApiType>;
982+
/**
983+
* An account is not a member.
984+
**/
985+
PoolMemberNotFound: AugmentedError<ApiType>;
986+
/**
987+
* A (bonded) pool id does not exist.
988+
**/
989+
PoolNotFound: AugmentedError<ApiType>;
990+
/**
991+
* A reward pool does not exist. In all cases this is a system logic error.
992+
**/
993+
RewardPoolNotFound: AugmentedError<ApiType>;
994+
/**
995+
* A sub pool does not exist.
996+
**/
997+
SubPoolsNotFound: AugmentedError<ApiType>;
998+
/**
999+
* Generic error
1000+
**/
1001+
[key: string]: AugmentedError<ApiType>;
1002+
};
8981003
paraInclusion: {
8991004
/**
9001005
* Bitfield consists of zeros only.
@@ -1858,6 +1963,16 @@ declare module '@polkadot/api-base/types/errors' {
18581963
**/
18591964
[key: string]: AugmentedError<ApiType>;
18601965
};
1966+
voterList: {
1967+
/**
1968+
* A error in the list interface implementation.
1969+
**/
1970+
List: AugmentedError<ApiType>;
1971+
/**
1972+
* Generic error
1973+
**/
1974+
[key: string]: AugmentedError<ApiType>;
1975+
};
18611976
xcmPallet: {
18621977
/**
18631978
* The location is invalid since it already has a subscription from us.

0 commit comments

Comments
 (0)