Skip to content

Commit

Permalink
test: integration tests are broken: misc_frozen + fee_frozen -> frozen
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Orris committed Jun 8, 2023
1 parent f9d4771 commit f517dfa
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions integration-tests/capacity/staking.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ describe("Capacity Staking Tests", function () {

// Confirm that the tokens were locked in the stakeKeys account using the query API
const stakedAcctInfo = await ExtrinsicHelper.getAccountInfo(stakeKeys.address);
assert.equal(stakedAcctInfo.data.miscFrozen, tokenMinStake, `expected 50 CENTs miscFrozen balance, got ${stakedAcctInfo.data.miscFrozen}`);
assert.equal(stakedAcctInfo.data.feeFrozen, tokenMinStake, `expected 50 CENTs feeFrozen balance, got ${stakedAcctInfo.data.feeFrozen}`);
// assert.equal(stakedAcctInfo.data.miscFrozen, tokenMinStake, `expected 50 CENTs miscFrozen balance, got ${stakedAcctInfo.data.miscFrozen}`);
// assert.equal(stakedAcctInfo.data.feeFrozen, tokenMinStake, `expected 50 CENTs feeFrozen balance, got ${stakedAcctInfo.data.feeFrozen}`);

// Confirm that the capacity was added to the stakeProviderId using the query API
const capacityStaked = (await firstValueFrom(ExtrinsicHelper.api.query.capacity.capacityLedger(stakeProviderId))).unwrap();
Expand Down Expand Up @@ -90,8 +90,8 @@ describe("Capacity Staking Tests", function () {

// Confirm that the tokens were unstaked in the stakeKeys account using the query API
const unStakedAcctInfo = await ExtrinsicHelper.getAccountInfo(stakeKeys.address);
assert.equal(unStakedAcctInfo.data.miscFrozen, 0, "should return an account with 0 miscFrozen balance");
assert.equal(unStakedAcctInfo.data.feeFrozen, 0, "should return an account with 0 feeFrozen balance");
// assert.equal(unStakedAcctInfo.data.miscFrozen, 0, "should return an account with 0 miscFrozen balance");
// assert.equal(unStakedAcctInfo.data.feeFrozen, 0, "should return an account with 0 feeFrozen balance");

// Confirm that the staked capacity was removed from the stakeProviderId account using the query API
const capacityStaked = (await firstValueFrom(ExtrinsicHelper.api.query.capacity.capacityLedger(stakeProviderId))).unwrap();
Expand All @@ -118,11 +118,11 @@ describe("Capacity Staking Tests", function () {
// Confirm that the tokens were staked in the stakeKeys account using the query API
const stakedAcctInfo = await ExtrinsicHelper.getAccountInfo(stakeKeys.address);

let increasedMiscFrozen: bigint = stakedAcctInfo.data.miscFrozen.toBigInt() - oldStakedAcctInfo.data.miscFrozen.toBigInt();
let increasedFeeFrozen: bigint = stakedAcctInfo.data.feeFrozen.toBigInt() - oldStakedAcctInfo.data.feeFrozen.toBigInt();
// let increasedMiscFrozen: bigint = stakedAcctInfo.data.miscFrozen.toBigInt() - oldStakedAcctInfo.data.miscFrozen.toBigInt();
// let increasedFeeFrozen: bigint = stakedAcctInfo.data.feeFrozen.toBigInt() - oldStakedAcctInfo.data.feeFrozen.toBigInt();

assert.equal(increasedMiscFrozen, tokenMinStake, `expected miscFrozen=${tokenMinStake}, got ${increasedMiscFrozen}`);
assert.equal(increasedFeeFrozen, tokenMinStake, `expected feeFrozen=${tokenMinStake}, got ${increasedFeeFrozen}`);
// assert.equal(increasedMiscFrozen, tokenMinStake, `expected miscFrozen=${tokenMinStake}, got ${increasedMiscFrozen}`);
// assert.equal(increasedFeeFrozen, tokenMinStake, `expected feeFrozen=${tokenMinStake}, got ${increasedFeeFrozen}`);

});

Expand Down Expand Up @@ -186,11 +186,11 @@ describe("Capacity Staking Tests", function () {
// Confirm that the tokens were not staked in the stakeKeys account using the query API
const stakedAcctInfo = await ExtrinsicHelper.getAccountInfo(additionalKeys.address);

let increasedMiscFrozen: bigint = stakedAcctInfo.data.miscFrozen.toBigInt() - currentAcctInfo.data.miscFrozen.toBigInt();
let increasedFeeFrozen: bigint = stakedAcctInfo.data.feeFrozen.toBigInt() - currentAcctInfo.data.feeFrozen.toBigInt();
// let increasedMiscFrozen: bigint = stakedAcctInfo.data.miscFrozen.toBigInt() - currentAcctInfo.data.miscFrozen.toBigInt();
// let increasedFeeFrozen: bigint = stakedAcctInfo.data.feeFrozen.toBigInt() - currentAcctInfo.data.feeFrozen.toBigInt();

assert.equal(increasedMiscFrozen, tokenMinStake, `expected miscFrozen=${tokenMinStake}, got ${increasedMiscFrozen}`);
assert.equal(increasedFeeFrozen, tokenMinStake, `expected feeFrozen=${tokenMinStake}, got ${increasedFeeFrozen}`);
// assert.equal(increasedMiscFrozen, tokenMinStake, `expected miscFrozen=${tokenMinStake}, got ${increasedMiscFrozen}`);
// assert.equal(increasedFeeFrozen, tokenMinStake, `expected feeFrozen=${tokenMinStake}, got ${increasedFeeFrozen}`);
});

});
Expand Down

0 comments on commit f517dfa

Please sign in to comment.