Merge PR #2346: bugfix in validatorset query and refactor transaction search

This commit is contained in:
HaoyangLiu 2018-09-17 22:13:11 +08:00 committed by Christopher Goes
parent 2263cea118
commit a3df7af428
4 changed files with 5 additions and 5 deletions

View File

@ -43,7 +43,7 @@ func getBlock(cliCtx context.CLIContext, height *int64) ([]byte, error) {
}
if !cliCtx.TrustNode {
check, err := cliCtx.Certify(*height)
check, err := cliCtx.Certify(res.Block.Height)
if err != nil {
return nil, err
}

View File

@ -73,7 +73,7 @@ func getValidators(cliCtx context.CLIContext, height *int64) ([]byte, error) {
}
if !cliCtx.TrustNode {
check, err := cliCtx.Certify(*height)
check, err := cliCtx.Certify(validatorsRes.BlockHeight)
if err != nil {
return nil, err
}

View File

@ -102,7 +102,7 @@ func searchTxs(cliCtx context.CLIContext, cdc *codec.Codec, tags []string) ([]In
}
}
info, err := FormatTxResults(cdc, cliCtx, res.Txs)
info, err := FormatTxResults(cdc, res.Txs)
if err != nil {
return nil, err
}
@ -111,7 +111,7 @@ func searchTxs(cliCtx context.CLIContext, cdc *codec.Codec, tags []string) ([]In
}
// parse the indexed txs into an array of Info
func FormatTxResults(cdc *codec.Codec, cliCtx context.CLIContext, res []*ctypes.ResultTx) ([]Info, error) {
func FormatTxResults(cdc *codec.Codec, res []*ctypes.ResultTx) ([]Info, error) {
var err error
out := make([]Info, len(res))
for i := range res {

View File

@ -40,5 +40,5 @@ func queryTxs(node rpcclient.Client, cliCtx context.CLIContext, cdc *codec.Codec
}
}
return tx.FormatTxResults(cdc, cliCtx, res.Txs)
return tx.FormatTxResults(cdc, res.Txs)
}