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

Fix containing StorageStrings in StorageVecs #6043

Merged
merged 2 commits into from
May 22, 2024

Conversation

ironcev
Copy link
Member

@ironcev ironcev commented May 21, 2024

Description

This PR fixes #6036 by using field_id() in the StorageString instead of slot().

Additionally, the PR:

  • fixes documentation glitches in the StorageVec.
  • optimizes StorageMap::get by removing double calculation of the key.
  • cleans up most of the Sway and all Rust warnings in the SDK harness tests.

The PR is not solving all the issues related to composing dynamic storage types. E.g, #6040 is (very likely just one) of them.

Closes #6036.

Checklist

  • I have linked to any relevant issues.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation where relevant (API docs, the reference, and the Sway book).
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added (or requested a maintainer to add) the necessary Breaking* or New Feature labels where relevant.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

@ironcev ironcev self-assigned this May 21, 2024
@ironcev ironcev added bug Something isn't working lib: std Standard library labels May 21, 2024
@ironcev ironcev changed the title Fix nesting StorageString in StorageVec Fix nesting StorageStrings in StorageVecs May 21, 2024
@ironcev ironcev marked this pull request as ready for review May 21, 2024 16:12
@ironcev ironcev requested review from bitzoic, SwayStar123, sdankel and a team May 21, 2024 16:12
@ironcev ironcev enabled auto-merge (squash) May 21, 2024 16:14
@ironcev ironcev changed the title Fix nesting StorageStrings in StorageVecs Fix containing StorageStrings in StorageVecs May 21, 2024
Copy link
Member

@bitzoic bitzoic left a comment

Choose a reason for hiding this comment

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

🎉

@ironcev ironcev merged commit 6621833 into master May 22, 2024
37 checks passed
@ironcev ironcev deleted the ironcev/6036-storage-string-in-storage-vec branch May 22, 2024 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lib: std Standard library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pushing a StorageString to StorageVec overwrites all values with the latest
3 participants