certifiers: test uses WaitForHeight
This commit is contained in:
parent
847f865438
commit
0ada0cf525
|
@ -40,6 +40,11 @@ func NewHTTPProvider(remote string) certifiers.Provider {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// StatusClient returns the internal node as a StatusClient
|
||||||
|
func (p *provider) StatusClient() rpcclient.StatusClient {
|
||||||
|
return p.node
|
||||||
|
}
|
||||||
|
|
||||||
// StoreCommit is a noop, as clients can only read from the chain...
|
// StoreCommit is a noop, as clients can only read from the chain...
|
||||||
func (p *provider) StoreCommit(_ certifiers.FullCommit) error { return nil }
|
func (p *provider) StoreCommit(_ certifiers.FullCommit) error { return nil }
|
||||||
|
|
||||||
|
|
|
@ -1,17 +1,15 @@
|
||||||
package client_test
|
package client
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/stretchr/testify/assert"
|
"github.com/stretchr/testify/assert"
|
||||||
"github.com/stretchr/testify/require"
|
"github.com/stretchr/testify/require"
|
||||||
|
|
||||||
rpctest "github.com/tendermint/tendermint/rpc/test"
|
|
||||||
|
|
||||||
"github.com/tendermint/tendermint/certifiers"
|
"github.com/tendermint/tendermint/certifiers"
|
||||||
"github.com/tendermint/tendermint/certifiers/client"
|
|
||||||
certerr "github.com/tendermint/tendermint/certifiers/errors"
|
certerr "github.com/tendermint/tendermint/certifiers/errors"
|
||||||
|
rpcclient "github.com/tendermint/tendermint/rpc/client"
|
||||||
|
rpctest "github.com/tendermint/tendermint/rpc/test"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestProvider(t *testing.T) {
|
func TestProvider(t *testing.T) {
|
||||||
|
@ -20,11 +18,12 @@ func TestProvider(t *testing.T) {
|
||||||
cfg := rpctest.GetConfig()
|
cfg := rpctest.GetConfig()
|
||||||
rpcAddr := cfg.RPC.ListenAddress
|
rpcAddr := cfg.RPC.ListenAddress
|
||||||
chainID := cfg.ChainID
|
chainID := cfg.ChainID
|
||||||
p := client.NewHTTPProvider(rpcAddr)
|
p := NewHTTPProvider(rpcAddr)
|
||||||
require.NotNil(t, p)
|
require.NotNil(t, p)
|
||||||
|
|
||||||
// let it produce some blocks
|
// let it produce some blocks
|
||||||
time.Sleep(500 * time.Millisecond)
|
err := rpcclient.WaitForHeight(p.(*provider).node, 6, nil)
|
||||||
|
require.Nil(err)
|
||||||
|
|
||||||
// let's get the highest block
|
// let's get the highest block
|
||||||
seed, err := p.LatestCommit()
|
seed, err := p.LatestCommit()
|
||||||
|
|
Loading…
Reference in New Issue