Skip to content

Commit 4b1c141

Browse files
author
HuangYi
committed
only patch encoding for tx service
1 parent 39709fb commit 4b1c141

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

app/app.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1327,7 +1327,23 @@ func (app *App) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig
13271327

13281328
// RegisterTxService implements the Application.RegisterTxService method.
13291329
func (app *App) RegisterTxService(clientCtx client.Context) {
1330-
authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, app.interfaceRegistry)
1330+
// create new config instance to avoid affect the state machine
1331+
encodingConfig := evmenc.MakeConfig()
1332+
cdc := encodingConfig.Amino
1333+
interfaceRegistry := encodingConfig.InterfaceRegistry
1334+
1335+
app.BasicModuleManager.RegisterLegacyAminoCodec(cdc)
1336+
app.BasicModuleManager.RegisterInterfaces(interfaceRegistry)
1337+
1338+
// for decoding legacy transactions whose modules are removed
1339+
RegisterLegacyCodec(cdc)
1340+
RegisterLegacyInterfaces(interfaceRegistry)
1341+
1342+
clientCtx = clientCtx.
1343+
WithInterfaceRegistry(interfaceRegistry).
1344+
WithTxConfig(encodingConfig.TxConfig).
1345+
WithCodec(encodingConfig.Codec)
1346+
authtx.RegisterTxService(app.BaseApp.GRPCQueryRouter(), clientCtx, app.BaseApp.Simulate, interfaceRegistry)
13311347
}
13321348

13331349
// RegisterTendermintService implements the Application.RegisterTendermintService method.

0 commit comments

Comments
 (0)