-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update hardhat version and fix unit tests #178
Conversation
e1f6ef7
to
90da984
Compare
test/system/liquidation.test.js
Outdated
@@ -180,7 +181,7 @@ describeFn("System -- liquidation", () => { | |||
await expect(parseInt(tx.gasLimit)).to.be.lessThan(518000) | |||
|
|||
const txReceipt = await ethers.provider.getTransactionReceipt(tx.hash) | |||
await expect(parseInt(txReceipt.gasUsed)).to.be.lessThan(255000) | |||
await expect(parseInt(txReceipt.gasUsed)).to.be.lessThan(400000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am surprised by this increase. Can we check on a local geth instance what is the cost? It is possible that the Hardhat does not properly refund.
841db95
to
485913a
Compare
2dc0315
to
3b4e6fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good to go. The gas usage question can be answered separately.
Due to an error in Hardhat
2.2.0
, we decided to update Hardhat version and fix errors in unit and system tests.The errors in tests were caused by functions like
isOpen
,takeOffer
,earlyClose
being called on auctions that self destructed (the previously used version of Hardhat seemed to tolerate such calls).This PR contains the following changes:
^2.1.1
to^2.2.1
(it seemsnpm
installed the newest version -2.6.1
)isCodeAt(address)
which checks whether an address stores contract code, which seems to be the best way to check if contract self-destructedisCodeAt
instead of callingisOpen
for checking auction self-destruction or relying on revertsNote: Unfortunately, in two system tests a significant increase of gas usage was observed.
Note: The contracts themselves were not modified by this PR.