This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
seal_reentrant_count returns contract reentrant count
#11539
Closed
Closed
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
a8214fd
Add logic, test, broken benchmark
yarikbratashchuk 143c158
Merge branch 'master' into seal_reentrant_count
yarikbratashchuk 219eb84
Merge branch 'master' into seal_reentrant_count
yarikbratashchuk fccd751
account_entrance_count
yarikbratashchuk 0a70239
Addressing comments
yarikbratashchuk 6f3655a
Address @agryaznov's comments
yarikbratashchuk f29884b
Add test for account_entrance_count, fix ci
yarikbratashchuk 72c8f83
Cargo fmt
yarikbratashchuk 0f6f894
Fix tests
yarikbratashchuk 949c438
Fix tests
yarikbratashchuk f34b6da
Remove delegated call from test, address comments
yarikbratashchuk a036585
Minor fixes and indentation in wat files
yarikbratashchuk 3be772e
Update test for account_entrance_count
yarikbratashchuk 5fdc100
Update reentrant_count_call test
yarikbratashchuk b656c88
Delegate call test
yarikbratashchuk 17bb81f
Cargo +nightly fmt
yarikbratashchuk 2f7f405
Address comments
yarikbratashchuk 5f01797
Update reentrant_count_works test
yarikbratashchuk 013e3bf
Merge branch 'master' into master
yarikbratashchuk 3948142
Apply weights diff
yarikbratashchuk 9c0c06f
Add fixture descriptions
yarikbratashchuk 9c5bb47
Update comments as suggested
yarikbratashchuk 35c0349
Update reentrant_count_call test to use seal_address
yarikbratashchuk 3400632
Merge branch 'paritytech:master' into master
RustNinja ebde8e1
Merge branch 'paritytech:master' into master
Artemka374 321a828
change account_entrance_count_call fixture to use seal_caller
Artemka374 ee63f37
Merge remote-tracking branch 'paritytech/master'
Artemka374 3463795
fix compilation errors and apply some suggestions
Artemka374 1649d37
apply suggestions
Artemka374 8d94425
cargo fmt
Artemka374 0e48a2d
apply suggestions
Artemka374 7db2660
Merge remote-tracking branch 'paritytech/master'
Artemka374 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Minor fixes and indentation in wat files
- Loading branch information
commit a036585d76e85c578e09cfc5c4cdc49e70e89ff6
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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_callerand expect differentseal_account_entrance_countresults for the casescallee == callerandcallee != caller; orseal_account_entrance_countresults for the casescallee == callerandcallee != 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_countwith$seal_returnand check it outside the contract.