Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[sui framework] add vec_map::remove_entry_by_idx #4193

Merged
merged 4 commits into from
Sep 9, 2022
Merged

[sui framework] add vec_map::remove_entry_by_idx #4193

merged 4 commits into from
Sep 9, 2022

Conversation

juzybits
Copy link
Contributor

No description provided.

Copy link
Collaborator

@sblackshear sblackshear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks excellent, thanks!

Would you mind adding some tests for the success and failure case in https://github.com/MystenLabs/sui/blob/17f6960f8c1ab034ab05f00e5d6babb2877f451f/crates/sui-framework/tests/vec_map_tests.move ?

@juzybits
Copy link
Contributor Author

Done!
In addition to the new tests for remove_entry_by_idx, I pushed an additional commit modifying an existing test that looked like a copy/paste mistake.

Copy link
Collaborator

@sblackshear sblackshear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch on the older test

@sblackshear
Copy link
Collaborator

Ah, I forgot there's one more step to go through here. Adding a new function to the Sui framework changes the genesis blob, and we have snapshots of this blob that need to be updated. Please do:

cargo install cargo-insta
cd sui/crates/sui-config/tests # where the snapshots live
cargo insta review # type a to accept genesis snapshot changes
cargo insta test # to verify changes

Copy link
Collaborator

@sblackshear sblackshear left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For updating the genesis snaphsot

@juzybits
Copy link
Contributor Author

That seems to have worked (it updated crates/sui-config/tests/snapshots/snapshot_tests__empty_genesis_snapshot_matches.snap).

@sblackshear
Copy link
Collaborator

I think crates/sui-cost has a snapshot that needs to be updated in a similar way

@juzybits
Copy link
Contributor Author

Done! Results show that computationCost increased by 1 in some cases like Publish - I guess this is to be expected.

Cool tooling :). I'll try to keep all this in mind for the future.

@juzybits
Copy link
Contributor Author

Rebased my changes on top of main to avoid merge conflicts.

@sblackshear sblackshear merged commit 760ae2d into MystenLabs:main Sep 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants