expectEvent.js 332 B

12345678910111213141516
  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. };
  6. const inTransaction = async (tx, eventName) => {
  7. const { logs } = await tx;
  8. return inLogs(logs, eventName);
  9. };
  10. module.exports = {
  11. inLogs,
  12. inTransaction,
  13. };