Add update_object
native function in TestScenario
#820
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.
Right now we use transfer to mimic returning an object back to the inventory.
This is not ideal because it will mix up with real transfers. I will also not allow us properly detect issues such as transferring a shared object.
This PR adds a native function that emits a new test-only event for updating the object.
It does the following, specifically:
update_object
native function. This function checks that we are not mutating an immutable object. And also emit aUPDATE_OBJECT_EVENT
.Some potential TODOs:
TestScenario::begin
, and then when processing a transfer, we look at the first event to see if we are in the test mode. If we are in the test mode, we could then process the inventory at that time.