-
Notifications
You must be signed in to change notification settings - Fork 66
Test/cover constructor initialization #477
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
Conversation
}); | ||
|
||
const cover = await Cover.deploy( | ||
quotationData.address, |
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.
these values
quotationData.address
productsV1.address
are private fields. However we can try using getStorageAt https://docs.ethers.io/v5/api/providers/provider/#Provider-getStorageAt
to get the field value.
Let's try asserting them regardless using getStorageAt
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've tried with hardhat-storage-layout
and couldn't find them, and then I realized that they are immutable so they are not saved to storage
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.
Ah yes. You're right they are not in storage they are in contract code.
Ok this is fine for now
this.quotationData = quotationData; | ||
this.stakingPool = stakingPool; | ||
this.coverAddress = coverAddress; | ||
this.futureCoverNFTAddress = futureCoverNFTAddress; |
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.
can add a dummy productsV1 address here.
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.
Let's try to assert private fields with getStorageAt reads and a few other things
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.
LGTM
Needs rebase. |
ba14d59
to
087db68
Compare
Context
Closes #282
Changes proposed in this pull request
Added tests for the constructor and initialize functions of
Cover.sol
.setup
was changed to expose some values to make it easier to deploy a newCover
not initialized.Checklist
Review
When reviewing a PR, please indicate intention in comments using the following emojis: