Skip to content

Commit

Permalink
fix: segments matching (#458)
Browse files Browse the repository at this point in the history
* fix: segments matching
  • Loading branch information
gfyrag committed Sep 11, 2023
1 parent ddeb74b commit 45e3e8a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions pkg/storage/sqlstorage/balances_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package sqlstorage_test

import (
"context"
"github.com/numary/ledger/pkg/ledgertesting"
"os"
"testing"
"time"

Expand Down Expand Up @@ -173,6 +175,12 @@ func testGetBalancesAggregated(t *testing.T, store *sqlstorage.Store) {
}

func testGetBalancesBigInts(t *testing.T, store *sqlstorage.Store) {

if os.Getenv("NUMARY_STORAGE_POSTGRES_CONN_STRING") != "" ||
ledgertesting.StorageDriverName() != "postgres" {
return
}

amount, _ := core.ParseMonetaryInt("5522360000000000000000")
var txBigInts = core.ExpandedTransaction{
Transaction: core.Transaction{
Expand Down
2 changes: 1 addition & 1 deletion pkg/storage/sqlstorage/transactions.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
// this regexp is used to distinguish between deprecated regex queries for
// source, destination and account params and the new wildcard query
// which allows segmented address pattern matching, e.g; "foo:bar:*"
var addressQueryRegexp = regexp.MustCompile(`^(\w+|\*|\.\*)(:(\w+|\*|\.\*))*$`)
var addressQueryRegexp = regexp.MustCompile(`^(\w+|\*|\.\*)(:(\w+|\*|\.\*)?)*$`)

func (s *Store) buildTransactionsQuery(flavor Flavor, p ledger.TransactionsQuery) (*sqlbuilder.SelectBuilder, TxsPaginationToken) {
sb := sqlbuilder.NewSelectBuilder()
Expand Down

0 comments on commit 45e3e8a

Please sign in to comment.