Skip to content

Conversation

itsrachelfish
Copy link
Contributor

@itsrachelfish itsrachelfish commented Nov 16, 2024

Resolves #876

This PR adds new filter options to the ListAssets RPC call.

  • The ListAssetRequest proto definition was updated to include the new filter options.
  • The fetchRpcAssets function was refactored to accept a AssetQueryFilters argument so that separate arguments don't need to be added for each filter option.
  • The assets store constraintsToDbFilter function was updated to use the new filter options.
  • And the assets.sql file was updated to include a new maxAmount option.

@dstadulis dstadulis added this to the v0.5 (v0.4.2 rename) milestone Nov 17, 2024
@Roasbeef Roasbeef modified the milestones: v0.5 (v0.4.2 rename), v0.6 Nov 19, 2024
@itsrachelfish itsrachelfish force-pushed the listassets-filters branch 4 times, most recently from f31d9f4 to f189364 Compare November 20, 2024 08:56
@coveralls
Copy link

coveralls commented Nov 20, 2024

Pull Request Test Coverage Report for Build 14571628881

Details

  • 21 of 98 (21.43%) changed or added relevant lines in 4 files are covered.
  • 7 unchanged lines in 3 files lost coverage.
  • Overall coverage increased (+0.009%) to 28.572%

Changes Missing Coverage Covered Lines Changed/Added Lines %
tapdb/assets_store.go 20 27 74.07%
taprpc/taprootassets.pb.go 0 25 0.0%
rpcserver.go 0 45 0.0%
Files with Coverage Reduction New Missed Lines %
address/address.go 2 69.55%
tapchannel/aux_invoice_manager.go 2 85.37%
tapchannel/aux_leaf_signer.go 3 43.43%
Totals Coverage Status
Change from base Build 14520380113: 0.009%
Covered Lines: 26263
Relevant Lines: 91918

💛 - Coveralls

@GeorgeTsagk GeorgeTsagk self-requested a review November 20, 2024 10:16
@itsrachelfish itsrachelfish force-pushed the listassets-filters branch 2 times, most recently from 6abd778 to 3c0141b Compare November 20, 2024 10:23
Copy link
Member

@GeorgeTsagk GeorgeTsagk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking good!
it's in the right direction 💯

@itsrachelfish itsrachelfish force-pushed the listassets-filters branch 7 times, most recently from 13eabd1 to 241d98d Compare November 27, 2024 11:47
@itsrachelfish itsrachelfish force-pushed the listassets-filters branch 5 times, most recently from f5d1985 to 9c7b7e9 Compare December 4, 2024 07:29
@itsrachelfish itsrachelfish changed the title [WIP] Updated ListAssetRequest to include additional filter options Updated ListAssetRequest to include additional filter options Dec 7, 2024
@itsrachelfish itsrachelfish marked this pull request as ready for review December 7, 2024 10:54
@itsrachelfish itsrachelfish force-pushed the listassets-filters branch 3 times, most recently from c74c44a to 8b0d382 Compare February 25, 2025 22:58
@itsrachelfish
Copy link
Contributor Author

@GeorgeTsagk @guggero I updated the code to filter assets based on the tweaked script key instead of the internal script key ID. I ran into some weird issues with the automated tests, for some reason I was unable to filter the 10th asset:

assetGen:    assetGen.assetGens[9],
anchorPoint: assetGen.anchorPoints[4],
amt:         777,
scriptKey:   scriptKeyWithScript,

Oli said this might have something to do with an underlying issue with the specific anchor point or asset generation, but I'm not sure why this particular asset is "cursed" 😅

I worked around the issue by adding a script key to the 3rd asset and was able to filter it as expected.

@guggero guggero self-requested a review March 10, 2025 22:06
Copy link
Member

@GeorgeTsagk GeorgeTsagk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super close 💯
mostly styling related comments

should also add the filter options to the cmd command but since they weren't there in the first place this can be done in a different PR

@itsrachelfish itsrachelfish force-pushed the listassets-filters branch 3 times, most recently from 517d54a to 402d754 Compare March 13, 2025 21:53
@itsrachelfish itsrachelfish force-pushed the listassets-filters branch 2 times, most recently from a2be556 to 402d754 Compare March 22, 2025 04:18
Copy link
Contributor

@guggero guggero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost there.

@lightninglabs-deploy
Copy link

@GeorgeTsagk: review reminder
@itsrachelfish, remember to re-request review from reviewers when ready

Copy link
Contributor

@guggero guggero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, LGTM 🎉

Copy link
Member

@GeorgeTsagk GeorgeTsagk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
ty!

@github-project-automation github-project-automation bot moved this from 🏗 In progress to 👀 In review in Taproot-Assets Project Board Apr 22, 2025
@GeorgeTsagk GeorgeTsagk added this pull request to the merge queue Apr 22, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Apr 22, 2025
@guggero guggero merged commit caa8e72 into lightninglabs:main Apr 22, 2025
18 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Taproot-Assets Project Board Apr 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

[feature]: Add filters to ListAssets
7 participants