IRISHUB-238: fix failures in test_lint and test_cover

This commit is contained in:
HaoyangLiu
2018-08-30 15:52:17 +08:00
parent 5473771105
commit b878edc388
7 changed files with 17 additions and 16 deletions
+1 -1
View File
@@ -13,4 +13,4 @@ func TestClientManager(t *testing.T) {
assert.NotEqual(t, endpoint, clientMgr.getClient())
clientMgr.getClient()
assert.Equal(t, endpoint, clientMgr.getClient())
}
}
+1 -1
View File
@@ -9,8 +9,8 @@ import (
"github.com/spf13/viper"
rpcclient "github.com/tendermint/tendermint/rpc/client"
tendermintLite "github.com/tendermint/tendermint/lite"
rpcclient "github.com/tendermint/tendermint/rpc/client"
)
const ctxAccStoreName = "acc"
+10 -10
View File
@@ -10,14 +10,14 @@ import (
"github.com/pkg/errors"
cmn "github.com/tendermint/tendermint/libs/common"
rpcclient "github.com/tendermint/tendermint/rpc/client"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
"github.com/cosmos/cosmos-sdk/store"
"github.com/cosmos/cosmos-sdk/wire"
"strings"
tendermintLiteProxy "github.com/tendermint/tendermint/lite/proxy"
abci "github.com/tendermint/tendermint/abci/types"
cmn "github.com/tendermint/tendermint/libs/common"
tendermintLiteProxy "github.com/tendermint/tendermint/lite/proxy"
rpcclient "github.com/tendermint/tendermint/rpc/client"
ctypes "github.com/tendermint/tendermint/rpc/core/types"
"strings"
)
// GetNode returns an RPC client. If the context's client is not defined, an
@@ -351,18 +351,18 @@ func (ctx CLIContext) verifyProof(path string, resp abci.ResponseQuery) error {
cdc := wire.NewCodec()
err = cdc.UnmarshalBinary(resp.Proof, &multiStoreProof)
if err != nil {
return errors.Wrap(err, "failed to unmarshalBinary rangeProof")
return errors.Wrap(err, "failed to unmarshalBinary rangeProof")
}
// Validate the substore commit hash against trusted appHash
substoreCommitHash, err := store.VerifyMultiStoreCommitInfo(multiStoreProof.StoreName,
substoreCommitHash, err := store.VerifyMultiStoreCommitInfo(multiStoreProof.StoreName,
multiStoreProof.CommitIDList, commit.Header.AppHash)
if err != nil {
return errors.Wrap(err, "failed in verifying the proof against appHash")
return errors.Wrap(err, "failed in verifying the proof against appHash")
}
err = store.VerifyRangeProof(resp.Key, resp.Value, substoreCommitHash, &multiStoreProof.RangeProof)
if err != nil {
return errors.Wrap(err, "failed in the range proof verification")
return errors.Wrap(err, "failed in the range proof verification")
}
return nil
}
@@ -377,7 +377,7 @@ func (ctx CLIContext) queryStore(key cmn.HexBytes, storeName, endPath string) ([
// isQueryStoreWithProof expects a format like /<queryType>/<storeName>/<subpath>
// queryType can be app or store
// if subpath equals to "/store" or "/key", then return true
func isQueryStoreWithProof(path string) (bool) {
func isQueryStoreWithProof(path string) bool {
if !strings.HasPrefix(path, "/") {
return false
}
+2
View File
@@ -37,6 +37,7 @@ import (
"github.com/tendermint/tendermint/proxy"
tmrpc "github.com/tendermint/tendermint/rpc/lib/server"
tmtypes "github.com/tendermint/tendermint/types"
"time"
)
// makePathname creates a unique pathname for each test. It will panic if it
@@ -190,6 +191,7 @@ func InitializeTestLCD(t *testing.T, nValidators int, initAddrs []sdk.AccAddress
node, err := startTM(config, logger, genDoc, privVal, app)
require.NoError(t, err)
time.Sleep(3 * time.Second)
lcd, err := startLCD(logger, listenAddr, cdc)
require.NoError(t, err)