2020-04-15 14:13:20 +00:00
|
|
|
package drand
|
|
|
|
|
|
|
|
import (
|
2020-05-27 12:09:04 +00:00
|
|
|
"os"
|
2020-04-15 14:13:20 +00:00
|
|
|
"testing"
|
2020-05-22 14:07:38 +00:00
|
|
|
|
|
|
|
dchain "github.com/drand/drand/chain"
|
|
|
|
dclient "github.com/drand/drand/client"
|
|
|
|
"github.com/stretchr/testify/assert"
|
2020-04-15 14:13:20 +00:00
|
|
|
)
|
|
|
|
|
2020-05-22 14:07:38 +00:00
|
|
|
func TestPrintGroupInfo(t *testing.T) {
|
|
|
|
c, err := dclient.NewHTTPClient(drandServers[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)
|
2020-05-27 12:09:04 +00:00
|
|
|
err = chain.ToJSON(os.Stdout)
|
2020-05-22 14:07:38 +00:00
|
|
|
assert.NoError(t, err)
|
2020-04-15 14:13:20 +00:00
|
|
|
}
|