Skip to content

Commit

Permalink
chore: some clean
Browse files Browse the repository at this point in the history
  • Loading branch information
gfyrag committed Oct 23, 2024
1 parent 1699f77 commit ac773b7
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 8 deletions.
1 change: 0 additions & 1 deletion internal/storage/ledger/accounts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,6 @@ func TestAccountsGet(t *testing.T) {
}, *account)
})

// todo: test sometimes failing, need to investigate
t.Run("find account using pit", func(t *testing.T) {
t.Parallel()

Expand Down
1 change: 0 additions & 1 deletion internal/storage/ledger/legacy/accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ func (store *Store) accountQueryContext(qb query.Builder, q ledgercontroller.Lis
}
switch {
case key == "address":
// TODO: Should allow comparison operator only if segments not used
if operator != "$match" {
return "", nil, errors.New("'address' column can only be used with $match")
}
Expand Down
1 change: 0 additions & 1 deletion internal/storage/ledger/legacy/balances.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ func (store *Store) GetAggregatedBalances(ctx context.Context, q ledgercontrolle
subQuery, args, err = q.QueryBuilder.Build(query.ContextFn(func(key, operator string, value any) (string, []any, error) {
switch {
case key == "address":
// TODO: Should allow comparison operator only if segments not used
if operator != "$match" {
return "", nil, newErrInvalidQuery("'address' column can only be used with $match")
}
Expand Down
3 changes: 0 additions & 3 deletions internal/storage/ledger/legacy/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ func (store *Store) transactionQueryContext(qb query.Builder, q ledgercontroller
return "", nil, newErrInvalidQuery("'reverted' can only be used with bool value")
}
case key == "account":
// TODO: Should allow comparison operator only if segments not used
if operator != "$match" {
return "", nil, newErrInvalidQuery("'account' column can only be used with $match")
}
Expand All @@ -96,7 +95,6 @@ func (store *Store) transactionQueryContext(qb query.Builder, q ledgercontroller
return "", nil, newErrInvalidQuery("unexpected type %T for column 'account'", address)
}
case key == "source":
// TODO: Should allow comparison operator only if segments not used
if operator != "$match" {
return "", nil, errors.New("'source' column can only be used with $match")
}
Expand All @@ -107,7 +105,6 @@ func (store *Store) transactionQueryContext(qb query.Builder, q ledgercontroller
return "", nil, newErrInvalidQuery("unexpected type %T for column 'source'", address)
}
case key == "destination":
// TODO: Should allow comparison operator only if segments not used
if operator != "$match" {
return "", nil, errors.New("'destination' column can only be used with $match")
}
Expand Down
1 change: 0 additions & 1 deletion internal/storage/ledger/legacy/volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ func (store *Store) volumesQueryContext(q ledgercontroller.GetVolumesWithBalance

switch {
case key == "account" || key == "address":
// TODO: Should allow comparison operator only if segments not used
if operator != "$match" {
return "", nil, newErrInvalidQuery("'%s' column can only be used with $match", key)
}
Expand Down
1 change: 0 additions & 1 deletion test/e2e/api_balances_aggregated.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ var _ = Context("Ledger engine tests", func() {
Expect(response).To(HaveLen(1))
Expect(response["USD/2"]).To(Equal(big.NewInt(100)))
})
// todo: test sometimes failing, need to investigate
It("should be ok when aggregating using pit on insertion date", func() {
response, err := GetBalancesAggregated(
ctx,
Expand Down

0 comments on commit ac773b7

Please sign in to comment.