Merge PR #3688: JSON Decode Log in REST Client

This commit is contained in:
Alexander Bezobchuk
2019-02-22 12:54:31 +01:00
committed by Christopher Goes
parent 2121160d29
commit 0611d2eda2
6 changed files with 76 additions and 30 deletions
+2 -8
View File
@@ -629,15 +629,9 @@ func (app *BaseApp) getContextForTx(mode runTxMode, txBytes []byte) (ctx sdk.Con
return
}
type indexedABCILog struct {
MsgIndex int `json:"msg_index"`
Success bool `json:"success"`
Log string `json:"log"`
}
// runMsgs iterates through all the messages and executes them.
func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, mode runTxMode) (result sdk.Result) {
idxlogs := make([]indexedABCILog, 0, len(msgs)) // a list of JSON-encoded logs with msg index
idxlogs := make([]sdk.ABCIMessageLog, 0, len(msgs)) // a list of JSON-encoded logs with msg index
var data []byte // NOTE: we just append them all (?!)
var tags sdk.Tags // also just append them all
@@ -666,7 +660,7 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, mode runTxMode) (re
tags = append(tags, sdk.MakeTag(sdk.TagAction, msg.Type()))
tags = append(tags, msgResult.Tags...)
idxLog := indexedABCILog{MsgIndex: msgIdx, Log: msgResult.Log}
idxLog := sdk.ABCIMessageLog{MsgIndex: msgIdx, Log: msgResult.Log}
// stop execution and return on first failed message
if !msgResult.IsOK() {