Separate Amount::{from_i64, from_nonnegative_i64} APIs

This is more intuitive than a boolean flag for handling non-negative
Amounts stored in i64 values.
This commit is contained in:
Jack Grigg
2019-08-08 00:55:23 +01:00
parent 59ed258c7f
commit 7c07914bfd
6 changed files with 46 additions and 32 deletions

View File

@@ -705,7 +705,7 @@ pub extern "system" fn librustzcash_sapling_final_check(
binding_sig: *const [c_uchar; 64],
sighash_value: *const [c_uchar; 32],
) -> bool {
let value_balance = match Amount::from_i64(value_balance, true) {
let value_balance = match Amount::from_i64(value_balance) {
Ok(vb) => vb,
Err(()) => return false,
};
@@ -1028,7 +1028,7 @@ pub extern "system" fn librustzcash_sapling_binding_sig(
sighash: *const [c_uchar; 32],
result: *mut [c_uchar; 64],
) -> bool {
let value_balance = match Amount::from_i64(value_balance, true) {
let value_balance = match Amount::from_i64(value_balance) {
Ok(vb) => vb,
Err(()) => return false,
};