Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save percybolmer/f32c7a918c7ae0da0b6034d18f0c7101 to your computer and use it in GitHub Desktop.
Save percybolmer/f32c7a918c7ae0da0b6034d18f0c7101 to your computer and use it in GitHub Desktop.
it("remove stake if empty", async() => {
devToken = await DevToken.deployed();
let owner = accounts[0];
let withdraw_amount = 50;
// Try withdrawing 50 from first stake AGAIN, this should empty the 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);
console.log(summary);
assert.equal(summary.stakes[0].user, "0x0000000000000000000000000000000000000000", "Failed to remove stake when it was empty");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment