From 6ad27c15e3796de4a3c059d24602f18a84a4015e Mon Sep 17 00:00:00 2001 From: joe bebel <55120843+joebebel@users.noreply.github.com> Date: Fri, 22 Sep 2023 01:16:16 -0700 Subject: [PATCH] fix tests i32->i128 --- masp_primitives/src/convert.rs | 14 +++++++------- masp_proofs/src/circuit/convert.rs | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/masp_primitives/src/convert.rs b/masp_primitives/src/convert.rs index 27e3ba65..ae047749 100644 --- a/masp_primitives/src/convert.rs +++ b/masp_primitives/src/convert.rs @@ -199,12 +199,12 @@ mod tests { #[test] fn test_homomorphism() { // Left operand - let a = ValueSum::from_pair(zec(), 5i32).unwrap() - + ValueSum::from_pair(btc(), 6i32).unwrap() - + ValueSum::from_pair(xan(), 7i32).unwrap(); + let a = ValueSum::from_pair(zec(), 5i128).unwrap() + + ValueSum::from_pair(btc(), 6i128).unwrap() + + ValueSum::from_pair(xan(), 7i128).unwrap(); // Right operand let b = - ValueSum::from_pair(zec(), 2i32).unwrap() + ValueSum::from_pair(xan(), 10i32).unwrap(); + ValueSum::from_pair(zec(), 2i128).unwrap() + ValueSum::from_pair(xan(), 10i128).unwrap(); // Test homomorphism assert_eq!( AllowedConversion::from(a.clone() + b.clone()), @@ -214,9 +214,9 @@ mod tests { #[test] fn test_serialization() { // Make conversion - let a: AllowedConversion = (ValueSum::from_pair(zec(), 5i32).unwrap() - + ValueSum::from_pair(btc(), 6i32).unwrap() - + ValueSum::from_pair(xan(), 7i32).unwrap()) + let a: AllowedConversion = (ValueSum::from_pair(zec(), 5i128).unwrap() + + ValueSum::from_pair(btc(), 6i128).unwrap() + + ValueSum::from_pair(xan(), 7i128).unwrap()) .into(); // Serialize conversion let mut data = Vec::new(); diff --git a/masp_proofs/src/circuit/convert.rs b/masp_proofs/src/circuit/convert.rs index c8bcb300..7fbcc88b 100644 --- a/masp_proofs/src/circuit/convert.rs +++ b/masp_proofs/src/circuit/convert.rs @@ -150,9 +150,9 @@ fn test_convert_circuit_with_bls12_381() { let output_asset = AssetType::new(format!("asset {}", i + 1).as_bytes()).unwrap(); let mint_asset = AssetType::new(b"reward").unwrap(); - let spend_value = -(i as i32 + 1); - let output_value = i as i32 + 1; - let mint_value = i as i32 + 1; + let spend_value = -(i as i128 + 1); + let output_value = i as i128 + 1; + let mint_value = i as i128 + 1; let allowed_conversion: AllowedConversion = (ValueSum::from_pair(spend_asset, spend_value) .unwrap()