-
Notifications
You must be signed in to change notification settings - Fork 109
tapd: add itest for grouped asset channel funding #987
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
Conversation
bf764ca to
3c5f6cb
Compare
3c5f6cb to
4c38293
Compare
84bf0f8 to
d30865e
Compare
d30865e to
103e485
Compare
|
Updated |
|
@GeorgeTsagk: review reminder |
103e485 to
e159f66
Compare
684cb4e to
b14f20b
Compare
|
Ready for review, @ffranr and @GeorgeTsagk. |
b14f20b to
85ae741
Compare
85ae741 to
dedf12c
Compare
2ce063a to
23f300d
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.
LGTM!
Non-blocking: Since the group keys on taprpc are already merged, we could enhance testCustomChannelsLiquidityEdgeCasesCore with an extra option similar to groupMode, which would control whether we open single asset ID or group funded channels. This way we could incorporate low-hanging coverage for this PR. Not sure what the diff for that would be, could def be a follow-up PR.
23f300d to
21e38f3
Compare
|
Addressed comments. |
itest/assets_test.go
Outdated
| // Then we burn everything but a single asset piece. | ||
| assetID1 := mintedAssets[0].AssetGenesis.AssetId | ||
| assetID2 := mintedAssets[1].AssetGenesis.AssetId | ||
| burnAmount1 := mintedAssets[0].Amount - charlieFundingAmount/2 - | ||
| erinFundingAmount/2 - 1 | ||
| _, err := charlieTap.BurnAsset(ctx, &taprpc.BurnAssetRequest{ | ||
| Asset: &taprpc.BurnAssetRequest_AssetId{ | ||
| AssetId: assetID1, | ||
| }, | ||
| AmountToBurn: burnAmount1, | ||
| ConfirmationText: taprootassets.AssetBurnConfirmationText, | ||
| }) | ||
| require.NoError(t.t, err) | ||
|
|
||
| mineBlocks(t, net, 1, 1) | ||
|
|
||
| burnAmount2 := mintedAssets[1].Amount - charlieFundingAmount/2 - | ||
| erinFundingAmount/2 - 1 | ||
| _, err = charlieTap.BurnAsset(ctx, &taprpc.BurnAssetRequest{ | ||
| Asset: &taprpc.BurnAssetRequest_AssetId{ | ||
| AssetId: assetID2, | ||
| }, | ||
| AmountToBurn: burnAmount2, | ||
| ConfirmationText: taprootassets.AssetBurnConfirmationText, | ||
| }) | ||
| require.NoError(t.t, err) | ||
|
|
||
| mineBlocks(t, net, 1, 1) |
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.
Why are we doing this. Please consider adding a bit more to the comment.
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.
I think we burn all but a small piece as we don't support fully burning an asset in a single transaction.
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.
Yeah, it's to influence coin selection so we get exactly the pieces we want. Added a comment.
We remove the Zane node from all tests where its only role was being the universe server. Starting a node takes multiple seconds, so if we can spin up fewer nodes, we can save some time. And functionality wise Charlie can easily be the universe, we just need to define its port upfront so we can configure it to be its own proof courier. The topology for all tests is at least the following: Charlie --[assets]--> Dave --[sats]--> Erin --[assets]--> Fabia Which means, we the case where one of the channel peers is its own universe (Charlie in Charlie<->Dave) as well as the case where the universe server is a remote node (Charlie in the Erin<->Fabia channel).
This commit prepares some of the helper functions to be able to handle channels that have multiple asset pieces in them.
We'll be adding a new HTLC force close test where we'll be able to re-use this functionality.
21e38f3 to
4225d65
Compare
|
Looks like the CLI is a bit more than just a few lines, so going to fix lightninglabs/taproot-assets#1497 in a separate PR and merge this as soon as CI is green. |
Depends on lightninglabs/taproot-assets#1478.