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

Introduce the AssetId type #4955

Merged
merged 68 commits into from Sep 6, 2023
Merged

Introduce the AssetId type #4955

merged 68 commits into from Sep 6, 2023

Conversation

SwayStar123
Copy link
Member

Description

Change AssetId from alias to struct. Allows implementing of methods. Also moved the helper functions into the struct as methods.

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.

@SwayStar123 SwayStar123 added the lib: std Standard library label Aug 15, 2023
@SwayStar123 SwayStar123 self-assigned this Aug 15, 2023
@bitzoic
Copy link
Member

bitzoic commented Aug 15, 2023

This is a non-trivial change and involves breaking changes to existing libraries, applications, the rust SDK, the typescript SDK, and the indexer.

@bitzoic bitzoic added the breaking May cause existing user code to break. Requires a minor or major release. label Aug 15, 2023
@bitzoic bitzoic changed the title Change AssetId from alias to struct Introduce the AssetId type Aug 15, 2023
@SwayStar123
Copy link
Member Author

contract id needs to import asset id and assetid needs to import contract id, rip lol

SwayStar123 and others added 4 commits September 5, 2023 23:49
Co-authored-by: Braqzen <103777923+Braqzen@users.noreply.github.com>
Co-authored-by: Braqzen <103777923+Braqzen@users.noreply.github.com>
Co-authored-by: Braqzen <103777923+Braqzen@users.noreply.github.com>
Braqzen
Braqzen previously approved these changes Sep 5, 2023
bitzoic
bitzoic previously approved these changes Sep 6, 2023
Copy link
Contributor

@Braqzen Braqzen left a comment

Choose a reason for hiding this comment

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

@bitzoic has recently raised an issue for the keccak256 hashing so I guess we can leave it for that instead of this PR

sway-lib-std/src/contract_id.sw Outdated Show resolved Hide resolved
@anton-trunov
Copy link
Contributor

There is a bunch of lines like this one:

        let asset_id = sha256((contract_id(), ZERO_B256));

in test/src/sdk-harness/test_artifacts/context_caller_contract/src/main.sw

I'm not sure if it's related to this PR or not.

anton-trunov
anton-trunov previously approved these changes Sep 6, 2023
@SwayStar123 SwayStar123 enabled auto-merge (squash) September 6, 2023 12:36
@SwayStar123 SwayStar123 merged commit 159a240 into master Sep 6, 2023
28 checks passed
@SwayStar123 SwayStar123 deleted the asset_id_struct branch September 6, 2023 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking May cause existing user code to break. Requires a minor or major release. lib: std Standard library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants