-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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] Adds mint_and_transfer and burn_ entrypoints, changes argument order in mint() #2655
Conversation
@@ -170,9 +170,23 @@ module sui::coin { | |||
|
|||
// === Entrypoints === | |||
|
|||
/// Mint `amount` of `Coin` and send it to `recipient`. Invokes `mint()`. | |||
public entry fun mint_<T>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I totally agree with the requirement of having entry functions for these flows (as it will help new Coins to be created in just a few lines of code), but we need to agree on the naming convention. Is the _
the pattern we're looking for as best practice here or mint_to_sender
etc? @tnowacki
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The _
convention was from when you actually needed a separate function for visibility reasons.
This feels a bit different though since the functionality is actually different. I would advise something like mint_and_transfer
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tnowacki what do you think about burn_ in that context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The one where it drops the u64
? Feels okay.
I would ask yourself, What would the and_<verb>
version be? If it is un-interesting, just an _
is fine. If its something like and_transfer_to_someone
, you probably want a different name or suffix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the way!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accepting to unblock you for the demo!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@damirka agree with Sam re accepting this to unblock, can you work on the test failures? Maybe we should either have a separate PR with the field swapping on the old api refactoring that breaks tests, so this PR only deals with the new api OR we resolve all failed tests (in order to be able to merge)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
… argument order in mint() (#2655)
Closes #2653
Closes #2654