Skip to content

Commit d7b2ce6

Browse files
committed
fix e2e tests
1 parent 48fd42c commit d7b2ce6

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

integration-tests/capacity/staking.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,13 +214,13 @@ describe("Capacity Staking Tests", function () {
214214
});
215215

216216
describe("when attempting to stake below the minimum staking requirements", async function () {
217-
it("should fail to stake for InsufficientStakingAmount", async function () {
217+
it("should fail to stake for StakingAmountBelowMinimum", async function () {
218218
let stakingKeys = createKeys("stakingKeys");
219219
let providerId = await createMsaAndProvider(stakingKeys, "stakingKeys", 150n * CENTS);
220220
let stakeAmount = 1500n;
221221

222222
const failStakeObj = ExtrinsicHelper.stake(stakingKeys, providerId, stakeAmount, 'MaximumCapacity');
223-
await assert.rejects(failStakeObj.fundAndSend(), { name: "InsufficientStakingAmount" });
223+
await assert.rejects(failStakeObj.fundAndSend(), { name: "StakingAmountBelowMinimum" });
224224
});
225225
});
226226

@@ -230,7 +230,7 @@ describe("Capacity Staking Tests", function () {
230230
let providerId = await createMsaAndProvider(stakingKeys, "stakingKeys", );
231231

232232
const failStakeObj = ExtrinsicHelper.stake(stakingKeys, providerId, 0, 'MaximumCapacity');
233-
await assert.rejects(failStakeObj.fundAndSend(), { name: "ZeroAmountNotAllowed" });
233+
await assert.rejects(failStakeObj.fundAndSend(), { name: "StakingAmountBelowMinimum" });
234234
});
235235
});
236236

integration-tests/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pallets/capacity/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,10 +448,9 @@ pub mod pallet {
448448
requested_amount: BalanceOf<T>,
449449
) -> DispatchResult {
450450
let unstaker = ensure_signed(origin)?;
451-
Self::ensure_can_unstake(&unstaker)?;
452-
453451
ensure!(requested_amount > Zero::zero(), Error::<T>::UnstakedAmountIsZero);
454452

453+
Self::ensure_can_unstake(&unstaker)?;
455454
let actual_amount = Self::decrease_active_staking_balance(&unstaker, requested_amount)?;
456455
let capacity_reduction = Self::reduce_capacity(&unstaker, target, actual_amount)?;
457456

0 commit comments

Comments
 (0)