Skip to content

Commit

Permalink
update client query
Browse files Browse the repository at this point in the history
  • Loading branch information
avery committed Nov 14, 2024
1 parent 8b34544 commit ccc17ef
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions modules/service/client/utils/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"encoding/json"
"fmt"
"strconv"
"strings"

tmbytes "github.com/cometbft/cometbft/libs/bytes"
rpcclient "github.com/cometbft/cometbft/rpc/client"
Expand Down Expand Up @@ -212,18 +213,21 @@ func QueryResponseByTxQuery(
) (
response types.Response, err error,
) {
//events := []string{
// fmt.Sprintf(
// "%s.%s='%s'",
// types.EventTypeRespondService,
// types.AttributeKeyRequestID,
// []byte(fmt.Sprintf("%d", requestID)),
// ),
//}
events := []string{
fmt.Sprintf(
"%s.%s='%s'",
types.EventTypeRespondService,
types.AttributeKeyRequestID,
[]byte(fmt.Sprintf("%d", requestID)),
),
}

// NOTE: SearchTxs is used to facilitate the txs query which does not currently
// support configurable pagination.
result, err := authtx.QueryTxsByEvents(cliCtx, 1, 1, "", "")

query := strings.Join(events, " AND ")

result, err := authtx.QueryTxsByEvents(cliCtx, 1, 1, query, "")
if err != nil {
return response, err
}
Expand Down

0 comments on commit ccc17ef

Please sign in to comment.