Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[sui-framework] change test_only clock creation to return Clock objec…
…t instead of sharing (MystenLabs#10005) ## Description I propose that the `create_for_testing` function in the `clock` module be changed so that it returns the `Clock` object instead of sharing it. When the object is shared it requires the tests that rely on clock to utilize `test_scenario` which adds a lot of boilerplate to tests that otherwise wouldn't need it. AFAICT there's no advantage to sharing it. Also added `set_for_testing` function to manually set the timestamp to any value >= current timestamp. ## Test Plan `sui move test` --- If your changes are not user-facing and not a breaking change, you can skip the following section. Otherwise, please indicate what changed, and then add to the Release Notes section as highlighted during the release process. ### Type of Change (Check all that apply) - [x] user-visible impact - [ ] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes - [Breaking Change] `sui::clock::create_for_testing` now returns the created `Clock` rather than sharing it.
- Loading branch information