Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(systemtest): Fix QueryBySig (backport #23102) #23112

Merged
merged 1 commit into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
2 changes: 1 addition & 1 deletion tests/systemtests/tx_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -946,7 +946,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, ""},
}

Expand Down
Loading