This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
seal_reentrant_count
returns contract reentrant count #11539seal_reentrant_count
returns contract reentrant count #11539Changes from 19 commits
a8214fd
143c158
219eb84
fccd751
0a70239
6f3655a
f29884b
72c8f83
0f6f894
949c438
f34b6da
a036585
3be772e
5fdc100
b656c88
17bb81f
2f7f405
5f01797
013e3bf
3948142
9c0c06f
9c5bb47
35c0349
3400632
ebde8e1
321a828
ee63f37
3463795
1649d37
8d94425
0e48a2d
7db2660
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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 is not the case in general for this particular fixture, and solely depends on arguments it's been called with. In your
account_entrance_count_works()
test you indeed call it with the same address as the caller's, but I think it's better not to make the fixture so tightly coupled with the test. So I would suggest two ways to improve this:seal_caller
and expect differentseal_account_entrance_count
results for the casescallee == caller
andcallee != caller
; orseal_account_entrance_count
results for the casescallee == caller
andcallee != caller
.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.
Hello, I'm not sure about it, but do callee and caller actually equal in test? Cause as I see the origin of call is ALICE and we are calling contract address, and if we are changing fixture the way you explained above, it says that caller != callee. So it is interesting to know am I getting this right=)
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 meant here that the way the contract fixture is being called, and hence the expected state of the call stack - this all should be set in the outer unit test, and no assumption on this regard should be hard-coded into the fixture. Just return the
account_entrance_count
with$seal_return
and check it outside the contract.