-
Notifications
You must be signed in to change notification settings - Fork 48
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
fix: avoid duplicate calls on withdraw hook when sender is also the recipient #826
Conversation
f05f52e
to
d09f415
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.
I like the idea to divide the tests in multiple files to avoid super complicated tree branches.
test/integration/concrete/lockup/withdraw-hooks/withdrawHooks.t.sol
Outdated
Show resolved
Hide resolved
test/integration/concrete/lockup/withdraw-hooks/withdrawHooks.t.sol
Outdated
Show resolved
Hide resolved
test/integration/concrete/lockup/withdraw-hooks/withdrawHooks.t.sol
Outdated
Show resolved
Hide resolved
test: remove test headers test: rename withdrawHooks test functions test: add more modifiers in withdrawHooks tests
@smol-ninja i've pushed a commit to address my feedback, lmk if it does look good |
Yes. Looks good to me. |
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.
Feedback in the comments.
Also, could you confirm that setting count
to 0 will fail the test if there's at least one call made?
Please answer here:
test/integration/concrete/lockup/withdraw-hooks/withdrawHooks.tree
Outdated
Show resolved
Hide resolved
test/integration/concrete/lockup/withdraw-hooks/withdrawHooks.tree
Outdated
Show resolved
Hide resolved
test/integration/concrete/lockup/withdraw-hooks/withdrawHooks.t.sol
Outdated
Show resolved
Hide resolved
…ation test: rename modifiers name in withdrawHooks.t.sol test: refactor withdrawHooks.tree
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.
looks good now
This PR introduced the I can no longer see that file on |
It looks like the hook tests have been removed in this PR: But I still don't understand why. |
You are right. It got deleted in LockupTranched PR. I was the reviewer so its my mistake that I overlooked it. @andreivladbrg can you please confirm that it was an accident or is there a reason that I cannot recall?
In withdrawHooks.tree, there is a branch that tests it when sender and recipient are same. I have fixed it in #873 in case it was an accident. And thank you very much @PaulRBerg for identifying it 🙏🫡 |
It is also my mistake.
I confirm that it was an accident. There was no reason to remove them. I can't explain what happened there, most likely something to lots of git rebases and git force pushes. Nice finding @PaulRBerg and thanks for pointing out. |
Thanks guys for confirming. And no worries - error is the default state of affairs. |
…ecipient (#826) * fix: mitigate duplicate calls on withdraw hook when sender is recipient * test: add integration tests for withdraw hook calls * test: rename create default stream functions test: remove test headers test: rename withdrawHooks test functions test: add more modifiers in withdrawHooks tests * refactor: low priority to "sender != recipient" check for gas optimization test: rename modifiers name in withdrawHooks.t.sol test: refactor withdrawHooks.tree --------- Co-authored-by: andreivladbrg <[email protected]>
…ecipient (#826) * fix: mitigate duplicate calls on withdraw hook when sender is recipient * test: add integration tests for withdraw hook calls * test: rename create default stream functions test: remove test headers test: rename withdrawHooks test functions test: add more modifiers in withdrawHooks tests * refactor: low priority to "sender != recipient" check for gas optimization test: rename modifiers name in withdrawHooks.t.sol test: refactor withdrawHooks.tree --------- Co-authored-by: andreivladbrg <[email protected]>
Fixes #822