Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tests to better reflect real sigs #150

Merged
merged 1 commit into from
Feb 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading