tokamak-network / ton-staking-v2

11 stars 3 forks source link

[Question] I have a question about checking the test results. #29

Closed zzooppii closed 4 months ago

zzooppii commented 4 months ago

Describe the bug There is an expression that holds only if one value is 0. (prevWtonBalanceOfManager)

Question Is there a case where this value is not possible?

Code

let managerBalance = prevWtonBalanceOfManager.add(prevWtonBalanceOfLayer2Operator.add(sendAmountToOperator))
expect(afterWtonBalanceOfManager).to.be.eq(managerBalance)

expect(afterWtonBalanceOfManager).to.be.eq(prevWtonBalanceOfLayer2Operator.add(estimatedDistribute.layer2Seigs))

Line https://github.com/tokamak-network/ton-staking-v2/blob/codeReview/test/layer2/units/5.stake-v2-gas.sepolia.test.ts#L1333-L1341

Zena-park commented 4 months ago

The last line succeeds in this test, but is not general. Let me delete the last line. https://github.com/tokamak-network/ton-staking-v2/blob/dd125e0e18ea3c10d20e13ff871ed739db3ca2c9/test/layer2/units/5.stake-v2-gas.sepolia.test.ts#L1341

zzooppii commented 4 months ago

thank you