From d3ec004114ddf685d43600c8d8898f19cff56340 Mon Sep 17 00:00:00 2001 From: Hieu Vu Date: Fri, 27 Dec 2024 15:03:29 +0700 Subject: [PATCH 1/2] add txConfig to clientCtx --- server/v2/cometbft/grpc.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/server/v2/cometbft/grpc.go b/server/v2/cometbft/grpc.go index e85167ab496f..65a368b03a92 100644 --- a/server/v2/cometbft/grpc.go +++ b/server/v2/cometbft/grpc.go @@ -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, From 4916cbfe56e9ccbccdd05c4bd9cd009575a83a7e Mon Sep 17 00:00:00 2001 From: Hieu Vu Date: Fri, 27 Dec 2024 16:06:47 +0700 Subject: [PATCH 2/2] fix err message --- tests/systemtests/tx_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/systemtests/tx_test.go b/tests/systemtests/tx_test.go index 2ae7a33c7c7d..abc17b86b76b 100644 --- a/tests/systemtests/tx_test.go +++ b/tests/systemtests/tx_test.go @@ -947,7 +947,7 @@ func TestTxDecodeAmino_GRPC(t *testing.T) { }{ {"nil request", nil, true, "request cannot be nil"}, {"empty request", &tx.TxDecodeAminoRequest{}, true, "invalid empty tx bytes"}, - {"invalid tx bytes", &tx.TxDecodeAminoRequest{AminoBinary: invalidTxBytes}, true, "invalid request"}, + {"invalid tx bytes", &tx.TxDecodeAminoRequest{AminoBinary: invalidTxBytes}, true, "unmarshal to legacytx.StdTx failed"}, {"valid request with tx bytes", &tx.TxDecodeAminoRequest{AminoBinary: encodedTx}, false, ""}, }