Skip to content

Instantly share code, notes, and snippets.

@alexisljn
Created December 21, 2022 08:22
Show Gist options
  • Save alexisljn/fb81a031051b70213186aecb3d6669d5 to your computer and use it in GitHub Desktop.
Save alexisljn/fb81a031051b70213186aecb3d6669d5 to your computer and use it in GitHub Desktop.
Log events values during hardhat test
import {ContractTransaction, ContractReceipt} from "ethers";
let tx: ContractTransaction = await contract.calledFunc();
let receipt: ContractReceipt = await tx.wait();
const events = receipt.events!.filter((x) => {return x.event == "EventName"});
console.log(events[0].args);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment