From 612194fb9462147084ad2e31595f5baeecbf8bf3 Mon Sep 17 00:00:00 2001 From: Martin Hutchinson Date: Wed, 31 Jan 2024 15:20:51 +0000 Subject: [PATCH] Update tests to better reflect real sigs --- internal/distribute/rest/distribute_test.go | 5 +++-- internal/http/server_test.go | 3 ++- internal/witness/witness_test.go | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/internal/distribute/rest/distribute_test.go b/internal/distribute/rest/distribute_test.go index 882d33e..02e6b41 100644 --- a/internal/distribute/rest/distribute_test.go +++ b/internal/distribute/rest/distribute_test.go @@ -23,6 +23,7 @@ import ( "testing" "github.com/gorilla/mux" + f_note "github.com/transparency-dev/formats/note" "github.com/transparency-dev/witness/internal/config" "github.com/transparency-dev/witness/internal/distribute/rest" "github.com/transparency-dev/witness/monitoring" @@ -50,7 +51,7 @@ func TestDistributeOnce(t *testing.T) { t.Fatal(err) } logs := []config.Log{log} - wV, err := note.NewVerifier(wPK) + wV, err := f_note.NewVerifierForCosignatureV1(wPK) if err != nil { t.Fatal(err) } @@ -59,7 +60,7 @@ func TestDistributeOnce(t *testing.T) { if err != nil { t.Fatal(err) } - wSign, err := note.NewSigner(wSK) + wSign, err := f_note.NewSignerForCosignatureV1(wSK) if err != nil { t.Fatal(err) } diff --git a/internal/http/server_test.go b/internal/http/server_test.go index f44dc68..d23e0e6 100644 --- a/internal/http/server_test.go +++ b/internal/http/server_test.go @@ -28,6 +28,7 @@ import ( "testing" "github.com/gorilla/mux" + f_note "github.com/transparency-dev/formats/note" "github.com/transparency-dev/merkle/rfc6962" "github.com/transparency-dev/witness/api" "github.com/transparency-dev/witness/internal/persistence/inmemory" @@ -74,7 +75,7 @@ type logOpts struct { func newWitness(t *testing.T, logs []logOpts) *witness.Witness { // Set up Opts for the witness. - ns, err := note.NewSigner(wSK) + ns, err := f_note.NewSignerForCosignatureV1(wSK) if err != nil { t.Fatalf("couldn't create a witness signer: %v", err) } diff --git a/internal/witness/witness_test.go b/internal/witness/witness_test.go index ef7137a..b5df47c 100644 --- a/internal/witness/witness_test.go +++ b/internal/witness/witness_test.go @@ -22,6 +22,7 @@ import ( "testing" _ "github.com/mattn/go-sqlite3" // Load drivers for sqlite3 + f_note "github.com/transparency-dev/formats/note" "github.com/transparency-dev/merkle/rfc6962" "github.com/transparency-dev/witness/internal/persistence/inmemory" "golang.org/x/mod/sumdb/note" @@ -71,7 +72,7 @@ type logOpts struct { func newWitness(t *testing.T, logs []logOpts) *Witness { // Set up Opts for the witness. - ns, err := note.NewSigner(wSK) + ns, err := f_note.NewSignerForCosignatureV1(wSK) if err != nil { t.Fatalf("couldn't create a witness signer: %v", err) } @@ -235,7 +236,7 @@ func TestGetChkpt(t *testing.T) { if err != nil { t.Errorf("failed to get latest: %v", err) } - wV, err := note.NewVerifier(wPK) + wV, err := f_note.NewVerifierForCosignatureV1(wPK) if err != nil { t.Fatalf("couldn't create a witness verifier: %v", err) }