Skip to content

Commit 36a29a0

Browse files
committed
Fix: Transaction Query Filters Not Implemented or Broken
1 parent c0d88de commit 36a29a0

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

manager/gateway/cosmos_agregated3.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -425,18 +425,18 @@ func (g *CosmosGateway) transactions(req types.InboundRequest) (interface{}, err
425425

426426
if request.StartDate != "" {
427427
criteria["timestamp"] = map[string]interface{}{
428-
"$gt": request.StartDate,
428+
"$gte": request.StartDate,
429429
}
430430

431431
if request.EndDate != "" {
432432
criteria["timestamp"] = map[string]interface{}{
433-
"$gt": request.StartDate,
434-
"$lt": request.EndDate,
433+
"$gte": request.StartDate,
434+
"$lte": request.EndDate,
435435
}
436436
}
437437
} else if request.EndDate != "" {
438438
criteria["timestamp"] = map[string]interface{}{
439-
"$lt": request.EndDate,
439+
"$lte": request.EndDate,
440440
}
441441
}
442442

@@ -475,7 +475,7 @@ func (g *CosmosGateway) transactions(req types.InboundRequest) (interface{}, err
475475
if len(request.Directions) == 0 {
476476
orConditions = []map[string]interface{}{
477477
{"messages.from_address": request.Address},
478-
{"messages.to_address": request.Address},
478+
{"pf": request.Address},
479479
{"tx_result.events.attributes.value": request.Address},
480480
}
481481
} else {

manager/types/cosmos.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ type QueryTxsParams struct {
178178
Hash string `json:"hash,omitempty"`
179179
Height string `json:"height,omitempty"`
180180
Address string `json:"address,omitempty"`
181-
StartDate string `json:"start_date,string,omitempty"`
182-
EndDate string `json:"end_date,string,omitempty"`
181+
StartDate string `json:"start_date,omitempty"`
182+
EndDate string `json:"end_date,omitempty"`
183183
Directions []string `json:"directions,omitempty"`
184184
Statuses []string `json:"statuses,omitempty"`
185185
Types []string `json:"types,omitempty"`

0 commit comments

Comments
 (0)