Open Vsevo1od opened 2 years ago
A quick solution is to replace this line
const eventSignature = `${eventName}(${eventABI.inputs.map(input => input.type).join(',')})`;
with
const eventSignature = `${eventName}(${eventABI.inputs.map(input => { if (input.type === 'tuple'){ return `(${input.components.map(input => input.type).join()})` } return input.type; } ).join(',')})`;
At least it works in my case An example contract that can be used to reproduce the issue
pragma solidity 0.8.7; contract Issue { struct AStruct { uint256 someValue; } event AnEvent(AStruct aStruct); function doEmit() external { emit AnEvent(AStruct({someValue: 0})); } }
A test
import {artifacts, ethers} from "hardhat"; import {expectEvent} from "@openzeppelin/test-helpers"; import {test} from "mocha"; test('is emitted', async () => { const [deployer] = await ethers.getSigners(); const factory = await ethers.getContractFactory('Issue', deployer); const contract = await factory.deploy(); const tx = await contract.doEmit(); await expectEvent.inTransaction(tx.hash, artifacts.require('Issue'), 'AnEvent'); })
A quick solution is to replace this line
with
At least it works in my case An example contract that can be used to reproduce the issue
A test