expectEvent.js 348 B

1234567891011121314151617
  1. const assert = require('chai').assert;
  2. const inLogs = async (logs, eventName) => {
  3. const event = logs.find(e => e.event === eventName);
  4. assert.exists(event);
  5. return event;
  6. };
  7. const inTransaction = async (tx, eventName) => {
  8. const { logs } = await tx;
  9. return inLogs(logs, eventName);
  10. };
  11. module.exports = {
  12. inLogs,
  13. inTransaction,
  14. };