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

[Framework] Receiver function aliases for package.move #17205

Merged
merged 1 commit into from
Apr 18, 2024
Merged

Conversation

amnn
Copy link
Contributor

@amnn amnn commented Apr 17, 2024

Description

sui::package has definitions of multiple types where we have had to disambiguate function names. Adding some receiver function aliases so that we don't need to use the disambiguated names when they are called as receiver functions.

Test plan

CI


Release notes

Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required.

For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates.

  • Protocol:
  • Nodes (Validators and Full nodes):
  • Indexer:
  • JSON-RPC:
  • GraphQL:
  • CLI: Adds receiver function aliases for functions in the sui::publisher module.
  • Rust SDK:

`sui::package` has definitions of multiple types where we have had to
disambiguate function names. Adding some receiver function aliases so
that we don't need to use the disambiguated names when they are called
as receiver functions.

## Test plan

CI
@amnn amnn requested review from cgswords, damirka and a team April 17, 2024 13:28
@amnn amnn self-assigned this Apr 17, 2024
Copy link

vercel bot commented Apr 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Ignored Deployments
Name Status Preview Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Apr 17, 2024 1:28pm
sui-kiosk ⬜️ Ignored (Inspect) Apr 17, 2024 1:28pm
sui-typescript-docs ⬜️ Ignored (Inspect) Apr 17, 2024 1:28pm

Copy link
Contributor

@tnowacki tnowacki left a comment

Choose a reason for hiding this comment

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

LGTM. I don't know if we actually associate doc comments with public use funs currently, shall be interesting


/// Allows calling `.module_` to access the name of the module a
/// `Publisher` was derived from.
public use fun published_module as Publisher.module_;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public use fun published_module as Publisher.module_;
public use fun published_module as Publisher.`module`;

Thoughts? Feelings?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have ...mixed feelings, but not very strong, so happy to be persuaded.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will land, but let me know if you do feel strongly about using the backticks for this (for me it makes the receiver syntax fiddlier/more conspicious than the non-receiver function, vs tacking an underscore on the end).

@amnn amnn merged commit 5e95699 into main Apr 18, 2024
44 checks passed
@amnn amnn deleted the amnn/pkg-use-fun branch April 18, 2024 09:44
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