Skip to content

Commit

Permalink
update types
Browse files Browse the repository at this point in the history
  • Loading branch information
1xstj committed Aug 3, 2023
1 parent 6649bed commit 79916af
Show file tree
Hide file tree
Showing 11 changed files with 1,232 additions and 1,667 deletions.
18 changes: 17 additions & 1 deletion types/src/interfaces/augment-api-consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,24 @@ declare module '@polkadot/api-base/types/consts' {
};
balances: {
/**
* The minimum amount required to keep an account open.
* The minimum amount required to keep an account open. MUST BE GREATER THAN ZERO!
*
* If you *really* need it to be zero, you can enable the feature `insecure_zero_ed` for
* this pallet. However, you do so at your own risk: this will open up a major DoS vector.
* In case you have multiple sources of provider references, you may also get unexpected
* behaviour if you set this to zero.
*
* Bottom line: Do yourself a favour and make it at least one!
**/
existentialDeposit: u128 & AugmentedConst<ApiType>;
/**
* The maximum number of individual freeze locks that can exist on an account at any time.
**/
maxFreezes: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of holds that can exist on an account at any time.
**/
maxHolds: u32 & AugmentedConst<ApiType>;
/**
* The maximum number of locks that should exist on an account.
* Not strictly enforced, but used for weight estimation.
Expand Down Expand Up @@ -236,6 +251,7 @@ declare module '@polkadot/api-base/types/consts' {
minerMaxLength: u32 & AugmentedConst<ApiType>;
minerMaxVotesPerVoter: u32 & AugmentedConst<ApiType>;
minerMaxWeight: SpWeightsWeightV2Weight & AugmentedConst<ApiType>;
minerMaxWinners: u32 & AugmentedConst<ApiType>;
/**
* The priority of the unsigned transaction submitted in the unsigned-phase
**/
Expand Down
70 changes: 61 additions & 9 deletions types/src/interfaces/augment-api-errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,35 +23,43 @@ declare module '@polkadot/api-base/types/errors' {
};
balances: {
/**
* Beneficiary account must pre-exist
* Beneficiary account must pre-exist.
**/
DeadAccount: AugmentedError<ApiType>;
/**
* Value too low to create account due to existential deposit
* Value too low to create account due to existential deposit.
**/
ExistentialDeposit: AugmentedError<ApiType>;
/**
* A vesting schedule already exists for this account
* A vesting schedule already exists for this account.
**/
ExistingVestingSchedule: AugmentedError<ApiType>;
/**
* Transfer/payment would kill account.
**/
Expendability: AugmentedError<ApiType>;
/**
* Balance too low to send value.
**/
InsufficientBalance: AugmentedError<ApiType>;
/**
* Transfer/payment would kill account
* Account liquidity restrictions prevent withdrawal.
**/
KeepAlive: AugmentedError<ApiType>;
LiquidityRestrictions: AugmentedError<ApiType>;
/**
* Account liquidity restrictions prevent withdrawal
* Number of freezes exceed `MaxFreezes`.
**/
LiquidityRestrictions: AugmentedError<ApiType>;
TooManyFreezes: AugmentedError<ApiType>;
/**
* Number of named reserves exceed MaxReserves
* Number of holds exceed `MaxHolds`.
**/
TooManyHolds: AugmentedError<ApiType>;
/**
* Number of named reserves exceed `MaxReserves`.
**/
TooManyReserves: AugmentedError<ApiType>;
/**
* Vesting balance too high to send value
* Vesting balance too high to send value.
**/
VestingBalance: AugmentedError<ApiType>;
/**
Expand Down Expand Up @@ -212,18 +220,34 @@ declare module '@polkadot/api-base/types/errors' {
* Proposal bytes length is invalid
**/
InvalidProposalBytesLength: AugmentedError<ApiType>;
/**
* the signed data is invalid
**/
InvalidSignedData: AugmentedError<ApiType>;
/**
* Error names should be descriptive.
**/
NoneValue: AugmentedError<ApiType>;
/**
* The signature does not match current active key
**/
NotSignedByCurrentDKG: AugmentedError<ApiType>;
/**
* Proposal with the ID has already been submitted
**/
ProposalAlreadyExists: AugmentedError<ApiType>;
/**
* Proposal batch does not exist
**/
ProposalBatchNotFound: AugmentedError<ApiType>;
/**
* No proposal with the ID was found
**/
ProposalDoesNotExists: AugmentedError<ApiType>;
/**
* the prposal exists on runtime and is valid
**/
ProposalExistsAndIsValid: AugmentedError<ApiType>;
/**
* Proposal format is invalid
**/
Expand Down Expand Up @@ -573,6 +597,22 @@ declare module '@polkadot/api-base/types/errors' {
* None of the funds can be withdrawn yet because the bonding duration has not passed.
**/
CannotWithdrawAny: AugmentedError<ApiType>;
/**
* The submitted changes to commission change rate are not allowed.
**/
CommissionChangeRateNotAllowed: AugmentedError<ApiType>;
/**
* Not enough blocks have surpassed since the last commission update.
**/
CommissionChangeThrottled: AugmentedError<ApiType>;
/**
* The supplied commission exceeds global maximum commission.
**/
CommissionExceedsGlobalMaximum: AugmentedError<ApiType>;
/**
* The supplied commission exceeds the max allowed commission.
**/
CommissionExceedsMaximum: AugmentedError<ApiType>;
/**
* Some error occurred that should never happen. This should be reported to the
* maintainers.
Expand All @@ -591,6 +631,10 @@ declare module '@polkadot/api-base/types/errors' {
* Pool id provided is not correct/usable.
**/
InvalidPoolId: AugmentedError<ApiType>;
/**
* The pool's max commission cannot be set higher than the existing value.
**/
MaxCommissionRestricted: AugmentedError<ApiType>;
/**
* Too many members in the pool or system.
**/
Expand All @@ -615,6 +659,14 @@ declare module '@polkadot/api-base/types/errors' {
* permissions for the pool. Members can never unbond to a value below `MinJoinBond`.
**/
MinimumBondNotMet: AugmentedError<ApiType>;
/**
* No commission current has been set.
**/
NoCommissionCurrentSet: AugmentedError<ApiType>;
/**
* There is no pending commission to claim.
**/
NoPendingCommission: AugmentedError<ApiType>;
/**
* A pool must be in [`PoolState::Destroying`] in order for the depositor to unbond or for
* other members to be permissionlessly unbonded.
Expand Down
94 changes: 87 additions & 7 deletions types/src/interfaces/augment-api-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import '@polkadot/api-base/types/events';

import type { ApiTypes, AugmentedEvent } from '@polkadot/api-base/types';
import type { Bytes, Null, Option, Result, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec';
import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u16, u32, u64 } from '@polkadot/types-codec';
import type { ITuple } from '@polkadot/types-codec/types';
import type { AccountId32, H256, Perbill } from '@polkadot/types/interfaces/runtime';

Expand All @@ -32,7 +32,11 @@ declare module '@polkadot/api-base/types/events' {
/**
* A balance was set by root.
**/
BalanceSet: AugmentedEvent<ApiType, [who: AccountId32, free: u128, reserved: u128], { who: AccountId32, free: u128, reserved: u128 }>;
BalanceSet: AugmentedEvent<ApiType, [who: AccountId32, free: u128], { who: AccountId32, free: u128 }>;
/**
* Some amount was burned from an account.
**/
Burned: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Some amount was deposited (e.g. for transaction fees).
**/
Expand All @@ -46,6 +50,26 @@ declare module '@polkadot/api-base/types/events' {
* An account was created with some free balance.
**/
Endowed: AugmentedEvent<ApiType, [account: AccountId32, freeBalance: u128], { account: AccountId32, freeBalance: u128 }>;
/**
* Some balance was frozen.
**/
Frozen: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Total issuance was increased by `amount`, creating a credit to be balanced.
**/
Issued: AugmentedEvent<ApiType, [amount: u128], { amount: u128 }>;
/**
* Some balance was locked.
**/
Locked: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Some amount was minted into an account.
**/
Minted: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Total issuance was decreased by `amount`, creating a debt to be balanced.
**/
Rescinded: AugmentedEvent<ApiType, [amount: u128], { amount: u128 }>;
/**
* Some balance was reserved (moved from free to reserved).
**/
Expand All @@ -55,18 +79,38 @@ declare module '@polkadot/api-base/types/events' {
* Final argument indicates the destination balance type.
**/
ReserveRepatriated: AugmentedEvent<ApiType, [from: AccountId32, to: AccountId32, amount: u128, destinationStatus: FrameSupportTokensMiscBalanceStatus], { from: AccountId32, to: AccountId32, amount: u128, destinationStatus: FrameSupportTokensMiscBalanceStatus }>;
/**
* Some amount was restored into an account.
**/
Restored: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Some amount was removed from the account (e.g. for misbehavior).
**/
Slashed: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Some amount was suspended from an account (it can be restored later).
**/
Suspended: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Some balance was thawed.
**/
Thawed: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Transfer succeeded.
**/
Transfer: AugmentedEvent<ApiType, [from: AccountId32, to: AccountId32, amount: u128], { from: AccountId32, to: AccountId32, amount: u128 }>;
/**
* Some balance was unlocked.
**/
Unlocked: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* Some balance was unreserved (moved from reserved to free).
**/
Unreserved: AugmentedEvent<ApiType, [who: AccountId32, amount: u128], { who: AccountId32, amount: u128 }>;
/**
* An account was upgraded.
**/
Upgraded: AugmentedEvent<ApiType, [who: AccountId32], { who: AccountId32 }>;
/**
* Some amount was withdrawn from the account (e.g. for transaction fees).
**/
Expand Down Expand Up @@ -106,7 +150,7 @@ declare module '@polkadot/api-base/types/events' {
/**
* Next public key signature submitted
**/
NextPublicKeySignatureSubmitted: AugmentedEvent<ApiType, [signature: Bytes, refreshProposal: DkgRuntimePrimitivesProposalRefreshProposal], { signature: Bytes, refreshProposal: DkgRuntimePrimitivesProposalRefreshProposal }>;
NextPublicKeySignatureSubmitted: AugmentedEvent<ApiType, [voterMerkleRoot: U8aFixed, sessionLength: u64, voterCount: u32, nonce: u32, pubKey: Bytes, signature: Bytes], { voterMerkleRoot: U8aFixed, sessionLength: u64, voterCount: u32, nonce: u32, pubKey: Bytes, signature: Bytes }>;
/**
* Next public key submitted
**/
Expand Down Expand Up @@ -134,7 +178,7 @@ declare module '@polkadot/api-base/types/events' {
/**
* Current Public Key Signature Changed.
**/
PublicKeySignatureChanged: AugmentedEvent<ApiType, [signature: Bytes, refreshProposal: DkgRuntimePrimitivesProposalRefreshProposal], { signature: Bytes, refreshProposal: DkgRuntimePrimitivesProposalRefreshProposal }>;
PublicKeySignatureChanged: AugmentedEvent<ApiType, [voterMerkleRoot: U8aFixed, sessionLength: u64, voterCount: u32, nonce: u32, pubKey: Bytes, signature: Bytes], { voterMerkleRoot: U8aFixed, sessionLength: u64, voterCount: u32, nonce: u32, pubKey: Bytes, signature: Bytes }>;
/**
* Current public key submitted
**/
Expand All @@ -157,14 +201,22 @@ declare module '@polkadot/api-base/types/events' {
* RuntimeEvent When a Proposal is added to UnsignedProposalQueue.
**/
ProposalAdded: AugmentedEvent<ApiType, [key: DkgRuntimePrimitivesProposalDkgPayloadKey, targetChain: WebbProposalsHeaderTypedChainId, data: Bytes], { key: DkgRuntimePrimitivesProposalDkgPayloadKey, targetChain: WebbProposalsHeaderTypedChainId, data: Bytes }>;
/**
* RuntimeEvent When a Proposal is expired and removed from UnsignedProposalQueue.
**/
ProposalBatchExpired: AugmentedEvent<ApiType, [targetChain: WebbProposalsHeaderTypedChainId, batchId: u32], { targetChain: WebbProposalsHeaderTypedChainId, batchId: u32 }>;
/**
* RuntimeEvent When a Proposal is removed from UnsignedProposalQueue.
**/
ProposalBatchRemoved: AugmentedEvent<ApiType, [targetChain: WebbProposalsHeaderTypedChainId, batchId: u32], { targetChain: WebbProposalsHeaderTypedChainId, batchId: u32 }>;
/**
* RuntimeEvent When a Proposal Gets Signed by DKG.
**/
ProposalBatchSigned: AugmentedEvent<ApiType, [targetChain: WebbProposalsHeaderTypedChainId, batchId: u32, proposals: Vec<PalletDkgProposalHandlerSignedProposalEventData>, signature: Bytes], { targetChain: WebbProposalsHeaderTypedChainId, batchId: u32, proposals: Vec<PalletDkgProposalHandlerSignedProposalEventData>, signature: Bytes }>;
/**
* RuntimeEvent When a Proposal is removed from UnsignedProposalQueue.
* Offence reported against current DKG
**/
ProposalRemoved: AugmentedEvent<ApiType, [key: DkgRuntimePrimitivesProposalDkgPayloadKey, targetChain: WebbProposalsHeaderTypedChainId, expired: bool], { key: DkgRuntimePrimitivesProposalDkgPayloadKey, targetChain: WebbProposalsHeaderTypedChainId, expired: bool }>;
SigningOffenceReported: AugmentedEvent<ApiType, [offence: PalletDkgProposalHandlerOffencesDkgMisbehaviorOffenceType, signedData: DkgRuntimePrimitivesProposalSignedProposalBatch], { offence: PalletDkgProposalHandlerOffencesDkgMisbehaviorOffenceType, signedData: DkgRuntimePrimitivesProposalSignedProposalBatch }>;
/**
* Generic event
**/
Expand Down Expand Up @@ -254,7 +306,7 @@ declare module '@polkadot/api-base/types/events' {
/**
* New authority set has been applied.
**/
NewAuthorities: AugmentedEvent<ApiType, [authoritySet: Vec<ITuple<[SpFinalityGrandpaAppPublic, u64]>>], { authoritySet: Vec<ITuple<[SpFinalityGrandpaAppPublic, u64]>> }>;
NewAuthorities: AugmentedEvent<ApiType, [authoritySet: Vec<ITuple<[SpConsensusGrandpaAppPublic, u64]>>], { authoritySet: Vec<ITuple<[SpConsensusGrandpaAppPublic, u64]>> }>;
/**
* Current authority set has been paused.
**/
Expand Down Expand Up @@ -374,6 +426,22 @@ declare module '@polkadot/api-base/types/events' {
* A payout has been made to a member.
**/
PaidOut: AugmentedEvent<ApiType, [member: AccountId32, poolId: u32, payout: u128], { member: AccountId32, poolId: u32, payout: u128 }>;
/**
* A pool's commission `change_rate` has been changed.
**/
PoolCommissionChangeRateUpdated: AugmentedEvent<ApiType, [poolId: u32, changeRate: PalletNominationPoolsCommissionChangeRate], { poolId: u32, changeRate: PalletNominationPoolsCommissionChangeRate }>;
/**
* Pool commission has been claimed.
**/
PoolCommissionClaimed: AugmentedEvent<ApiType, [poolId: u32, commission: u128], { poolId: u32, commission: u128 }>;
/**
* A pool's commission setting has been changed.
**/
PoolCommissionUpdated: AugmentedEvent<ApiType, [poolId: u32, current: Option<ITuple<[Perbill, AccountId32]>>], { poolId: u32, current: Option<ITuple<[Perbill, AccountId32]>> }>;
/**
* A pool's maximum commission setting has been changed.
**/
PoolMaxCommissionUpdated: AugmentedEvent<ApiType, [poolId: u32, maxCommission: Perbill], { poolId: u32, maxCommission: Perbill }>;
/**
* The active balance of pool `pool_id` has been slashed to `balance`.
**/
Expand Down Expand Up @@ -419,6 +487,18 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
offences: {
/**
* There is an offence reported of the given `kind` happened at the `session_index` and
* (kind-specific) time slot. This event is not deposited for duplicate slashes.
* \[kind, timeslot\].
**/
Offence: AugmentedEvent<ApiType, [kind: U8aFixed, timeslot: Bytes], { kind: U8aFixed, timeslot: Bytes }>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
session: {
/**
* New session has happened. Note that the argument is the session index, not the
Expand Down
Loading

0 comments on commit 79916af

Please sign in to comment.