Fix Issue#618

This commit is contained in:
Yukai Tu 2018-03-13 11:48:51 -07:00
parent f4c2b504f4
commit 651e931763
1 changed files with 7 additions and 3 deletions

View File

@ -371,6 +371,13 @@ func (app *BaseApp) runTx(isCheckTx bool, txBytes []byte, tx sdk.Tx) (result sdk
} }
} }
// Match route.
msgType := msg.Type()
handler := app.router.Route(msgType)
if handler == nil {
return sdk.ErrUnknownRequest("Unrecognized Msg type: " + msgType).Result()
}
// Get the correct cache // Get the correct cache
var msCache sdk.CacheMultiStore var msCache sdk.CacheMultiStore
if isCheckTx == true { if isCheckTx == true {
@ -384,9 +391,6 @@ func (app *BaseApp) runTx(isCheckTx bool, txBytes []byte, tx sdk.Tx) (result sdk
} }
// Match and run route.
msgType := msg.Type()
handler := app.router.Route(msgType)
result = handler(ctx, msg) result = handler(ctx, msg)
// If result was successful, write to app.checkState.ms or app.deliverState.ms // If result was successful, write to app.checkState.ms or app.deliverState.ms