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 84ac4c8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
10 changes: 7 additions & 3 deletions rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,7 @@ 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

Check failure on line 966 in rpcserver.go

View workflow job for this annotation

GitHub Actions / Format check

missing ',' before newline in argument list

Check failure on line 966 in rpcserver.go

View workflow job for this annotation

GitHub Actions / Compilation check

syntax error: unexpected newline in argument list; possibly missing comma or )

Check failure on line 966 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run itests

syntax error: unexpected newline in argument list; possibly missing comma or )

Check failure on line 966 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run itests postgres

syntax error: unexpected newline in argument list; possibly missing comma or )

Check failure on line 966 in rpcserver.go

View workflow job for this annotation

GitHub Actions / Lint check

missing ',' before newline in argument list (typecheck)

Check failure on line 966 in rpcserver.go

View workflow job for this annotation

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

syntax error: unexpected newline in argument list; possibly missing comma or )

Check failure on line 966 in rpcserver.go

View workflow job for this annotation

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

syntax error: unexpected newline in argument list; possibly missing comma or )

Check failure on line 966 in rpcserver.go

View workflow job for this annotation

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

syntax error: unexpected newline in argument list; possibly missing comma or )

Check failure on line 966 in rpcserver.go

View workflow job for this annotation

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

syntax error: unexpected newline in argument list; possibly missing comma or )

Check failure on line 966 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

syntax error: unexpected newline in argument list; possibly missing comma or )

Check failure on line 966 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

syntax error: unexpected newline in argument list; possibly missing comma or )

Check failure on line 966 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

syntax error: unexpected newline in argument list; possibly missing comma or )

Check failure on line 966 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

syntax error: unexpected newline in argument list; possibly missing comma or )
)
if err != nil {
return nil, err
Expand Down Expand Up @@ -1017,10 +1017,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) ([]*taprpc.Asset, error) {

Check failure on line 1020 in rpcserver.go

View workflow job for this annotation

GitHub Actions / Format check

mixed named and unnamed parameters

Check failure on line 1020 in rpcserver.go

View workflow job for this annotation

GitHub Actions / Compilation check

syntax error: mixed named and unnamed parameters

Check failure on line 1020 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run itests

syntax error: mixed named and unnamed parameters

Check failure on line 1020 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run itests postgres

syntax error: mixed named and unnamed parameters

Check failure on line 1020 in rpcserver.go

View workflow job for this annotation

GitHub Actions / Lint check

mixed named and unnamed parameters (typecheck)

Check failure on line 1020 in rpcserver.go

View workflow job for this annotation

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

syntax error: mixed named and unnamed parameters

Check failure on line 1020 in rpcserver.go

View workflow job for this annotation

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

syntax error: mixed named and unnamed parameters

Check failure on line 1020 in rpcserver.go

View workflow job for this annotation

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

syntax error: mixed named and unnamed parameters

Check failure on line 1020 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

syntax error: mixed named and unnamed parameters

Check failure on line 1020 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

syntax error: mixed named and unnamed parameters

Check failure on line 1020 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

syntax error: mixed named and unnamed parameters

filters := &AssetQueryFilters{
MinAmt: minAmountFilter

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / Format check

missing ',' before newline in composite literal

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / Compilation check

syntax error: unexpected newline in composite literal; possibly missing comma or }

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run itests

syntax error: unexpected newline in composite literal; possibly missing comma or }

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run itests postgres

syntax error: unexpected newline in composite literal; possibly missing comma or }

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / Lint check

missing ',' before newline in composite literal (typecheck)

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

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

syntax error: unexpected newline in composite literal; possibly missing comma or }

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

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

syntax error: unexpected newline in composite literal; possibly missing comma or }

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

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

syntax error: unexpected newline in composite literal; possibly missing comma or }

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

syntax error: unexpected newline in composite literal; possibly missing comma or }

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

syntax error: unexpected newline in composite literal; possibly missing comma or }

Check failure on line 1023 in rpcserver.go

View workflow job for this annotation

GitHub Actions / run unit tests (unit-race)

syntax error: unexpected newline in composite literal; possibly missing comma or }
}

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
15 changes: 15 additions & 0 deletions taprpc/taprootassets.proto
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,21 @@ message ListAssetRequest {
// confirmed (check either transfers or receives for unconfirmed outbound or
// inbound assets).
bool include_unconfirmed_mints = 4;

// Only return assets with amount greater or equal to this value
uint64 min_amount = 5;

// Only return assets with amount less or equal to this value
uint64 max_amount = 6;

// Only return assets that belong to the group with this key
bytes group_key = 7;

// Return all assets that use this script key
bytes script_key = 8;

// Return all assets that are currently anchored on this outpoint
string anchor_outpoint = 9;
}

message AnchorInfo {
Expand Down

0 comments on commit 84ac4c8

Please sign in to comment.