Fix/whitelisted crowdsale (#981)
* 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
This commit is contained in:
@ -1,14 +1,18 @@
|
||||
const assert = require('chai').assert;
|
||||
const should = require('chai').should();
|
||||
|
||||
const inLogs = async (logs, eventName) => {
|
||||
const inLogs = async (logs, eventName, eventArgs = {}) => {
|
||||
const event = logs.find(e => e.event === eventName);
|
||||
assert.exists(event);
|
||||
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) => {
|
||||
const inTransaction = async (tx, eventName, eventArgs = {}) => {
|
||||
const { logs } = await tx;
|
||||
return inLogs(logs, eventName);
|
||||
return inLogs(logs, eventName, eventArgs);
|
||||
};
|
||||
|
||||
module.exports = {
|
||||
|
||||
Reference in New Issue
Block a user