-
Notifications
You must be signed in to change notification settings - Fork 831
add MAX_MONEY public constant to Amount #742
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
Conversation
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.
Could you add the same constant for unsigned Amount
too, please?
Note for other reviewers: Mul::mul
is not const
so 21_000_000 * Self::ONE_BTC
wouldn't work.
ae95829
to
b09cf9c
Compare
@Kixunil thanks, updated. |
We should address why @dpc reacted with thumbs down before we proceed on this. |
src/util/amount.rs
Outdated
@@ -270,6 +270,8 @@ impl Amount { | |||
pub const ONE_SAT: Amount = Amount(1); | |||
/// Exactly one bitcoin. | |||
pub const ONE_BTC: Amount = Amount(100_000_000); | |||
/// The maximum value allowed as an amount. Useful for sanity checking. | |||
pub const MAX_MONEY: SignedAmount = SignedAmount(21_000_000 * 100_000_000); |
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.
Looks like you forgot to remove Signed
:)
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.
🙏
@sanket1729 I think he thought it is an implementation of #620 but it isn't. @dpc could you clarify? |
b09cf9c
to
ab12410
Compare
Correct. Please don't mind me. |
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.
ACK ab12410
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.
ACK ab12410
Closes #740