diff --git a/app/app.go b/app/app.go index 04188c7703..b129d12cf6 100644 --- a/app/app.go +++ b/app/app.go @@ -1327,7 +1327,23 @@ func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig // RegisterTxService implements the Application.RegisterTxService method. func (app *App) RegisterTxService(clientCtx client.Context) { - authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry) + // create new config instance to avoid affect the state machine + encodingConfig := evmenc.MakeConfig() + cdc := encodingConfig.Amino + interfaceRegistry := encodingConfig.InterfaceRegistry + + app.BasicModuleManager.RegisterLegacyAminoCodec(cdc) + app.BasicModuleManager.RegisterInterfaces(interfaceRegistry) + + // for decoding legacy transactions whose modules are removed + RegisterLegacyCodec(cdc) + RegisterLegacyInterfaces(interfaceRegistry) + + clientCtx = clientCtx. + WithInterfaceRegistry(interfaceRegistry). + WithTxConfig(encodingConfig.TxConfig). + WithCodec(encodingConfig.Codec) + authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, interfaceRegistry) } // RegisterTendermintService implements the Application.RegisterTendermintService method.