From e25b614573821ba8f6f93ffd2e17afd3b06d4233 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Fri, 30 Nov 2018 23:04:04 +0000 Subject: [PATCH] Match error message in Amount::Read_i64() to allow_negative value --- zcash_primitives/src/transaction/components.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zcash_primitives/src/transaction/components.rs b/zcash_primitives/src/transaction/components.rs index 354fe9b..21dbd46 100644 --- a/zcash_primitives/src/transaction/components.rs +++ b/zcash_primitives/src/transaction/components.rs @@ -37,7 +37,11 @@ impl Amount { } else { Err(io::Error::new( io::ErrorKind::InvalidData, - "Amount not in {0..MAX_MONEY}", + if allow_negative { + "Amount not in {-MAX_MONEY..MAX_MONEY}" + } else { + "Amount not in {0..MAX_MONEY}" + }, )) } }