-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(engine): remove unnecessary allocations from GetNonFungibleIds (#861
) Description --- Remove unnecessary allocation when calling `VaultAction::GetNonFungibleIds` and `BucketAction::GetNonFungibleIds` Motivation and Context --- Previously, when we were using borsh encoding, `BTreeSet`s would not deserialize in the WASM (unfortunately, no specific details in my code comment). Since the change to use CBOR this is no longer the case, which allows us to encode a reference to the BTreeSet without the into_iter/collect conversion to a Vec. Since Sets and Vecs are represented in the same CBOR binary format, we can deserialize from a BTreeSet to a Vec. It is important to remove any unnecessary contract execution resource usage. How Has This Been Tested? --- Modified existing test to call the bucket get_non_fungible_ids method. Vault get_non_fungible is already tested. What process can a PR reviewer use to test or verify this change? --- Engine tests Breaking Changes --- - [x] None - [ ] Requires data directory to be deleted - [ ] Other - Please specify
- Loading branch information
Showing
4 changed files
with
26 additions
and
11 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