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 predicate_id() to the std-lib #5425

Merged
merged 11 commits into from
Jan 3, 2024
Merged

Introduce predicate_id() to the std-lib #5425

merged 11 commits into from
Jan 3, 2024

Conversation

bitzoic
Copy link
Member

@bitzoic bitzoic commented Dec 29, 2023

Description

A predicate's address can be accessed internally from within a predicate. This functionality has been added to the std-lib with the predicate_id() function.

Closes #5411

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.

@bitzoic bitzoic added enhancement New feature or request lib: std Standard library labels Dec 29, 2023
@bitzoic bitzoic requested a review from a team December 29, 2023 17:13
@bitzoic bitzoic self-assigned this Dec 29, 2023
@bitzoic bitzoic linked an issue Dec 29, 2023 that may be closed by this pull request
sway-lib-std/src/auth.sw Outdated Show resolved Hide resolved
test/src/sdk-harness/test_projects/auth/mod.rs Outdated Show resolved Hide resolved
@bitzoic bitzoic requested review from SwayStar123 and a team December 29, 2023 18:12
SwayStar123
SwayStar123 previously approved these changes Dec 29, 2023
@bitzoic bitzoic requested a review from a team December 29, 2023 18:14
xunilrj
xunilrj previously approved these changes Dec 29, 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.

I don't believe that this belongs in the auth module but at the same time I don't like the idea of having a new module with a single function

test/src/sdk-harness/test_projects/auth/mod.rs Outdated Show resolved Hide resolved
sway-lib-std/src/auth.sw Outdated Show resolved Hide resolved
sway-lib-std/src/auth.sw Outdated Show resolved Hide resolved
@bitzoic
Copy link
Member Author

bitzoic commented Jan 2, 2024

I don't believe that this belongs in the auth module but at the same time I don't like the idea of having a new module with a single function

auth was chosen as all other instances of the gm opcode are used there as well and there are no conflicts or circular dependencies on imports.

@bitzoic bitzoic dismissed stale reviews from SwayStar123 and xunilrj via cb805f4 January 2, 2024 17:10
@bitzoic bitzoic requested review from SwayStar123, Braqzen and a team January 2, 2024 17:10
Braqzen
Braqzen previously approved these changes Jan 2, 2024
@bitzoic bitzoic requested a review from a team January 3, 2024 15:14
@bitzoic bitzoic requested a review from a team January 3, 2024 15:28
@xunilrj xunilrj merged commit f122693 into master Jan 3, 2024
35 checks passed
@xunilrj xunilrj deleted the bitzoic-5411 branch January 3, 2024 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lib: std Standard library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Get predicate address
4 participants