lotus/chain/beacon/drand/drand_test.go
2020-06-23 15:09:28 -04:00

23 lines
493 B
Go

package drand
import (
"os"
"testing"
dchain "github.com/drand/drand/chain"
hclient "github.com/drand/drand/client/http"
"github.com/stretchr/testify/assert"
)
func TestPrintGroupInfo(t *testing.T) {
c, err := hclient.New(defaultConfig.Servers[0], nil, nil)
assert.NoError(t, err)
cg := c.(interface {
FetchChainInfo(groupHash []byte) (*dchain.Info, error)
})
chain, err := cg.FetchChainInfo(nil)
assert.NoError(t, err)
err = chain.ToJSON(os.Stdout)
assert.NoError(t, err)
}