Last active
August 6, 2021 11:27
-
-
Save percybolmer/704a2efbc1a0bd92531bf336caa1a893 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it("withdraw 50 from a stake", async() => { | |
devToken = await DevToken.deployed(); | |
let owner = accounts[0]; | |
let withdraw_amount = 50; | |
// Try withdrawing 50 from first stake | |
await devToken.withdrawStake(withdraw_amount, 0, {from:owner}); | |
// Grab a new summary to see if the total amount has changed | |
let summary = await devToken.hasStake(owner); | |
assert.equal(summary.total_amount, 200-withdraw_amount, "The total staking amount should be 150"); | |
// Itterate all stakes and verify their amount aswell. | |
let stake_amount = summary.stakes[0].amount; | |
assert.equal(stake_amount, 100-withdraw_amount, "Wrong Amount in first stake after withdrawal"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment