-
Notifications
You must be signed in to change notification settings - Fork 2
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
feat: checks createAt #37
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.
The existential validation of requests seems good to me. However, you should check as well whether the response exists in all related functions but proposeResponse()
; similarly, the existence of the dispute should be validated in all but disputeResponse()
.
solidity/test/unit/Oracle.t.sol
Outdated
function test_finalize_revertsIfInvalidRequest() public { | ||
oracle.mock_setRequestCreatedAt(_getId(mockRequest), 0); | ||
vm.expectRevert(IOracle.Oracle_InvalidRequestBody.selector); | ||
vm.expectRevert(IOracle.Oracle_InvalidResponseBody.selector); |
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.
The test case name and the expected reversion don't seem to match.
solidity/test/unit/Validator.t.sol
Outdated
contract ValidatorValidateResponseAndDispute is BaseTest { | ||
function test_validateResponseAndDispute() public { | ||
(bytes32 responseId, bytes32 disputeId) = | ||
validator.validateResponseAndDispute(mockRequest, mockResponse, mockDispute); | ||
assertEq(responseId, keccak256(abi.encode(mockResponse))); | ||
assertEq(disputeId, keccak256(abi.encode(mockDispute))); |
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.
All the test cases of the above kind should be kept within Validator.t.sol
, as we're still returning IDs in the validation functions.
Actually, it would make sense to duplicate all the test cases moved to ValidatorLib.t.sol
in order to make sure that the library is properly being called.
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 did it for not duplicate test logic in the contracts, even so, i can do it again all those tests.
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.
🔥
🤖 Linear
Closes GRT-18