Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vicsn committed Jun 6, 2023
1 parent a794c2a commit 5239635
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions algorithms/src/msm/variable_base/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl VariableBase {
let result = snarkvm_algorithms_cuda::msm::<G, G::Projective, <G::ScalarField as PrimeField>::BigInteger>(
bases, scalars,
);
if let Ok(result) = result {
if result.is_ok() {
return result;
}
}
Expand Down Expand Up @@ -114,8 +114,8 @@ mod tests {
let mut rng = TestRng::default();
for i in 2..17 {
let (bases, scalars) = create_scalar_bases::<G1Affine, Fr>(&mut rng, 1 << i);
let rust = standard::msm(bases.as_slice(), scalars.as_slice());
let cuda = VariableBase::msm::<G1Affine>(bases.as_slice(), scalars.as_slice());
let rust = standard::msm(bases.as_slice(), scalars.as_slice()).unwrap();
let cuda = VariableBase::msm::<G1Affine>(bases.as_slice(), scalars.as_slice()).unwrap();
assert_eq!(rust.to_affine(), cuda.to_affine());
}
}
Expand Down
12 changes: 6 additions & 6 deletions synthesizer/src/vm/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,13 @@ mod tests {

// Assert the size of the transaction.
let transaction_size_in_bytes = transaction.to_bytes_le().unwrap().len();
assert_eq!(2222, transaction_size_in_bytes, "Update me if serialization has changed");
assert_eq!(2214, transaction_size_in_bytes, "Update me if serialization has changed");

// Assert the size of the execution.
assert!(matches!(transaction, Transaction::Execute(_, _, _)));
if let Transaction::Execute(_, execution, _) = &transaction {
let execution_size_in_bytes = execution.to_bytes_le().unwrap().len();
assert_eq!(2187, execution_size_in_bytes, "Update me if serialization has changed");
assert_eq!(2179, execution_size_in_bytes, "Update me if serialization has changed");
}
}

Expand Down Expand Up @@ -258,13 +258,13 @@ mod tests {

// Assert the size of the transaction.
let transaction_size_in_bytes = transaction.to_bytes_le().unwrap().len();
assert_eq!(2099, transaction_size_in_bytes, "Update me if serialization has changed");
assert_eq!(2091, transaction_size_in_bytes, "Update me if serialization has changed");

// Assert the size of the execution.
assert!(matches!(transaction, Transaction::Execute(_, _, _)));
if let Transaction::Execute(_, execution, _) = &transaction {
let execution_size_in_bytes = execution.to_bytes_le().unwrap().len();
assert_eq!(2064, execution_size_in_bytes, "Update me if serialization has changed");
assert_eq!(2056, execution_size_in_bytes, "Update me if serialization has changed");
}
}

Expand All @@ -291,13 +291,13 @@ mod tests {

// Assert the size of the transaction.
let transaction_size_in_bytes = transaction.to_bytes_le().unwrap().len();
assert_eq!(2111, transaction_size_in_bytes, "Update me if serialization has changed");
assert_eq!(2103, transaction_size_in_bytes, "Update me if serialization has changed");

// Assert the size of the execution.
assert!(matches!(transaction, Transaction::Execute(_, _, _)));
if let Transaction::Execute(_, execution, _) = &transaction {
let execution_size_in_bytes = execution.to_bytes_le().unwrap().len();
assert_eq!(2076, execution_size_in_bytes, "Update me if serialization has changed");
assert_eq!(2068, execution_size_in_bytes, "Update me if serialization has changed");
}
}
}
2 changes: 1 addition & 1 deletion synthesizer/src/vm/execute_fee.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,6 @@ mod tests {
};
// Assert the size of the transition.
let fee_size_in_bytes = fee.to_bytes_le().unwrap().len();
assert_eq!(1935, fee_size_in_bytes, "Update me if serialization has changed");
assert_eq!(1927, fee_size_in_bytes, "Update me if serialization has changed");
}
}

0 comments on commit 5239635

Please sign in to comment.