You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
804 B
31 lines
804 B
//go:build integration
|
|
|
|
package drand_test
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
"testing"
|
|
|
|
"g.activething.com/go/DateKeys/internal/testkit"
|
|
"g.activething.com/go/DateKeys/profile"
|
|
"g.activething.com/go/DateKeys/provider"
|
|
"g.activething.com/go/DateKeys/provider/drand"
|
|
)
|
|
|
|
// Every default relay serves the same, locally verified release.
|
|
func TestLiveRelays(t *testing.T) {
|
|
p := profile.Quicknet()
|
|
for _, relay := range drand.DefaultRelays() {
|
|
for _, round := range testkit.Rounds {
|
|
rel, err := drand.New(relay).Fetch(context.Background(), p, provider.Condition{Round: round})
|
|
if err != nil {
|
|
t.Fatalf("%s round %d: %v", relay, round, err)
|
|
}
|
|
if !bytes.Equal(rel.Signature, testkit.Release(round).Signature) {
|
|
t.Fatalf("%s round %d: unexpected signature", relay, round)
|
|
}
|
|
}
|
|
}
|
|
}
|