Skip to content

Commit

Permalink
add txConfig to clientCtx
Browse files Browse the repository at this point in the history
  • Loading branch information
hieuvubk committed Dec 27, 2024
1 parent aabd4b1 commit d3ec004
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion server/v2/cometbft/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -526,12 +526,20 @@ func (c *consensus[T]) maybeHandleExternalServices(ctx context.Context, req *abc
if strings.HasPrefix(req.Path, "/cosmos.tx.v1beta1.Service") {
rpcClient, _ := client.NewClientFromNode(c.cfg.AppTomlConfig.Address)

txConfig := authtx.NewTxConfig(
c.appCodecs.AppCodec,
c.appCodecs.AppCodec.InterfaceRegistry().SigningContext().AddressCodec(),
c.appCodecs.AppCodec.InterfaceRegistry().SigningContext().ValidatorAddressCodec(),
authtx.DefaultSignModes,
)

// init simple client context
clientCtx := client.Context{}.
WithLegacyAmino(c.appCodecs.LegacyAmino.(*codec.LegacyAmino)).
WithCodec(c.appCodecs.AppCodec).
WithNodeURI(c.cfg.AppTomlConfig.Address).
WithClient(rpcClient)
WithClient(rpcClient).
WithTxConfig(txConfig)

txService := txServer[T]{
clientCtx: clientCtx,
Expand Down

0 comments on commit d3ec004

Please sign in to comment.