-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement PrevId[] UTXO selection for FundVirtualPSBT RPC method; valid for single PrevId at first #1172
base: main
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 12128140103Details
💛 - Coveralls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! This is definitely something we want as well and just didn't get to yet.
See inline comment for alternative and slightly more generic approach.
100f726
to
483eb84
Compare
@guggero addressed! Any thoughts on modifying or adding a new itest? I was thinking maybe to modify
Or copy + update the scenario to include an array of 2 inputs perhaps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the updates!
Mostly nits remaining. Would be nice to perhaps add an integration test? Do you have time to do that?
@habibitcoin, remember to re-request review from reviewers when ready |
483eb84
to
338cba8
Compare
@guggero I decided to modify the testAssetBalances itest, as it seemed to be a suitable candidate to test this functionality. I am having trouble however testing both the FundVirtualPSBT RPC with a valid PrevId, release the input lease, and then trying again without any PrevId specified, confirming we succeed I was trying to use tapgarden.NewMockWalletAnchor(), but that doesn't seem to work. I was also seeing if maybe I could create a taprootassets.NewLndRpcWalletAnchor(), but wasn't sure what to use as the input. Curious if you had any recommendations there? I think once that is fixed, all the tests will pass and this should be ready to ship!
|
338cba8
to
71f1bd1
Compare
Yeah, that sounds good as an integration test. You can't use a mock in itests, as that will literally not do anything. What you'll want to call into instead is |
71f1bd1
to
25602ad
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for the update and test!
Looks very close, just a couple of suggestions and fixes.
25602ad
to
2708928
Compare
2708928
to
ee2fc04
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot, LGTM 🎉
Related to #1164
This PR simply implements the plumbing required to utilize the PrevIds payload for FundVirtualPSBT. Similar to how we can only handle 1 address for a raw input, this PR also only implements support for a single PrevId in the PrevIds payload.
At a high level, we perform the following:
constraintsToDbFilter
to utilize the prevID if the length is 1:To-dos:
assetFilter.AnchorPoint = encodedOutpoint
, everything else works as expected and is serving our needs in our demo environment