Use existing trusted info for drand client test (#11666)

Ref: https://github.com/drand/drand/pull/1317
This commit is contained in:
Rod Vagg 2024-03-02 03:32:14 +11:00 committed by GitHub
parent 51b19a61cd
commit 7b911594ac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3,6 +3,7 @@
package drand package drand
import ( import (
"bytes"
"context" "context"
"os" "os"
"testing" "testing"
@ -18,7 +19,12 @@ import (
func TestPrintGroupInfo(t *testing.T) { func TestPrintGroupInfo(t *testing.T) {
server := build.DrandConfigs[build.DrandTestnet].Servers[0] server := build.DrandConfigs[build.DrandTestnet].Servers[0]
c, err := hclient.New(server, nil, nil) chainInfo := build.DrandConfigs[build.DrandTestnet].ChainInfoJSON
drandChain, err := dchain.InfoFromJSON(bytes.NewReader([]byte(chainInfo)))
assert.NoError(t, err)
c, err := hclient.NewWithInfo(server, drandChain, nil)
assert.NoError(t, err) assert.NoError(t, err)
cg := c.(interface { cg := c.(interface {
FetchChainInfo(ctx context.Context, groupHash []byte) (*dchain.Info, error) FetchChainInfo(ctx context.Context, groupHash []byte) (*dchain.Info, error)