Files
linea-monorepo/prover/circuits/setup_manifest_test.go
Julien Marchand a001342170 chore: Initial commit
Co-authored-by: Franklin Delehelle <franklin.delehelle@odena.eu>
Co-authored-by: Alexandre Belling <alexandrebelling8@gmail.com>
Co-authored-by: Pedro Novais <jpvnovais@gmail.com>
Co-authored-by: Roman Vaseev <4833306+Filter94@users.noreply.github.com>
Co-authored-by: Bradley Bown <bradbown@googlemail.com>
Co-authored-by: Victorien Gauch <85494462+VGau@users.noreply.github.com>
Co-authored-by: Nikolai Golub <nikolai.golub@consensys.net>
Co-authored-by: The Dark Jester <thedarkjester@users.noreply.github.com>
Co-authored-by: jonesho <81145364+jonesho@users.noreply.github.com>
Co-authored-by: Gaurav Ahuja <gauravahuja9@gmail.com>
Co-authored-by: Azam Soleimanian <49027816+Soleimani193@users.noreply.github.com>
Co-authored-by: Andrei A <andrei.alexandru@consensys.net>
Co-authored-by: Arijit Dutta <37040536+arijitdutta67@users.noreply.github.com>
Co-authored-by: Gautam Botrel <gautam.botrel@gmail.com>
Co-authored-by: Ivo Kubjas <ivo.kubjas@consensys.net>
Co-authored-by: gusiri <dreamerty@postech.ac.kr>
Co-authored-by: FlorianHuc <florian.huc@gmail.com>
Co-authored-by: Arya Tabaie <arya.pourtabatabaie@gmail.com>
Co-authored-by: Julink <julien.fontanel@consensys.net>
Co-authored-by: Bogdan Ursu <bogdanursuoffice@gmail.com>
Co-authored-by: Jakub Trąd <jakubtrad@gmail.com>
Co-authored-by: Alessandro Sforzin <alessandro.sforzin@consensys.net>
Co-authored-by: Olivier Bégassat <olivier.begassat.cours@gmail.com>
Co-authored-by: Steve Huang <97596526+stevehuangc7s@users.noreply.github.com>
Co-authored-by: bkolad <blazejkolad@gmail.com>
Co-authored-by: fadyabuhatoum1 <139905934+fadyabuhatoum1@users.noreply.github.com>
Co-authored-by: Blas Rodriguez Irizar <rodrigblas@gmail.com>
Co-authored-by: Eduardo Andrade <eduardofandrade@gmail.com>
Co-authored-by: Ivo Kubjas <tsimmm@gmail.com>
Co-authored-by: Ludcour <ludovic.courcelas@consensys.net>
Co-authored-by: m4sterbunny <harrie.bickle@consensys.net>
Co-authored-by: Alex Panayi <145478258+alexandrospanayi@users.noreply.github.com>
Co-authored-by: Diana Borbe - ConsenSys <diana.borbe@consensys.net>
Co-authored-by: ThomasPiellard <thomas.piellard@gmail.com>
2024-07-31 18:17:20 +02:00

43 lines
1.2 KiB
Go

package circuits
import (
"bytes"
"encoding/json"
"testing"
"github.com/stretchr/testify/require"
)
const exampleJson = `{
"circuitName": "aggregation-10",
"timestamp": "2024-04-24T21:41:20.104431-05:00",
"checksums": {
"verifyingKey": "0x78022b8d128bc34096eafcecc1d5a36f95affdb4264f52cbeeb043dc73948f3d",
"verifierContract": "",
"circuit": "0x59d950e0fb10c5aa20f8c0082ffc550283a4aa2b5325be03623c331e651801eb"
},
"nbConstraints": 3116379,
"curveID": "bw6_761",
"extraFlags": {
"allowedVkForAggregationDigests": [
"0xd1624b8e9e5987f7bbf85cb32bb7b9787144aceb4527864f31ba1957e300f7eb",
"0xc4a868954d361bf8c18d4b3699c4fa973a6b2e4543ddea0ce7970d6941f55758"
]
}
}`
func TestParseManifestAndFlags(t *testing.T) {
assert := require.New(t)
var m SetupManifest
err := json.NewDecoder(bytes.NewReader([]byte(exampleJson))).Decode(&m)
assert.NoError(err)
keys, err := m.GetStringArray("allowedVkForAggregationDigests")
assert.NoError(err)
assert.Equal(2, len(keys))
assert.Equal("0xd1624b8e9e5987f7bbf85cb32bb7b9787144aceb4527864f31ba1957e300f7eb", keys[0])
assert.Equal("0xc4a868954d361bf8c18d4b3699c4fa973a6b2e4543ddea0ce7970d6941f55758", keys[1])
}