From 651e931763acb5bcbb0020b7bc41cd2f1de4184a Mon Sep 17 00:00:00 2001 From: Yukai Tu Date: Tue, 13 Mar 2018 11:48:51 -0700 Subject: [PATCH] Fix Issue#618 --- baseapp/baseapp.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index c6ca46e0f8..3dad0483a3 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -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 var msCache sdk.CacheMultiStore 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) // If result was successful, write to app.checkState.ms or app.deliverState.ms