Skip to content

Commit

Permalink
changed burn method and tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Andres Gonzalez committed Sep 8, 2017
1 parent 1dc26b9 commit badf204
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 1 addition & 4 deletions contracts/Gambit.sol
Expand Up @@ -10,9 +10,6 @@ contract Gambit is Token, Owned {
string public constant version = '1.0.0';
uint256 internal _totalBurnt = 0;

// Triggered when tokens are burnt.
event Burn(address indexed _from, uint256 _value);

// Constructor
function Gambit() {
_totalSupply = 260000000000000;
Expand All @@ -35,7 +32,7 @@ contract Gambit is Token, Owned {
balances[msg.sender] -= _value;
_totalSupply -= _value;
_totalBurnt += _value;
Burn(msg.sender, _value);
Transfer(msg.sender, 0x0, _value);
return true;
}
}
6 changes: 5 additions & 1 deletion test/gambit.js
Expand Up @@ -15,8 +15,12 @@ contract("Gambit", function(accounts) {
let ctr = await Gambit.new({ from: accounts[0] });
assert.strictEqual((await ctr.totalBurnt.call()).toNumber(), 0);
let logs = (await ctr.burn(100, { from: accounts[0] })).logs;
assert.equal(logs[0].event, "Burn");
assert.equal(logs[0].event, "Transfer");
assert.equal(logs[0].args._from, accounts[0]);
assert.equal(
logs[0].args._to,
"0x0000000000000000000000000000000000000000"
);
assert.strictEqual(logs[0].args._value.toNumber(), 100);
assert.strictEqual(
(await ctr.balanceOf.call(accounts[0])).toNumber(),
Expand Down

0 comments on commit badf204

Please sign in to comment.