Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Upgrade Polkadot types to v1.4.0 #6100

Merged
merged 2 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
14 changes: 14 additions & 0 deletions packages/api-augment/src/polkadot/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,20 @@ declare module '@polkadot/api-base/types/consts' {
**/
[key: string]: Codec;
};
delegatedStaking: {
/**
* Injected identifier for the pallet.
**/
palletId: FrameSupportPalletId & AugmentedConst<ApiType>;
/**
* Fraction of the slash that is rewarded to the caller of pending slash to the agent.
**/
slashRewardFraction: Perbill & AugmentedConst<ApiType>;
/**
* Generic const
**/
[key: string]: Codec;
};
electionProviderMultiPhase: {
/**
* The minimum amount of improvement to the solution score that defines a solution as
Expand Down
86 changes: 76 additions & 10 deletions packages/api-augment/src/polkadot/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,21 @@ declare module '@polkadot/api-base/types/errors' {
**/
InvalidConfiguration: AugmentedError<ApiType>;
/**
* An equivocation proof provided as part of an equivocation report is invalid.
* A double voting proof provided as part of an equivocation report is invalid.
**/
InvalidEquivocationProof: AugmentedError<ApiType>;
InvalidDoubleVotingProof: AugmentedError<ApiType>;
/**
* The session of the equivocation proof is invalid
**/
InvalidEquivocationProofSession: AugmentedError<ApiType>;
/**
* A fork voting proof provided as part of an equivocation report is invalid.
**/
InvalidForkVotingProof: AugmentedError<ApiType>;
/**
* A future block voting proof provided as part of an equivocation report is invalid.
**/
InvalidFutureBlockVotingProof: AugmentedError<ApiType>;
/**
* A key ownership proof provided as part of an equivocation report is invalid.
**/
Expand Down Expand Up @@ -472,6 +484,64 @@ declare module '@polkadot/api-base/types/errors' {
**/
[key: string]: AugmentedError<ApiType>;
};
delegatedStaking: {
/**
* An existing staker cannot perform this action.
**/
AlreadyStaking: AugmentedError<ApiType>;
/**
* Some corruption in internal state.
**/
BadState: AugmentedError<ApiType>;
/**
* Delegation conditions are not met.
*
* Possible issues are
* 1) Cannot delegate to self,
* 2) Cannot delegate to multiple delegates.
**/
InvalidDelegation: AugmentedError<ApiType>;
/**
* Reward Destination cannot be same as `Agent` account.
**/
InvalidRewardDestination: AugmentedError<ApiType>;
/**
* Not an existing `Agent` account.
**/
NotAgent: AugmentedError<ApiType>;
/**
* The account cannot perform this operation.
**/
NotAllowed: AugmentedError<ApiType>;
/**
* Not a Delegator account.
**/
NotDelegator: AugmentedError<ApiType>;
/**
* The account does not have enough funds to perform the operation.
**/
NotEnoughFunds: AugmentedError<ApiType>;
/**
* `Agent` has no pending slash to be applied.
**/
NothingToSlash: AugmentedError<ApiType>;
/**
* Operation not supported by this pallet.
**/
NotSupported: AugmentedError<ApiType>;
/**
* Unapplied pending slash restricts operation on `Agent`.
**/
UnappliedSlash: AugmentedError<ApiType>;
/**
* Failed to withdraw amount from Core Staking.
**/
WithdrawFailed: AugmentedError<ApiType>;
/**
* Generic error
**/
[key: string]: AugmentedError<ApiType>;
};
electionProviderMultiPhase: {
/**
* Some bound not met
Expand Down Expand Up @@ -977,6 +1047,10 @@ declare module '@polkadot/api-base/types/errors' {
* A reward pool does not exist. In all cases this is a system logic error.
**/
RewardPoolNotFound: AugmentedError<ApiType>;
/**
* The slash amount is too low to be applied.
**/
SlashTooLow: AugmentedError<ApiType>;
/**
* A sub pool does not exist.
**/
Expand Down Expand Up @@ -1052,10 +1126,6 @@ declare module '@polkadot/api-base/types/errors' {
* Output code is too large
**/
NewCodeTooLarge: AugmentedError<ApiType>;
/**
* Collator did not sign PoV.
**/
NotCollatorSigned: AugmentedError<ApiType>;
/**
* The `para_head` hash in the candidate descriptor doesn't match the hash of the actual
* para head in the commitments.
Expand Down Expand Up @@ -1246,10 +1316,6 @@ declare module '@polkadot/api-base/types/errors' {
* Preimage has already been noted on-chain.
**/
AlreadyNoted: AugmentedError<ApiType>;
/**
* No ticket with a cost was returned by [`Config::Consideration`] to store the preimage.
**/
NoCost: AugmentedError<ApiType>;
/**
* The user is not authorized to perform this action.
**/
Expand Down
54 changes: 37 additions & 17 deletions packages/api-augment/src/polkadot/events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import type { Bytes, Null, Option, Result, U8aFixed, Vec, bool, u128, u16, u32,
import type { ITuple } from '@polkadot/types-codec/types';
import type { EthereumAddress } from '@polkadot/types/interfaces/eth';
import type { AccountId32, H256, Perbill } from '@polkadot/types/interfaces/runtime';
import type { FrameSupportDispatchDispatchInfo, FrameSupportDispatchPostDispatchInfo, FrameSupportMessagesProcessMessageError, FrameSupportPreimagesBounded, FrameSupportTokensMiscBalanceStatus, PalletConvictionVotingTally, PalletElectionProviderMultiPhaseElectionCompute, PalletElectionProviderMultiPhasePhase, PalletMultisigTimepoint, PalletNominationPoolsCommissionChangeRate, PalletNominationPoolsCommissionClaimPermission, PalletNominationPoolsPoolState, PalletStakingForcing, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletStateTrieMigrationError, PalletStateTrieMigrationMigrationCompute, PolkadotParachainPrimitivesPrimitivesHrmpChannelId, PolkadotPrimitivesV7CandidateReceipt, PolkadotRuntimeCommonImplsVersionedLocatableAsset, PolkadotRuntimeParachainsDisputesDisputeLocation, PolkadotRuntimeParachainsDisputesDisputeResult, PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, PolkadotRuntimeProxyType, PolkadotRuntimeRuntimeParametersKey, PolkadotRuntimeRuntimeParametersValue, SpConsensusGrandpaAppPublic, SpNposElectionsElectionScore, SpRuntimeDispatchError, SpRuntimeDispatchErrorWithPostInfo, SpWeightsWeightV2Weight, StagingXcmV4AssetAssets, StagingXcmV4Location, StagingXcmV4Response, StagingXcmV4TraitsOutcome, StagingXcmV4Xcm, XcmV3TraitsError, XcmVersionedAssets, XcmVersionedLocation } from '@polkadot/types/lookup';
import type { FrameSupportDispatchDispatchInfo, FrameSupportDispatchPostDispatchInfo, FrameSupportMessagesProcessMessageError, FrameSupportPreimagesBounded, FrameSupportTokensMiscBalanceStatus, PalletConvictionVotingTally, PalletConvictionVotingVoteAccountVote, PalletElectionProviderMultiPhaseElectionCompute, PalletElectionProviderMultiPhasePhase, PalletMultisigTimepoint, PalletNominationPoolsCommissionChangeRate, PalletNominationPoolsCommissionClaimPermission, PalletNominationPoolsPoolState, PalletStakingForcing, PalletStakingRewardDestination, PalletStakingValidatorPrefs, PalletStateTrieMigrationError, PalletStateTrieMigrationMigrationCompute, PolkadotParachainPrimitivesPrimitivesHrmpChannelId, PolkadotPrimitivesV8CandidateReceipt, PolkadotRuntimeCommonImplsVersionedLocatableAsset, PolkadotRuntimeParachainsDisputesDisputeLocation, PolkadotRuntimeParachainsDisputesDisputeResult, PolkadotRuntimeParachainsInclusionAggregateMessageOrigin, PolkadotRuntimeProxyType, SpConsensusGrandpaAppPublic, SpNposElectionsElectionScore, SpRuntimeDispatchError, SpRuntimeDispatchErrorWithPostInfo, SpWeightsWeightV2Weight, StagingXcmV4AssetAssets, StagingXcmV4Location, StagingXcmV4Response, StagingXcmV4TraitsOutcome, StagingXcmV4Xcm, XcmV3TraitsError, XcmVersionedAssets, XcmVersionedLocation } from '@polkadot/types/lookup';

export type __AugmentedEvent<ApiType extends ApiTypes> = AugmentedEvent<ApiType>;

Expand Down Expand Up @@ -250,6 +250,14 @@ declare module '@polkadot/api-base/types/events' {
* An \[account\] has cancelled a previous delegation operation.
**/
Undelegated: AugmentedEvent<ApiType, [AccountId32]>;
/**
* An account that has voted
**/
Voted: AugmentedEvent<ApiType, [who: AccountId32, vote: PalletConvictionVotingVoteAccountVote], { who: AccountId32, vote: PalletConvictionVotingVoteAccountVote }>;
/**
* A vote that been removed
**/
VoteRemoved: AugmentedEvent<ApiType, [who: AccountId32, vote: PalletConvictionVotingVoteAccountVote], { who: AccountId32, vote: PalletConvictionVotingVoteAccountVote }>;
/**
* Generic event
**/
Expand Down Expand Up @@ -316,6 +324,28 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
delegatedStaking: {
/**
* Funds delegated by a delegator.
**/
Delegated: AugmentedEvent<ApiType, [agent: AccountId32, delegator: AccountId32, amount: u128], { agent: AccountId32, delegator: AccountId32, amount: u128 }>;
/**
* Unclaimed delegation funds migrated to delegator.
**/
MigratedDelegation: AugmentedEvent<ApiType, [agent: AccountId32, delegator: AccountId32, amount: u128], { agent: AccountId32, delegator: AccountId32, amount: u128 }>;
/**
* Funds released to a delegator.
**/
Released: AugmentedEvent<ApiType, [agent: AccountId32, delegator: AccountId32, amount: u128], { agent: AccountId32, delegator: AccountId32, amount: u128 }>;
/**
* Funds slashed from a delegator.
**/
Slashed: AugmentedEvent<ApiType, [agent: AccountId32, delegator: AccountId32, amount: u128], { agent: AccountId32, delegator: AccountId32, amount: u128 }>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
electionProviderMultiPhase: {
/**
* An election failed.
Expand Down Expand Up @@ -514,8 +544,10 @@ declare module '@polkadot/api-base/types/events' {
* A member has been removed from a pool.
*
* The removal can be voluntary (withdrawn all unbonded funds) or involuntary (kicked).
* Any funds that are still delegated (i.e. dangling delegation) are released and are
* represented by `released_balance`.
**/
MemberRemoved: AugmentedEvent<ApiType, [poolId: u32, member: AccountId32], { poolId: u32, member: AccountId32 }>;
MemberRemoved: AugmentedEvent<ApiType, [poolId: u32, member: AccountId32, releasedBalance: u128], { poolId: u32, member: AccountId32, releasedBalance: u128 }>;
/**
* Topped up deficit in frozen ED of the reward pool.
**/
Expand Down Expand Up @@ -623,15 +655,15 @@ declare module '@polkadot/api-base/types/events' {
/**
* A candidate was backed. `[candidate, head_data]`
**/
CandidateBacked: AugmentedEvent<ApiType, [PolkadotPrimitivesV7CandidateReceipt, Bytes, u32, u32]>;
CandidateBacked: AugmentedEvent<ApiType, [PolkadotPrimitivesV8CandidateReceipt, Bytes, u32, u32]>;
/**
* A candidate was included. `[candidate, head_data]`
**/
CandidateIncluded: AugmentedEvent<ApiType, [PolkadotPrimitivesV7CandidateReceipt, Bytes, u32, u32]>;
CandidateIncluded: AugmentedEvent<ApiType, [PolkadotPrimitivesV8CandidateReceipt, Bytes, u32, u32]>;
/**
* A candidate timed out. `[candidate, head_data]`
**/
CandidateTimedOut: AugmentedEvent<ApiType, [PolkadotPrimitivesV7CandidateReceipt, Bytes, u32]>;
CandidateTimedOut: AugmentedEvent<ApiType, [PolkadotPrimitivesV8CandidateReceipt, Bytes, u32]>;
/**
* Some upward messages have been received and will be processed.
**/
Expand All @@ -641,18 +673,6 @@ declare module '@polkadot/api-base/types/events' {
**/
[key: string]: AugmentedEvent<ApiType>;
};
parameters: {
/**
* A Parameter was set.
*
* Is also emitted when the value was not changed.
**/
Updated: AugmentedEvent<ApiType, [key: PolkadotRuntimeRuntimeParametersKey, oldValue: Option<PolkadotRuntimeRuntimeParametersValue>, newValue: Option<PolkadotRuntimeRuntimeParametersValue>], { key: PolkadotRuntimeRuntimeParametersKey, oldValue: Option<PolkadotRuntimeRuntimeParametersValue>, newValue: Option<PolkadotRuntimeRuntimeParametersValue> }>;
/**
* Generic event
**/
[key: string]: AugmentedEvent<ApiType>;
};
paras: {
/**
* A para has been queued to execute pending actions. `para_id`
Expand Down
Loading