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

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"

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
@ -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
}

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)

View File

@ -292,7 +292,6 @@ func (rs *rootMultiStore) Query(req abci.RequestQuery) abci.ResponseQuery {
req.Path = subpath
res := queryable.Query(req)
// Currently, only when query subpath is "/store" or "/key", will proof be included in response.
// If there are some changes about proof building in iavlstore.go, we must change code here to keep consistency with iavlstore.go
if !req.Prove || subpath != "/store" && subpath != "/key" {
@ -300,7 +299,7 @@ func (rs *rootMultiStore) Query(req abci.RequestQuery) abci.ResponseQuery {
}
//Load commit info from db
commitInfo, errMsg := getCommitInfo(rs.db,res.Height)
commitInfo, errMsg := getCommitInfo(rs.db, res.Height)
if errMsg != nil {
return sdk.ErrInternal(errMsg.Error()).QueryResult()
}