Skip to content

Commit

Permalink
fix: remove boolean trace test
Browse files Browse the repository at this point in the history
  • Loading branch information
gbotrel committed Dec 20, 2022
1 parent 19312ea commit 2128e51
Showing 1 changed file with 0 additions and 36 deletions.
36 changes: 0 additions & 36 deletions debug_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,42 +137,6 @@ func TestTraceNotEqual(t *testing.T) {
}
}

// -------------------------------------------------------------------------------------------------
// Not boolean
type notBooleanTrace struct {
B, C frontend.Variable
}

func (circuit *notBooleanTrace) Define(api frontend.API) error {
d := api.Add(circuit.B, circuit.C)
api.AssertIsBoolean(d)
return nil
}

func TestTraceNotBoolean(t *testing.T) {
assert := require.New(t)

var circuit, witness notBooleanTrace
// witness.A = 1
witness.B = 24
witness.C = 42

{
_, err := getGroth16Trace(&circuit, &witness)
assert.Error(err)
assert.Contains(err.Error(), "constraint #0 is not satisfied: [assertIsBoolean] 66 == (0|1)")
assert.Contains(err.Error(), "(*notBooleanTrace).Define")
assert.Contains(err.Error(), "debug_test.go:")
}
{
_, err := getPlonkTrace(&circuit, &witness)
assert.Error(err)
assert.Contains(err.Error(), "constraint #1 is not satisfied: [assertIsBoolean] 66 == (0|1)")
assert.Contains(err.Error(), "(*notBooleanTrace).Define")
assert.Contains(err.Error(), "debug_test.go:")
}
}

func getPlonkTrace(circuit, w frontend.Circuit) (string, error) {
ccs, err := frontend.Compile(ecc.BN254.ScalarField(), scs.NewBuilder, circuit)
if err != nil {
Expand Down

0 comments on commit 2128e51

Please sign in to comment.