-
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
test: add extreme case tests #971
Conversation
e8d390e
to
16db798
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.
LG
16db798
to
c71b9f3
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.
Whoami to approve? Looks good in the eyes of an amateur. Something new to learn 🙂
}); | ||
}); | ||
|
||
describe('testing follow/unfollow a contract that has an infinite loop in urd', () => { |
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.
So.. a newbie question, how does it pass with this infinite loop running?
I see we get to
ILSP1UniversalReceiver(addr).universalReceiver(
_TYPEID_LSP26_FOLLOW,
abi.encodePacked(msg.sender)
)
In the LSP26 contract and how does it not fail meaning the loop doesn't prevent transaction from failing letting the user to follow/unfollow?
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 external call to the contract that has the unviersalReceiver
function with an infinite loop reverts, but due to the fact that we call that function using try/catch
and we don't do anything in the catch
, it does not revert while following or unfollowing someone. Usually you would catch the revert in the catch block and do what you need to from there. In our case we want to make sure we notify yet never revert.
What does this PR introduce?
🧪 Tests
Add tests:
PR Checklist
npm run lint
&&npm run lint:solidity
(solhint)npm run format
(prettier)npm run build
npm run test