fix client tests
This commit is contained in:
parent
1b7bec230d
commit
1c446f4b49
|
@ -59,13 +59,13 @@ func TestAppProofs(t *testing.T) {
|
||||||
brh := br.Height
|
brh := br.Height
|
||||||
|
|
||||||
// This sets up our trust on the node based on some past point.
|
// This sets up our trust on the node based on some past point.
|
||||||
source := certclient.New(cl)
|
source := certclient.NewProvider(cl)
|
||||||
seed, err := source.GetByHeight(br.Height - 2)
|
seed, err := source.GetByHeight(br.Height - 2)
|
||||||
require.NoError(err, "%+v", err)
|
require.NoError(err, "%+v", err)
|
||||||
cert := certifiers.NewStatic("my-chain", seed.Validators)
|
cert := certifiers.NewStatic("my-chain", seed.Validators)
|
||||||
|
|
||||||
client.WaitForHeight(cl, 3, nil)
|
client.WaitForHeight(cl, 3, nil)
|
||||||
latest, err := source.GetLatestCommit()
|
latest, err := source.LatestCommit()
|
||||||
require.NoError(err, "%+v", err)
|
require.NoError(err, "%+v", err)
|
||||||
rootHash := latest.Header.AppHash
|
rootHash := latest.Header.AppHash
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ func TestAppProofs(t *testing.T) {
|
||||||
// verify a query before the tx block has no data (and valid non-exist proof)
|
// verify a query before the tx block has no data (and valid non-exist proof)
|
||||||
bs, height, proof, err := GetWithProof(k, brh-1, cl, cert)
|
bs, height, proof, err := GetWithProof(k, brh-1, cl, cert)
|
||||||
require.NotNil(err)
|
require.NotNil(err)
|
||||||
require.True(lc.IsNoDataErr(err))
|
require.True(IsNoDataErr(err))
|
||||||
require.Nil(bs)
|
require.Nil(bs)
|
||||||
|
|
||||||
// but given that block it is good
|
// but given that block it is good
|
||||||
|
@ -122,7 +122,7 @@ func TestTxProofs(t *testing.T) {
|
||||||
require.EqualValues(0, br.DeliverTx.Code)
|
require.EqualValues(0, br.DeliverTx.Code)
|
||||||
fmt.Printf("tx height: %d\n", br.Height)
|
fmt.Printf("tx height: %d\n", br.Height)
|
||||||
|
|
||||||
source := certclient.New(cl)
|
source := certclient.NewProvider(cl)
|
||||||
seed, err := source.GetByHeight(br.Height - 2)
|
seed, err := source.GetByHeight(br.Height - 2)
|
||||||
require.NoError(err, "%+v", err)
|
require.NoError(err, "%+v", err)
|
||||||
cert := certifiers.NewStatic("my-chain", seed.Validators)
|
cert := certifiers.NewStatic("my-chain", seed.Validators)
|
||||||
|
|
Loading…
Reference in New Issue