forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[move]
TestScenario
code for mocking multi-transaction scenarios wi…
…th realistic access control The idea here is to mimic the access control model of Sui (e.g. a tx can only touch objects owned by its sender) in pure Move. This will allow application developers to discover bugs about their sharing logic in Move unit tests, as well as to test the basics like whether an object was transferred to the correct user. See inline comments in `TestScenario` for more detail, but the basics are - Create a test scenario with `TestScenario::begin(sender_address)`. - Advance to the next tx in the scenario with `TestScenario::next_tx(scenario, sender_address)` - The sender of the current tx can remove objects transferred to them by previous txes with `TestScenario::remove_object` - If the sender wants to use a removed object in future txes, it must return it with `TestScenario::return_object`
- Loading branch information
1 parent
fbac694
commit 3f9968c
Showing
16 changed files
with
936 additions
and
145 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 was deleted.
Oops, something went wrong.
Oops, something went wrong.