* fix: swithc WhitelistedCrowdsale to use Whitelist.sol * feat: refactor whitelist.sol, rbac.sol and whitelistedcrowdsale.sol * feat: add event arg assets and update whitelist * fix: update modifier comment and also test isWhitelisted * fix: remove onlyWhitelisted backwards compat attempt, fix explicit inheritance * fix: remove underscore prefix from event args * fix: user access/Whitelist
22 lines
513 B
JavaScript
22 lines
513 B
JavaScript
const should = require('chai').should();
|
|
|
|
const inLogs = async (logs, eventName, eventArgs = {}) => {
|
|
const event = logs.find(e => e.event === eventName);
|
|
should.exist(event);
|
|
for (const [k, v] of Object.entries(eventArgs)) {
|
|
should.exist(event.args[k]);
|
|
event.args[k].should.eq(v);
|
|
}
|
|
return event;
|
|
};
|
|
|
|
const inTransaction = async (tx, eventName, eventArgs = {}) => {
|
|
const { logs } = await tx;
|
|
return inLogs(logs, eventName, eventArgs);
|
|
};
|
|
|
|
module.exports = {
|
|
inLogs,
|
|
inTransaction,
|
|
};
|