-
Notifications
You must be signed in to change notification settings - Fork 29
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
add zero address checking #327
Conversation
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
@AndriianChestnykh @daveroga please review and merge if it's ok. |
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.
create internal method instead _checkOracleSigningAddress and use custom error error OracleSigningAddressShouldNotBeZero() in it?
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.
@yushihang Please do the following:
- Cover the unit tests in
cross-chain-proof-validator.tests.ts
. You need to cover both constructor and setOracleSigning method. For the method it's simple but for constructor you may need to deploy a validator directly but not viadeployHelper.deployCrossChainProofValidator
or change thedeployHelper.deployCrossChainProofValidator
itself. - Bump the package version in contracts/package.json from 2.5.6 to 2.5.7 (don't confuse with higher level package.json)
- Bump package version from 2.5.6 to 2.5.7 - Update test assertions in cross-chain-proof-validator.test.ts to properly handle custom Solidity errors using revertedWithCustomError Technical changes: - Update package.json version - Replace revertedWith with revertedWithCustomError in test cases
@AndriianChestnykh Thank you for your review and detailed advices. I have made the following changes:
Please let me know if anything needs to be tweaked, Thanks! The test results: ❯ npx hardhat test test/cross-chain/cross-chain-proof-validator.test.ts
State Cross Chain
[✓] CrossChainProofValidator deployed to: 0x5FbDB2315678afecb367f032d93F642f64180aa3
✔ Should process the messages without replacedAtTimestamp
✔ Should process the messages with replacedAtTimestamp
✔ Oracle timestamp should not be in the past
✔ Oracle replacedAtTimestamp or oracle timestamp cannot be in the future
✔ Should fail to verify a message which was tampered with
✔ Should fail to verify a message which signature is invalid
Oracle Signing Address Validation
✔ should revert when deploying with zero oracle signing address
[✓] CrossChainProofValidator deployed to: 0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0
✔ should deploy with correct parameters
✔ should set a new oracle signing address
✔ should revert when setting oracle signing address to zero
10 passing (2s) |
No description provided.