-
Notifications
You must be signed in to change notification settings - Fork 4
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: add e3Id
and seed
to validate()
calls to IE3Program
and IComputeProvider
#43
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 | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -7,6 +7,8 @@ contract MockE3Program is IE3Program { | |||||||||
error invalidParams(bytes params); | ||||||||||
|
||||||||||
function validate( | ||||||||||
uint256, | ||||||||||
uint256, | ||||||||||
Comment on lines
+10
to
+11
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. Review the addition of new parameters in the The addition of two However, the function parameters are unnamed, which could lead to confusion and errors in future maintenance or development. Naming these parameters would improve readability and maintainability of the code. Consider naming the parameters to enhance clarity: - function validate(uint256, uint256, bytes memory params)
+ function validate(uint256 e3Id, uint256 seed, bytes memory params) Committable suggestion
Suggested change
|
||||||||||
bytes memory params | ||||||||||
) external pure returns (IInputValidator inputValidator) { | ||||||||||
require(params.length == 32, "invalid params"); | ||||||||||
|
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.
Review the function body for potential improvements.
The function body uses both inline assembly and
abi.decode
to manipulate and decode theparams
. This redundancy could lead to confusion and potential errors. It's recommended to stick to one method for clarity and safety, preferablyabi.decode
which is safer and more readable than inline assembly.Consider simplifying the function body by removing the inline assembly:
Review the addition of new parameters to the
validate
function.The addition of two
uint256
parameters (e3Id
andseed
) to thevalidate
function is aligned with the PR objectives and the linked issue #33. This change is intended to pass necessary context to the contracts, enhancing their functionality and interoperability.However, the parameters are unnamed in the function signature, which might reduce code readability and maintainability. It's recommended to name these parameters to clarify their purpose.
Consider naming the parameters for better clarity and maintainability:
Committable suggestion