* Add StandardBurnableToken implementation BurnableToken that extends from StandardToken and adds a burnFrom method that decrements allowance. Equivalent to a transferFrom plus burn in a single operation. * Return event object from expectEvent helper * Add comment on Approval event in burnFrom function * Improvements on burnable token tests - Inject initial balance as a parameter to the behaviour - Use expectEvent helper for assertions on events - Use chai bignumber for numbers - Change to bdd-style assertions
18 lines
348 B
JavaScript
18 lines
348 B
JavaScript
const assert = require('chai').assert;
|
|
|
|
const inLogs = async (logs, eventName) => {
|
|
const event = logs.find(e => e.event === eventName);
|
|
assert.exists(event);
|
|
return event;
|
|
};
|
|
|
|
const inTransaction = async (tx, eventName) => {
|
|
const { logs } = await tx;
|
|
return inLogs(logs, eventName);
|
|
};
|
|
|
|
module.exports = {
|
|
inLogs,
|
|
inTransaction,
|
|
};
|