Skip to content

Commit

Permalink
Simplify error string generation
Browse files Browse the repository at this point in the history
  • Loading branch information
fmoletta committed Mar 20, 2024
1 parent 5bf94b4 commit 85cbc1b
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions vm/src/vm/runners/builtin_runner/add_mul_mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,15 +553,8 @@ impl ModBuiltinRunner {
let a_op_b = apply_op(&a, &b, &op)?.mod_floor(&inputs.p);
if a_op_b != c.mod_floor(&inputs.p) {
// Build error string
let error_string = format!("Expected a {} b == c (mod p). Got: instance={}, batch={}, p={}, a={}, b={}, c={}.",
op,
instance,
index_in_batch,
inputs.p,
a,
b,
c
);
let p = inputs.p;
let error_string = format!("Expected a {op} b == c (mod p). Got: instance={instance}, batch={index_in_batch}, p={p}, a={a}, b={b}, c={c}.");
return Err(RunnerError::ModBuiltinSecurityCheck(
self.name().to_string(),
error_string,
Expand Down

0 comments on commit 85cbc1b

Please sign in to comment.