Skip to content

Commit

Permalink
only patch encoding for tx service
Browse files Browse the repository at this point in the history
  • Loading branch information
yihuang committed Dec 6, 2024
1 parent 39709fb commit 4b1c141
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4b1c141

Please sign in to comment.