Amount::{zero, is_positive, is_negative}

This commit is contained in:
Jack Grigg
2019-07-25 20:50:17 +01:00
parent fa50d551c8
commit 0ea4408d46
3 changed files with 21 additions and 4 deletions

View File

@@ -79,7 +79,7 @@ impl SaplingOutput {
Some(g_d) => g_d,
None => return Err(Error(ErrorKind::InvalidAddress)),
};
if value.0 < 0 {
if value.is_negative() {
return Err(Error(ErrorKind::InvalidAmount));
}
@@ -288,7 +288,7 @@ impl<R: RngCore + CryptoRng> Builder<R> {
to: &TransparentAddress,
value: Amount,
) -> Result<(), Error> {
if value.0 < 0 {
if value.is_negative() {
return Err(Error(ErrorKind::InvalidAmount));
}