From 50ff8d27a98123c7174b4600e45aa462f272d3b5 Mon Sep 17 00:00:00 2001 From: "Mark.B" Date: Fri, 8 Nov 2024 13:03:25 +0100 Subject: [PATCH] add tests fixes --- test/Redistribution.test.ts | 4 ++-- test/Staking.test.ts | 8 ++------ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/test/Redistribution.test.ts b/test/Redistribution.test.ts index f8f45f45..1add723e 100644 --- a/test/Redistribution.test.ts +++ b/test/Redistribution.test.ts @@ -84,7 +84,7 @@ let node_2: string; const overlay_2 = '0xa40db58e368ea6856a24c0264ebd73b049f3dc1c2347b1babc901d3e09842dec'; const stakeAmount_2 = '100000000000000000'; const effectiveStakeAmount_2 = '99999999999984000'; -const effectiveStakeAmount_2_n_2 = '99999999999936000'; +const effectiveStakeAmount_2_n_2 = '100000000000000000'; const nonce_2 = '0xb5555b33b5555b33b5555b33b5555b33b5555b33b5555b33b5555b33b5555b33'; const hash_2 = '0xb5555b33b5555b33b5555b33b5555b33b5555b33b5555b33b5555b33b5555b33'; const depth_2 = '0x06'; @@ -100,7 +100,7 @@ const hash_3 = '0xb5555b33b5555b33b5555b33b5555b33b5555b33b5555b33b5555b33b5555b const depth_3 = '0x06'; const reveal_nonce_3 = '0xb5555b33b5555b33b5555b33b5555b33b5555b33b5555b33b5555b33b5555b33'; const height_3_n_2 = 3; -const effectiveStakeAmount_3 = '99999999999744000'; +const effectiveStakeAmount_3 = '100000000000000000'; let node_4: string; const overlay_4 = '0xaedb2a8007316805b4d64b249ea39c5a1c4a9ce51dc8432724241f41ecb02efb'; diff --git a/test/Staking.test.ts b/test/Staking.test.ts index c361b817..104740db 100644 --- a/test/Staking.test.ts +++ b/test/Staking.test.ts @@ -489,7 +489,7 @@ describe('Staking', function () { it('should make stake surplus withdrawal when height increases and then decreases', async function () { const priceOracle = await ethers.getContract('PriceOracle', deployer); - await priceOracle.setPrice(26000); + await priceOracle.setPrice(24000); const price = await priceOracle.currentPrice(); // We are doubling here as we are adding another "amount" with another stakeAmount_0 @@ -504,16 +504,12 @@ describe('Staking', function () { // Mine 2 rounds so that values are valid, before that effectiveStake is zero as nodes cant play await mineNBlocks(roundLength * 2); const withdrawbleStakeBefore = await sr_staker_0.withdrawableStake(); - // console.log('WD', withdrawbleStakeBefore.toString()); - // console.log('POT', staked_before.potentialStake.toString()); - // console.log('COM', staked_before.committedStake.toString() * price * 2 ** height_0_n_1); - // console.log('EFF', (await sr_staker_0.nodeEffectiveStake(staker_0)).toString()); // We are lowering height to 0 and again mining 2 rounds so values are valid await sr_staker_0.manageStake(nonce_0, 0, height_0); await mineNBlocks(roundLength * 2); const staked_after = await sr_staker_0.stakes(staker_0); - await priceOracle.setPrice(24000); + // await priceOracle.setPrice(24000); const withdrawbleStakeAfter = await sr_staker_0.withdrawableStake(); expect(withdrawbleStakeAfter.gt(withdrawbleStakeBefore)).to.be.true;