Browse Source

certifiers: test uses WaitForHeight

pull/840/head
Ethan Buchman 7 years ago
parent
commit
0ada0cf525
2 changed files with 11 additions and 7 deletions
  1. +5
    -0
      certifiers/client/provider.go
  2. +6
    -7
      certifiers/client/provider_test.go

+ 5
- 0
certifiers/client/provider.go View File

@ -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...
func (p *provider) StoreCommit(_ certifiers.FullCommit) error { return nil }


+ 6
- 7
certifiers/client/provider_test.go View File

@ -1,17 +1,15 @@
package client_test
package client
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
rpctest "github.com/tendermint/tendermint/rpc/test"
"github.com/tendermint/tendermint/certifiers"
"github.com/tendermint/tendermint/certifiers/client"
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) {
@ -20,11 +18,12 @@ func TestProvider(t *testing.T) {
cfg := rpctest.GetConfig()
rpcAddr := cfg.RPC.ListenAddress
chainID := cfg.ChainID
p := client.NewHTTPProvider(rpcAddr)
p := NewHTTPProvider(rpcAddr)
require.NotNil(t, p)
// 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
seed, err := p.LatestCommit()


Loading…
Cancel
Save