Skip to content

Commit

Permalink
taprpc: Updated ListAssetRequest to include additional filter options
Browse files Browse the repository at this point in the history
  • Loading branch information
itsrachelfish committed Nov 16, 2024
1 parent ee06af7 commit b6e90aa
Show file tree
Hide file tree
Showing 4 changed files with 994 additions and 880 deletions.
11 changes: 8 additions & 3 deletions rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -963,8 +963,9 @@ func (r *rpcServer) ListAssets(ctx context.Context,
}

rpcAssets, err := r.fetchRpcAssets(
ctx, req.WithWitness, req.IncludeSpent, req.IncludeLeased,
ctx, req.WithWitness, req.IncludeSpent, req.IncludeLeased, req.MinAmount,
)

if err != nil {
return nil, err
}
Expand Down Expand Up @@ -1017,10 +1018,14 @@ func (r *rpcServer) ListAssets(ctx context.Context,
}

func (r *rpcServer) fetchRpcAssets(ctx context.Context, withWitness,
includeSpent, includeLeased bool) ([]*taprpc.Asset, error) {
includeSpent, includeLeased bool, minAmountFilter uint64) ([]*taprpc.Asset, error) {

filters := &r.cfg.AssetStore.AssetQueryFilters{

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / Compilation check

r.cfg.AssetStore.AssetQueryFilters is not a type

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run itests

r.cfg.AssetStore.AssetQueryFilters is not a type

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run itests postgres

r.cfg.AssetStore.AssetQueryFilters is not a type

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-cover)

r.cfg.AssetStore.AssetQueryFilters is not a type

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit dbbackend=postgres)

r.cfg.AssetStore.AssetQueryFilters is not a type

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit dbbackend=postgres)

r.cfg.AssetStore.AssetQueryFilters is not a type

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit dbbackend=postgres)

r.cfg.AssetStore.AssetQueryFilters is not a type

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit dbbackend=postgres)

r.cfg.AssetStore.AssetQueryFilters is not a type

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit dbbackend=postgres)

r.cfg.AssetStore.AssetQueryFilters is not a type

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

r.cfg.AssetStore.AssetQueryFilters is not a type

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

r.cfg.AssetStore.AssetQueryFilters is not a type

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

r.cfg.AssetStore.AssetQueryFilters is not a type

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

r.cfg.AssetStore.AssetQueryFilters is not a type

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

r.cfg.AssetStore.AssetQueryFilters is not a type
MinAmt: minAmountFilter,
}

assets, err := r.cfg.AssetStore.FetchAllAssets(
ctx, includeSpent, includeLeased, nil,
ctx, includeSpent, includeLeased, filters,
)
if err != nil {
return nil, fmt.Errorf("unable to read chain assets: %w", err)
Expand Down
Loading

0 comments on commit b6e90aa

Please sign in to comment.