Skip to content

Commit

Permalink
Update tests to better reflect real sigs
Browse files Browse the repository at this point in the history
  • Loading branch information
mhutchinson committed Jan 31, 2024
1 parent 826ad2f commit 612194f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions internal/distribute/rest/distribute_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
Expand All @@ -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)
}
Expand Down
3 changes: 2 additions & 1 deletion internal/http/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
Expand Down
5 changes: 3 additions & 2 deletions internal/witness/witness_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}
Expand Down Expand Up @@ -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)
}
Expand Down

0 comments on commit 612194f

Please sign in to comment.