-
Notifications
You must be signed in to change notification settings - Fork 50
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 batch function #1070
feat: add batch function #1070
Conversation
Thank you for the PR Andrei. I'd like to make a small suggestion. When a PR depends on another PR, can we please have the base branch set as the branch from another PR? This makes it easier to review and work with a child PR asynchronously. I know that by changing the URL I can see the diff but I use the "viewed checkbox" feature in Github UI to track which files have been reviewed and which are left to be reviewed. To be more explicit, In the description, it can be mentioned that this PR requires this another PR to be merged first. Does that make sense? |
d8ed354
to
0e35fc1
Compare
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.
Good work on this PR. Left a few comments below:
bytes[] memory calls = new bytes[](1); | ||
calls[0] = abi.encodeCall(dai.balanceOf, (users.recipient)); | ||
|
||
Batch(address(lockup)).batch(calls); |
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.
Missing expectRevert
statement.
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.
hmm, curious why the test isn't failing then, i guess the branch should say it should do nothing
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.
Did you figure out why its not failing?
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.
It did not revert because dai.balanceOf
encodes to balanceOf(address)
selector which is a valid function in ERC721
contract. I fixed it in 5713f40.
I also want to mention that because the test was not failing, changing branch to it should do nothing
should not be a solution. This is an example of white box testing where you tried to curve fit the test to made them pass. Referring to my discussion on white box testing vs black box testing, in a black box testing, we wont change the test but rather investigate the internal logic in such cases.
I look forward to see your comments on my discussion.
@smol-ninja just pushed a commit to addres your feedback, lmk if it looks good |
4865b3c
to
104a048
Compare
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.
Feel free to merge it after merging #1058.
test: add minimal tests for batch function
ba555e2
to
743e494
Compare
* feat: add batch contract test: add minimal tests for batch function * shub feedback * test: fix test for batch * fix: correct import of Batch contract --------- Co-authored-by: smol-ninja <[email protected]>
Closes #1053