mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-25 13:58:10 -05:00
Co-authored-by: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com> Co-authored-by: colinlyguo <102356659+colinlyguo@users.noreply.github.com> Co-authored-by: colinlyguo <colinlyguo@gmail.com> Co-authored-by: HAOYUatHZ <haoyu@protonmail.com>
40 lines
714 B
Go
40 lines
714 B
Go
//go:build ffi
|
|
|
|
package verifier_test
|
|
|
|
import (
|
|
"encoding/json"
|
|
"io"
|
|
"os"
|
|
"testing"
|
|
|
|
"scroll-tech/common/message"
|
|
|
|
"scroll-tech/coordinator/config"
|
|
"scroll-tech/coordinator/verifier"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
func TestFFI(t *testing.T) {
|
|
as := assert.New(t)
|
|
cfg := &config.VerifierConfig{
|
|
MockMode: false,
|
|
ParamsPath: "../assets/test_params",
|
|
AggVkPath: "../assets/agg_vk",
|
|
}
|
|
v, err := verifier.NewVerifier(cfg)
|
|
as.NoError(err)
|
|
|
|
f, err := os.Open("../assets/agg_proof")
|
|
as.NoError(err)
|
|
byt, err := io.ReadAll(f)
|
|
as.NoError(err)
|
|
aggProof := &message.AggProof{}
|
|
as.NoError(json.Unmarshal(byt, aggProof))
|
|
|
|
ok, err := v.VerifyProof(aggProof)
|
|
as.NoError(err)
|
|
as.True(ok)
|
|
}
|