Closed TrejGun closed 2 years ago
Looks like it does not properly extract the error message for a view
function - we might have not covered this - I'll take a look at that.
Hmm no, it seems to be working fine in our tests.
@TrejGun What is your installed version of @nomiclabs/hardhat-ethers
?
@rzadp 2.1.0
@TrejGun I was able to reproduce the issue (outside of our repository). I will continue to look into it.
@TrejGun Is your installed version of hardhat
higher than 2.9.3
? My investigation shows that this problem happens then.
You can try downgrading hardhat
to 2.9.3
to make it work, or wait for a fix on our side - looks like it should not be difficult.
@rzadp thanks for the quick response indeed my hardhat is 2.10.1 I will wait for the fix and run my tests again to report to you
@TrejGun Please give Waffle 4.0.2
a try.
@rzadp thanks, works like a charm
@TrejGun did you make it work with hardhat 2.1.0? I downgraded to hardhat 2.9.3 and still didn't work :/ here my dependencies:
"@nomiclabs/hardhat-ethers": "2.1.0",
"@nomiclabs/hardhat-etherscan": "^3.0.0",
"@nomiclabs/hardhat-waffle": "^2.0.3",
"@typechain/ethers-v5": "^10.1.0",
"@typechain/hardhat": "^6.1.0",
"@types/chai": "^4.3.0",
"@types/mocha": "^9.0.0",
"@types/node": "^16.4.13",
"@typescript-eslint/eslint-plugin": "^4.29.1",
"@typescript-eslint/parser": "^4.29.1",
"chai": "^4.3.4",
"dotenv": "^10.0.0",
"eslint": "^7.29.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-promise": "^5.1.0",
"ethereum-waffle": "^4.0.4",
"ethers": "5.6.9",
"hardhat": "^2.9.3",
"hardhat-contract-sizer": "^2.4.0",
"hardhat-deploy": "^0.9.29",
"hardhat-gas-reporter": "^1.0.7",
"prettier": "^2.7.1",
"prettier-plugin-solidity": "^1.0.0-dev.23",
"sol-merger": "^4.0.0",
"solhint": "^3.3.6",
"solidity-coverage": "^0.7.17",
"ts-node": "^10.4.0",
"typechain": "^8.1.0",
"typescript": "^4.5.4"
@TrejGun @rzadp I was looking more deeply into the code and I found the error. When I get the error string, the reason is inside simple quotes but the regex is searchig for double quotes here: https://github.com/TrueFiEng/Waffle/blob/master/waffle-chai/src/matchers/revertedWith.ts#L89 If I change the regex to single quotes, it reads the message and it is not anymore empty. I can imagine it is regarding the operating system, but it is only a quick guess :)
I'm on mac
Describe the bug The new version sometimes reports an empty error message I was not able to narrow down the conditions but was able to compile a simple test
To Reproduce
Software versions
ethereum-waffle
4.0.1@nomiclabs/hardhat-waffle
2.0.3node --version
) 16.14.2Additional context