-
Notifications
You must be signed in to change notification settings - Fork 5
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 Unit Test CI to packages/contracts
for Early Detection of Code Breakages
#36
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,7 +21,7 @@ abstract contract ZKEIP1271Manager is ZKAuth, ZKOwnerManager { | |
* @param signature Signature of the data | ||
* @return magicValue Magic value if the signature is valid or invalid id / invalid time range | ||
*/ | ||
function isValidSignature(bytes32 hash, bytes calldata signature) external view returns (bytes4 magicValue) { | ||
function isValidSignature(bytes32 hash, bytes calldata signature) external pure returns (bytes4 magicValue) { | ||
// todo | ||
(hash, signature); | ||
return _INVALID_ID; | ||
|
@@ -36,7 +36,7 @@ abstract contract ZKEIP1271Manager is ZKAuth, ZKOwnerManager { | |
*/ | ||
function _isValidSignature(bytes32 hash, bytes calldata signature) | ||
internal | ||
view | ||
pure | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This function is not actually defined in EIP. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made these modifications following the Warning messages that were output when I compiled the code in my local environment.
Regarding the choice of visibility modifiers, I considered pure to be appropriate since the current code does not access any state variables in contract. If it's anticipated that the todo sections you mentioned in the comments will involve accessing state variables, then it might be acceptable to ignore this warning. How do you think about it? |
||
returns (uint256 validationData, bool isValid) | ||
{ | ||
// todo | ||
|
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.
This specification is defined in EIP1271 and this should be a view function.
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.
Thank you for the information.
I referred to this: https://eips.ethereum.org/EIPS/eip-1271
I made these modifications following the Warning messages that were output when I compiled the code in my local environment.
Regarding the choice of visibility modifiers, I proposed the use of pure since the current code does not access any state variables. However, I will adhere to the proposal in EIP-1271.
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.
To clarify my understanding, is the following code intended for the todo section? This code is from the EIP-1271 proposal.