-
Notifications
You must be signed in to change notification settings - Fork 11.4k
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 Balance module #1573
Conversation
A few random comments:
|
} | ||
|
||
/// Create an empty `Balance` for type `T`. | ||
public fun empty<T>(): Balance<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.
This feels a bit asymmetric with Coin::zero
to me. I don't have a strong preference for empty
vs zero
, but I think we should probably pick the same name for both.
module Sui::Balance { | ||
friend Sui::Coin; | ||
|
||
const ENONZERO: u64 = 0; |
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.
Nit: comments on error codes and more descriptive names
Covers #1233.
Pros
TxContext
at all and has no IDs - which is great!Cons
Coin
handles minting, Balance is always bound to it and cannot be used freely for custom implementations of finances;