Browse Source

Test all fields of parsed binary pk

feature/missingPolsC
Eduard S 4 years ago
parent
commit
6d4b1abc10
2 changed files with 17 additions and 0 deletions
  1. +1
    -0
      cli/.gitignore
  2. +16
    -0
      parsers/parsers_test.go

+ 1
- 0
cli/.gitignore

@ -0,0 +1 @@
cli

+ 16
- 0
parsers/parsers_test.go

@ -238,6 +238,11 @@ func testCircuitParsePkBin(t *testing.T, circuit string) {
assert.Equal(t, pkJ.B2, pk.B2) assert.Equal(t, pkJ.B2, pk.B2)
assert.Equal(t, pkJ.C, pk.C) assert.Equal(t, pkJ.C, pk.C)
assert.Equal(t, pkJ.HExps[:pkJ.DomainSize], pk.HExps[:pk.DomainSize]) // circom behaviour assert.Equal(t, pkJ.HExps[:pkJ.DomainSize], pk.HExps[:pk.DomainSize]) // circom behaviour
assert.Equal(t, pkJ.NVars, pk.NVars)
assert.Equal(t, pkJ.NPublic, pk.NPublic)
assert.Equal(t, pkJ.DomainSize, pk.DomainSize)
assert.Equal(t, pkJ.PolsC, pk.PolsC)
} }
func TestParsePkBin(t *testing.T) { func TestParsePkBin(t *testing.T) {
@ -274,6 +279,17 @@ func testGoCircomPkFormat(t *testing.T, circuit string) {
assert.Equal(t, pk.HExps, pkG.HExps) assert.Equal(t, pk.HExps, pkG.HExps)
assert.Equal(t, pk.PolsA, pkG.PolsA) assert.Equal(t, pk.PolsA, pkG.PolsA)
assert.Equal(t, pk.PolsB, pkG.PolsB) assert.Equal(t, pk.PolsB, pkG.PolsB)
assert.Equal(t, pk.NVars, pkG.NVars)
assert.Equal(t, pk.NPublic, pkG.NPublic)
assert.Equal(t, pk.DomainSize, pkG.DomainSize)
assert.Equal(t, pk.PolsC, pkG.PolsC)
// pkPrettyJSON, err := json.MarshalIndent(pk, "", " ")
// require.Nil(t, err)
// pkGoPrettyJSON, err := json.MarshalIndent(pkG, "", " ")
// require.Nil(t, err)
// assert.Equal(t, pkPrettyJSON, pkGoPrettyJSON)
} }
func TestGoCircomPkFormat(t *testing.T) { func TestGoCircomPkFormat(t *testing.T) {

Loading…
Cancel
Save