Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Changes:
- Adjust extrinsic inspect for signed/unsigned
- Add support for `mmr_generateBatchProof` RPC
- Add additional `isCodec` checks to error/event `.is`
- Add support for `Vec<Option<X>>` in typegen
- Update to latest Substrate, Kusama & Polkadot static metadata


## 8.4.2 May 15, 2022
Expand Down
140 changes: 73 additions & 67 deletions packages/api-augment/src/kusama/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,58 +63,6 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
bagsList: {
/**
* The list of thresholds separating the various bags.
*
* Ids are separated into unsorted bags according to their score. This specifies the
* thresholds separating the bags. An id's bag is the largest bag for which the id's score
* is less than or equal to its upper threshold.
*
* When ids are iterated, higher bags are iterated completely before lower bags. This means
* that iteration is _semi-sorted_: ids of higher score tend to come before ids of lower
* score, but peer ids within a particular bag are sorted in insertion order.
*
* # Expressing the constant
*
* This constant must be sorted in strictly increasing order. Duplicate items are not
* permitted.
*
* There is an implied upper limit of `Score::MAX`; that value does not need to be
* specified within the bag. For any two threshold lists, if one ends with
* `Score::MAX`, the other one does not, and they are otherwise equal, the two
* lists will behave identically.
*
* # Calculation
*
* It is recommended to generate the set of thresholds in a geometric series, such that
* there exists some constant ratio such that `threshold[k + 1] == (threshold[k] *
* constant_ratio).max(threshold[k] + 1)` for all `k`.
*
* The helpers in the `/utils/frame/generate-bags` module can simplify this calculation.
*
* # Examples
*
* - If `BagThresholds::get().is_empty()`, then all ids are put into the same bag, and
* iteration is strictly in insertion order.
* - If `BagThresholds::get().len() == 64`, and the thresholds are determined according to
* the procedure given above, then the constant ratio is equal to 2.
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
* the procedure given above, then the constant ratio is approximately equal to 1.248.
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with score 0 or 1 will fall
* into bag 0, an id with score 2 will fall into bag 1, etc.
*
* # Migration
*
* In the event that this list ever changes, a copy of the old bags list must be retained.
* With that `List::migrate` can be called, which will perform the appropriate migration.
**/
bagThresholds: Vec<u64> & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
balances: {
/**
* The minimum amount required to keep an account open.
Expand Down Expand Up @@ -304,20 +252,6 @@ declare module '@polkadot/api-base/types/consts' {
* take place over multiple blocks.
**/
maxElectingVoters: u32 & AugmentedConst<ApiType>;
/**
* Maximum length (bytes) that the mined solution should consume.
*
* The miner will ensure that the total length of the unsigned solution will not exceed
* this value.
**/
minerMaxLength: u32 & AugmentedConst<ApiType>;
/**
* Maximum weight that the miner should consume.
*
* The miner will ensure that the total weight of the unsigned solution will not exceed
* this value, based on [`WeightInfo::submit_unsigned`].
**/
minerMaxWeight: u64 & AugmentedConst<ApiType>;
/**
* The priority of the unsigned transaction submitted in the unsigned-phase
**/
Expand Down Expand Up @@ -358,7 +292,9 @@ declare module '@polkadot/api-base/types/consts' {
/**
* Maximum weight of a signed solution.
*
* This should probably be similar to [`Config::MinerMaxWeight`].
* If [`Config::MinerConfig`] is being implemented to submit signed solutions (outside of
* this pallet), then [`MinerConfig::solution_weight`] is used to compare against
* this value.
**/
signedMaxWeight: u64 & AugmentedConst<ApiType>;
/**
Expand Down Expand Up @@ -519,6 +455,24 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
nominationPools: {
/**
* The minimum pool points-to-balance ratio that must be maintained for it to be `open`.
* This is important in the event slashing takes place and the pool's points-to-balance
* ratio becomes disproportional.
* For a value of 10, the threshold would be a pool points-to-balance ratio of 10:1.
* Such a scenario would also be the equivalent of the pool being 90% slashed.
**/
minPointsToBalance: u32 & AugmentedConst<ApiType>;
/**
* The nomination pool's pallet id.
**/
palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
paras: {
unsignedPriority: u64 & AugmentedConst<ApiType>;
/**
Expand Down Expand Up @@ -945,5 +899,57 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
voterList: {
/**
* The list of thresholds separating the various bags.
*
* Ids are separated into unsorted bags according to their score. This specifies the
* thresholds separating the bags. An id's bag is the largest bag for which the id's score
* is less than or equal to its upper threshold.
*
* When ids are iterated, higher bags are iterated completely before lower bags. This means
* that iteration is _semi-sorted_: ids of higher score tend to come before ids of lower
* score, but peer ids within a particular bag are sorted in insertion order.
*
* # Expressing the constant
*
* This constant must be sorted in strictly increasing order. Duplicate items are not
* permitted.
*
* There is an implied upper limit of `Score::MAX`; that value does not need to be
* specified within the bag. For any two threshold lists, if one ends with
* `Score::MAX`, the other one does not, and they are otherwise equal, the two
* lists will behave identically.
*
* # Calculation
*
* It is recommended to generate the set of thresholds in a geometric series, such that
* there exists some constant ratio such that `threshold[k + 1] == (threshold[k] *
* constant_ratio).max(threshold[k] + 1)` for all `k`.
*
* The helpers in the `/utils/frame/generate-bags` module can simplify this calculation.
*
* # Examples
*
* - If `BagThresholds::get().is_empty()`, then all ids are put into the same bag, and
* iteration is strictly in insertion order.
* - If `BagThresholds::get().len() == 64`, and the thresholds are determined according to
* the procedure given above, then the constant ratio is equal to 2.
* - If `BagThresholds::get().len() == 200`, and the thresholds are determined according to
* the procedure given above, then the constant ratio is approximately equal to 1.248.
* - If the threshold list begins `[1, 2, 3, ...]`, then an id with score 0 or 1 will fall
* into bag 0, an id with score 2 will fall into bag 1, etc.
*
* # Migration
*
* In the event that this list ever changes, a copy of the old bags list must be retained.
* With that `List::migrate` can be called, which will perform the appropriate migration.
**/
bagThresholds: Vec<u64> & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
} // AugmentedConsts
} // declare module
135 changes: 125 additions & 10 deletions packages/api-augment/src/kusama/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,10 @@ declare module '@polkadot/api-base/types/errors' {
* A given equivocation report is valid but already previously reported.
**/
DuplicateOffenceReport: AugmentedError<ApiType>;
/**
* Submitted configuration is invalid.
**/
InvalidConfiguration: AugmentedError<ApiType>;
/**
* An equivocation proof provided as part of an equivocation report is invalid.
**/
Expand All @@ -91,16 +95,6 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
bagsList: {
/**
* A error in the list interface implementation.
**/
List: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
balances: {
/**
* Beneficiary account must pre-exist
Expand Down Expand Up @@ -895,6 +889,117 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
nominationPools: {
/**
* An account is already delegating in another pool. An account may only belong to one
* pool at a time.
**/
AccountBelongsToOtherPool: AugmentedError<ApiType>;
/**
* The member is already unbonding in this era.
**/
AlreadyUnbonding: AugmentedError<ApiType>;
/**
* The pools state cannot be changed.
**/
CanNotChangeState: AugmentedError<ApiType>;
/**
* None of the funds can be withdrawn yet because the bonding duration has not passed.
**/
CannotWithdrawAny: AugmentedError<ApiType>;
/**
* Some error occurred that should never happen. This should be reported to the
* maintainers.
**/
DefensiveError: AugmentedError<ApiType>;
/**
* The caller does not have adequate permissions.
**/
DoesNotHavePermission: AugmentedError<ApiType>;
/**
* The member is fully unbonded (and thus cannot access the bonded and reward pool
* anymore to, for example, collect rewards).
**/
FullyUnbonding: AugmentedError<ApiType>;
/**
* The pool has insufficient balance to bond as a nominator.
**/
InsufficientBond: AugmentedError<ApiType>;
/**
* Too many members in the pool or system.
**/
MaxPoolMembers: AugmentedError<ApiType>;
/**
* The system is maxed out on pools.
**/
MaxPools: AugmentedError<ApiType>;
/**
* The member cannot unbond further chunks due to reaching the limit.
**/
MaxUnbondingLimit: AugmentedError<ApiType>;
/**
* Metadata exceeds [`Config::MaxMetadataLen`]
**/
MetadataExceedsMaxLen: AugmentedError<ApiType>;
/**
* The amount does not meet the minimum bond to either join or create a pool.
**/
MinimumBondNotMet: AugmentedError<ApiType>;
/**
* A pool must be in [`PoolState::Destroying`] in order for the depositor to unbond or for
* other members to be permissionlessly unbonded.
**/
NotDestroying: AugmentedError<ApiType>;
/**
* Not enough points. Ty unbonding less.
**/
NotEnoughPointsToUnbond: AugmentedError<ApiType>;
/**
* Either a) the caller cannot make a valid kick or b) the pool is not destroying.
**/
NotKickerOrDestroying: AugmentedError<ApiType>;
/**
* The caller does not have nominating permissions for the pool.
**/
NotNominator: AugmentedError<ApiType>;
/**
* The depositor must be the only member in the bonded pool in order to unbond. And the
* depositor must be the only member in the sub pools in order to withdraw unbonded.
**/
NotOnlyPoolMember: AugmentedError<ApiType>;
/**
* The pool is not open to join
**/
NotOpen: AugmentedError<ApiType>;
/**
* The transaction could not be executed due to overflow risk for the pool.
**/
OverflowRisk: AugmentedError<ApiType>;
/**
* Partial unbonding now allowed permissionlessly.
**/
PartialUnbondNotAllowedPermissionlessly: AugmentedError<ApiType>;
/**
* An account is not a member.
**/
PoolMemberNotFound: AugmentedError<ApiType>;
/**
* A (bonded) pool id does not exist.
**/
PoolNotFound: AugmentedError<ApiType>;
/**
* A reward pool does not exist. In all cases this is a system logic error.
**/
RewardPoolNotFound: AugmentedError<ApiType>;
/**
* A sub pool does not exist.
**/
SubPoolsNotFound: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
paraInclusion: {
/**
* Bitfield consists of zeros only.
Expand Down Expand Up @@ -1858,6 +1963,16 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
voterList: {
/**
* A error in the list interface implementation.
**/
List: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
xcmPallet: {
/**
* The location is invalid since it already has a subscription from us.
Expand Down
Loading