Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions contracts/token/MintableToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ contract MintableToken is StandardToken, Ownable {
totalSupply = totalSupply.add(_amount);
balances[_to] = balances[_to].add(_amount);
Mint(_to, _amount);
Transfer(0x0, _to, _amount);
return true;
}

Expand Down
9 changes: 7 additions & 2 deletions test/MintableToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,13 @@ contract('Mintable', function(accounts) {
});

it('should mint a given amount of tokens to a given address', async function() {
await token.mint(accounts[0], 100);

const result = await token.mint(accounts[0], 100);
assert.equal(result.logs[0].event, 'Mint');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use Array#find instead of hardcoding the index, like result.logs.find(e => e.event === 'Mint'). Same for Transfer.

Sorry! Last changes and I'll merge.

assert.equal(result.logs[0].args.to.valueOf(), accounts[0]);
assert.equal(result.logs[0].args.amount.valueOf(), 100);
assert.equal(result.logs[1].event, 'Transfer');
assert.equal(result.logs[1].args.from.valueOf(), 0x0);

let balance0 = await token.balanceOf(accounts[0]);
assert(balance0, 100);

Expand Down