Add Transfer event to Burnable Token. (#735)

Fixes #732
This commit is contained in:
Roman Storm
2018-02-20 15:44:50 -07:00
committed by Matt Condon
parent 9ea4bae313
commit 5ef8554727
2 changed files with 8 additions and 2 deletions

View File

@ -24,5 +24,6 @@ contract BurnableToken is BasicToken {
balances[burner] = balances[burner].sub(_value);
totalSupply_ = totalSupply_.sub(_value);
Burn(burner, _value);
Transfer(burner, address(0), _value);
}
}

View File

@ -21,11 +21,16 @@ contract('BurnableToken', function ([owner]) {
it('emits a burn event', async function () {
const { logs } = await this.token.burn(amount, { from });
assert.equal(logs.length, 1);
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
assert.equal(logs.length, 2);
assert.equal(logs[0].event, 'Burn');
assert.equal(logs[0].args.burner, owner);
assert.equal(logs[0].args.value, amount);
assert.equal(logs[1].event, 'Transfer');
assert.equal(logs[1].args.from, owner);
assert.equal(logs[1].args.to, ZERO_ADDRESS);
assert.equal(logs[1].args.value, amount);
});
});