Skip to content

Commit

Permalink
fix tests i32->i128
Browse files Browse the repository at this point in the history
  • Loading branch information
joe bebel committed Sep 22, 2023
1 parent 339ca85 commit 6ad27c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions masp_primitives/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand All @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions masp_proofs/src/circuit/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 6ad27c1

Please sign in to comment.