Skip to content

Commit

Permalink
[CU-23n7a3r] Integration Testing - Fixing CrowdloanRewards Tests. (#777)
Browse files Browse the repository at this point in the history
* test(Runtime Integration Tests): Fixed crowdloanRewards tests.

* test(Runtime Integration Tests): Crowdloan Fix, removed temporary waitForBlocks(n) call.

* test(Runtime Integration Tests): Crowdloan Rewards Fix.
Removed redundant import in mintingHelper.ts.

* test(Runtime Integration Tests): Added toggle flag to claim test.
Updated types.

* test(Runtime Integration Tests): Crowdloan Rewards Tests added documentation.
  • Loading branch information
lilith-roth authored Mar 18, 2022
1 parent d768521 commit e35e0f0
Show file tree
Hide file tree
Showing 11 changed files with 270 additions and 98 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,8 @@ declare module '@polkadot/api-base/types/consts' {
burn: Permill & AugmentedConst<ApiType>;
/**
* The maximum number of approvals that can wait in the spending queue.
*
* NOTE: This parameter is also used within the Bounties Pallet extension if enabled.
**/
maxApprovals: u32 & AugmentedConst<ApiType>;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ declare module '@polkadot/api-base/types/errors' {
crowdloanRewards: {
AlreadyAssociated: AugmentedError<ApiType>;
AlreadyInitialized: AugmentedError<ApiType>;
BackToTheFuture: AugmentedError<ApiType>;
InvalidClaim: AugmentedError<ApiType>;
InvalidInitializationBlock: AugmentedError<ApiType>;
InvalidProof: AugmentedError<ApiType>;
NotAssociated: AugmentedError<ApiType>;
NotClaimableYet: AugmentedError<ApiType>;
Expand Down Expand Up @@ -596,6 +596,7 @@ declare module '@polkadot/api-base/types/errors' {
AssetNotMapped: AugmentedError<ApiType>;
BadTimelockPeriod: AugmentedError<ApiType>;
BadTTL: AugmentedError<ApiType>;
BelowMinTransferSize: AugmentedError<ApiType>;
ExceedsMaxTransferSize: AugmentedError<ApiType>;
InsufficientBudget: AugmentedError<ApiType>;
NetworkDisabled: AugmentedError<ApiType>;
Expand Down Expand Up @@ -1223,6 +1224,10 @@ declare module '@polkadot/api-base/types/errors' {
* This account have too many vesting schedules
**/
TooManyVestingSchedules: AugmentedError<ApiType>;
/**
* Trying to vest to ourselves
**/
TryingToSelfVest: AugmentedError<ApiType>;
/**
* Vesting period is zero
**/
Expand Down Expand Up @@ -1268,7 +1273,7 @@ declare module '@polkadot/api-base/types/errors' {
**/
AssetHasNoReserve: AugmentedError<ApiType>;
/**
* The specified index does not exist in a MultiAssets struct
* The specified index does not exist in a MultiAssets struct.
**/
AssetIndexNonExistent: AugmentedError<ApiType>;
/**
Expand All @@ -1287,18 +1292,21 @@ declare module '@polkadot/api-base/types/errors' {
DestinationNotInvertible: AugmentedError<ApiType>;
/**
* We tried sending distinct asset and fee but they have different
* reserve chains
* reserve chains.
**/
DistinctReserveForAssetAndFee: AugmentedError<ApiType>;
/**
* The fee amount was zero when the fee specification extrinsic is
* being used.
* Fee is not enough.
**/
FeeCannotBeZero: AugmentedError<ApiType>;
FeeNotEnough: AugmentedError<ApiType>;
/**
* Could not get ancestry of asset reserve location.
**/
InvalidAncestry: AugmentedError<ApiType>;
/**
* The MultiAsset is invalid.
**/
InvalidAsset: AugmentedError<ApiType>;
/**
* Invalid transfer destination.
**/
Expand All @@ -1312,11 +1320,7 @@ declare module '@polkadot/api-base/types/errors' {
**/
NotCrossChainTransferableCurrency: AugmentedError<ApiType>;
/**
* Not fungible asset.
**/
NotFungible: AugmentedError<ApiType>;
/**
* The number of assets to be sent is over the maximum
* The number of assets to be sent is over the maximum.
**/
TooManyAssetsBeingSent: AugmentedError<ApiType>;
/**
Expand All @@ -1327,6 +1331,14 @@ declare module '@polkadot/api-base/types/errors' {
* XCM execution failed.
**/
XcmExecutionFailed: AugmentedError<ApiType>;
/**
* The transfering asset amount is zero.
**/
ZeroAmount: AugmentedError<ApiType>;
/**
* The fee is zero.
**/
ZeroFee: AugmentedError<ApiType>;
/**
* Generic error
**/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,19 @@ declare module '@polkadot/api-base/types/events' {
/**
* A new bond has been registered.
**/
NewBond: AugmentedEvent<ApiType, [u64, AccountId32, u128]>;
NewBond: AugmentedEvent<ApiType, [u128, AccountId32, u128]>;
/**
* A new offer has been created.
**/
NewOffer: AugmentedEvent<ApiType, [u64]>;
NewOffer: AugmentedEvent<ApiType, [u128]>;
/**
* An offer has been cancelled by the `AdminOrigin`.
**/
OfferCancelled: AugmentedEvent<ApiType, [u64]>;
OfferCancelled: AugmentedEvent<ApiType, [u128]>;
/**
* An offer has been completed.
**/
OfferCompleted: AugmentedEvent<ApiType, [u64]>;
OfferCompleted: AugmentedEvent<ApiType, [u128]>;
/**
* Generic event
**/
Expand Down Expand Up @@ -206,7 +206,7 @@ declare module '@polkadot/api-base/types/events' {
crowdloanRewards: {
Associated: AugmentedEvent<ApiType, [PalletCrowdloanRewardsModelsRemoteAccount, AccountId32]>;
Claimed: AugmentedEvent<ApiType, [PalletCrowdloanRewardsModelsRemoteAccount, AccountId32, u128]>;
Initialized: AugmentedEvent<ApiType, []>;
Initialized: AugmentedEvent<ApiType, [u64]>;
/**
* Generic event
**/
Expand Down Expand Up @@ -1095,30 +1095,10 @@ declare module '@polkadot/api-base/types/events' {
[key: string]: AugmentedEvent<ApiType>;
};
xTokens: {
/**
* Transferred.
**/
Transferred: AugmentedEvent<ApiType, [AccountId32, u128, u128, XcmV1MultiLocation]>;
/**
* Transferred `MultiAsset`.
**/
TransferredMultiAsset: AugmentedEvent<ApiType, [AccountId32, XcmV1MultiAsset, XcmV1MultiLocation]>;
/**
* Transferred `MultiAsset` with fee.
**/
TransferredMultiAssets: AugmentedEvent<ApiType, [AccountId32, XcmV1MultiassetMultiAssets, XcmV1MultiLocation]>;
/**
* Transferred `MultiAsset` with fee.
**/
TransferredMultiAssetWithFee: AugmentedEvent<ApiType, [AccountId32, XcmV1MultiAsset, XcmV1MultiAsset, XcmV1MultiLocation]>;
/**
* Transferred `MultiAsset` with fee.
**/
TransferredMultiCurrencies: AugmentedEvent<ApiType, [AccountId32, Vec<ITuple<[u128, u128]>>, XcmV1MultiLocation]>;
/**
* Transferred with fee.
**/
TransferredWithFee: AugmentedEvent<ApiType, [AccountId32, u128, u128, u128, XcmV1MultiLocation]>;
TransferredMultiAssets: AugmentedEvent<ApiType, [AccountId32, XcmV1MultiassetMultiAssets, XcmV1MultiAsset, XcmV1MultiLocation]>;
/**
* Generic event
**/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,29 @@ declare module '@polkadot/api-base/types/storage' {
};
balances: {
/**
* The balance of an account.
* The Balances pallet example of storing the balance of an account.
*
* # Example
*
* ```nocompile
* impl pallet_balances::Config for Runtime {
* type AccountStore = StorageMapShim<Self::Account<Runtime>, frame_system::Provider<Runtime>, AccountId, Self::AccountData<Balance>>
* }
* ```
*
* You can also store the balance of an account in the `System` pallet.
*
* # Example
*
* ```nocompile
* impl pallet_balances::Config for Runtime {
* type AccountStore = System
* }
* ```
*
* But this comes with tradeoffs, storing account balances in the system pallet stores
* `frame_system` data alongside the account data contrary to storing account balances in the
* `Balances` pallet, which uses a `StorageMap` to store balances data only.
* NOTE: This is only used in the case that this pallet is used to store balances.
**/
account: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<PalletBalancesAccountData>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
Expand Down Expand Up @@ -125,11 +146,11 @@ declare module '@polkadot/api-base/types/storage' {
/**
* The counter used to uniquely identify bond offers within this pallet.
**/
bondOfferCount: AugmentedQuery<ApiType, () => Observable<u64>, []> & QueryableStorageEntry<ApiType, []>;
bondOfferCount: AugmentedQuery<ApiType, () => Observable<u128>, []> & QueryableStorageEntry<ApiType, []>;
/**
* A mapping from offer ID to the pair: (issuer, offer)
**/
bondOffers: AugmentedQuery<ApiType, (arg: u64 | AnyNumber | Uint8Array) => Observable<Option<ITuple<[AccountId32, ComposableTraitsBondedFinanceBondOffer]>>>, [u64]> & QueryableStorageEntry<ApiType, [u64]>;
bondOffers: AugmentedQuery<ApiType, (arg: u128 | AnyNumber | Uint8Array) => Observable<Option<ITuple<[AccountId32, ComposableTraitsBondedFinanceBondOffer]>>>, [u128]> & QueryableStorageEntry<ApiType, [u128]>;
/**
* Generic query
**/
Expand Down Expand Up @@ -288,13 +309,6 @@ declare module '@polkadot/api-base/types/storage' {
* proposal.
**/
lastTabledWasExternal: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Accounts for which there are locks in action which may be removed at some point in the
* future. The value is the block number at which the lock expires and may be removed.
*
* TWOX-NOTE: OK ― `AccountId` is a secure hash.
**/
locks: AugmentedQuery<ApiType, (arg: AccountId32 | string | Uint8Array) => Observable<Option<u32>>, [AccountId32]> & QueryableStorageEntry<ApiType, [AccountId32]>;
/**
* The lowest referendum index representing an unbaked referendum. Equal to
* `ReferendumCount` if there isn't a unbaked referendum.
Expand Down Expand Up @@ -1051,6 +1065,10 @@ declare module '@polkadot/api-base/types/storage' {
* The configuration which controls the dynamics of the outbound queue.
**/
queueConfig: AugmentedQuery<ApiType, () => Observable<CumulusPalletXcmpQueueQueueConfigData>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Whether or not the XCMP queue is suspended from executing incoming XCMs or not.
**/
queueSuspended: AugmentedQuery<ApiType, () => Observable<bool>, []> & QueryableStorageEntry<ApiType, []>;
/**
* Any signal messages waiting to be sent.
**/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,15 @@ declare module '@polkadot/api-base/types/submittable' {
* Emits a `NewBond`.
* Possibily Emits a `OfferCompleted`.
**/
bond: AugmentedSubmittable<(offerId: u64 | AnyNumber | Uint8Array, nbOfBonds: u128 | AnyNumber | Uint8Array, keepAlive: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u64, u128, bool]>;
bond: AugmentedSubmittable<(offerId: u128 | AnyNumber | Uint8Array, nbOfBonds: u128 | AnyNumber | Uint8Array, keepAlive: bool | boolean | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128, u128, bool]>;
/**
* Cancel a running offer. Blocking further bond but not cancelling the
* currently vested rewards. The `stake` put by the creator is refunded.
* The dispatch origin for this call must be _Signed_ and the sender must be `AdminOrigin`
*
* Emits a `OfferCancelled`.
**/
cancel: AugmentedSubmittable<(offerId: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u64]>;
cancel: AugmentedSubmittable<(offerId: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128]>;
/**
* Create a new offer. So later can `bond` it.
*
Expand Down Expand Up @@ -1545,7 +1545,7 @@ declare module '@polkadot/api-base/types/submittable' {
/**
* Sets supported networks and maximum transaction sizes accepted by the relayer.
**/
setNetwork: AugmentedSubmittable<(networkId: u32 | AnyNumber | Uint8Array, networkInfo: PalletMosaicNetworkInfo | { enabled?: any; maxTransferSize?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletMosaicNetworkInfo]>;
setNetwork: AugmentedSubmittable<(networkId: u32 | AnyNumber | Uint8Array, networkInfo: PalletMosaicNetworkInfo | { enabled?: any; minTransferSize?: any; maxTransferSize?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32, PalletMosaicNetworkInfo]>;
/**
* Sets the current relayer configuration. This is enacted immediately and invalidates
* inflight, incoming transactions from the previous relayer. Budgets remain in place
Expand Down Expand Up @@ -2172,11 +2172,6 @@ declare module '@polkadot/api-base/types/submittable' {
remark: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
* Make some on-chain remark and emit event.
*
* # <weight>
* - `O(b)` where b is the length of the remark.
* - 1 event.
* # </weight>
**/
remarkWithEvent: AugmentedSubmittable<(remark: Bytes | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [Bytes]>;
/**
Expand Down Expand Up @@ -2532,13 +2527,21 @@ declare module '@polkadot/api-base/types/submittable' {
claim: AugmentedSubmittable<(asset: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u128]>;
claimFor: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, asset: u128 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, u128]>;
updateVestingSchedules: AugmentedSubmittable<(who: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, asset: u128 | AnyNumber | Uint8Array, vestingSchedules: Vec<ComposableTraitsVestingVestingSchedule> | (ComposableTraitsVestingVestingSchedule | { window?: any; periodCount?: any; perPeriod?: any } | string | Uint8Array)[]) => SubmittableExtrinsic<ApiType>, [MultiAddress, u128, Vec<ComposableTraitsVestingVestingSchedule>]>;
vestedTransfer: AugmentedSubmittable<(dest: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, asset: u128 | AnyNumber | Uint8Array, schedule: ComposableTraitsVestingVestingSchedule | { window?: any; periodCount?: any; perPeriod?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, u128, ComposableTraitsVestingVestingSchedule]>;
vestedTransfer: AugmentedSubmittable<(from: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, beneficiary: MultiAddress | { Id: any } | { Index: any } | { Raw: any } | { Address32: any } | { Address20: any } | string | Uint8Array, asset: u128 | AnyNumber | Uint8Array, schedule: ComposableTraitsVestingVestingSchedule | { window?: any; periodCount?: any; perPeriod?: any } | string | Uint8Array) => SubmittableExtrinsic<ApiType>, [MultiAddress, MultiAddress, u128, ComposableTraitsVestingVestingSchedule]>;
/**
* Generic tx
**/
[key: string]: SubmittableExtrinsicFunction<ApiType>;
};
xcmpQueue: {
/**
* Resumes all XCM executions for the XCMP queue.
*
* Note that this function doesn't change the status of the in/out bound channels.
*
* - `origin`: Must pass `ControllerOrigin`.
**/
resumeXcmExecution: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
/**
* Services a single overweight XCM.
*
Expand All @@ -2555,6 +2558,59 @@ declare module '@polkadot/api-base/types/submittable' {
* - `OverweightServiced`: On success.
**/
serviceOverweight: AugmentedSubmittable<(index: u64 | AnyNumber | Uint8Array, weightLimit: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u64, u64]>;
/**
* Suspends all XCM executions for the XCMP queue, regardless of the sender's origin.
*
* - `origin`: Must pass `ControllerOrigin`.
**/
suspendXcmExecution: AugmentedSubmittable<() => SubmittableExtrinsic<ApiType>, []>;
/**
* Overwrites the number of pages of messages which must be in the queue after which we drop any further
* messages from the channel.
*
* - `origin`: Must pass `Root`.
* - `new`: Desired value for `QueueConfigData.drop_threshold`
**/
updateDropThreshold: AugmentedSubmittable<(updated: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Overwrites the number of pages of messages which the queue must be reduced to before it signals that
* message sending may recommence after it has been suspended.
*
* - `origin`: Must pass `Root`.
* - `new`: Desired value for `QueueConfigData.resume_threshold`
**/
updateResumeThreshold: AugmentedSubmittable<(updated: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Overwrites the number of pages of messages which must be in the queue for the other side to be told to
* suspend their sending.
*
* - `origin`: Must pass `Root`.
* - `new`: Desired value for `QueueConfigData.suspend_value`
**/
updateSuspendThreshold: AugmentedSubmittable<(updated: u32 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u32]>;
/**
* Overwrites the amount of remaining weight under which we stop processing messages.
*
* - `origin`: Must pass `Root`.
* - `new`: Desired value for `QueueConfigData.threshold_weight`
**/
updateThresholdWeight: AugmentedSubmittable<(updated: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u64]>;
/**
* Overwrites the speed to which the available weight approaches the maximum weight.
* A lower number results in a faster progression. A value of 1 makes the entire weight available initially.
*
* - `origin`: Must pass `Root`.
* - `new`: Desired value for `QueueConfigData.weight_restrict_decay`.
**/
updateWeightRestrictDecay: AugmentedSubmittable<(updated: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u64]>;
/**
* Overwrite the maximum amount of weight any individual message may consume.
* Messages above this weight go into the overweight queue and may only be serviced explicitly.
*
* - `origin`: Must pass `Root`.
* - `new`: Desired value for `QueueConfigData.xcmp_max_individual_weight`.
**/
updateXcmpMaxIndividualWeight: AugmentedSubmittable<(updated: u64 | AnyNumber | Uint8Array) => SubmittableExtrinsic<ApiType>, [u64]>;
/**
* Generic tx
**/
Expand Down
Loading

0 comments on commit e35e0f0

Please sign in to comment.