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.
[Deepbook] Adding empty return to list_open_orders (MystenLabs#14940)
## Description Previous `list_open_orders` function crashes on empty attempting to borrow from a df that does not exist. <img width="1327" alt="image" src="https://github.com/MystenLabs/sui/assets/123408603/f1cc8b2b-e9cf-4b76-ab4c-a090bedd0807"> This PR adds an error check and a test to ensure that this will not fail with error, but instead return an empty vector. Also this includes an accessor function to usr_open_orders so other contracts can call this to check user positions ## Test Plan How did you test the new or updated feature? unit 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) - [ ] protocol change - [ ] 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
- Loading branch information
1 parent
033fa9e
commit 75c7d3f
Showing
5 changed files
with
85 additions
and
16 deletions.
There are no files selected for viewing
Binary file modified
BIN
+163 Bytes
(100%)
...t/bytecode_snapshot/32/0x000000000000000000000000000000000000000000000000000000000000dee9
Binary file not shown.
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