itest: reproduce remote signing issue

This commit attempts to reproduce the issue as described in #7276.
This commit is contained in:
Oliver Gugger 2023-02-07 22:15:08 +01:00
parent 17d7e84b26
commit 5d18fccd42
No known key found for this signature in database
GPG key ID: 8E4256593F177720
2 changed files with 41 additions and 14 deletions

View file

@ -330,23 +330,43 @@ func testUnconfirmedChannelFunding(ht *lntemp.HarnessTest) {
// testChannelFundingInputTypes tests that any type of supported input type can // testChannelFundingInputTypes tests that any type of supported input type can
// be used to fund channels. // be used to fund channels.
func testChannelFundingInputTypes(ht *lntemp.HarnessTest) { func testChannelFundingInputTypes(ht *lntemp.HarnessTest) {
const (
chanAmt = funding.MaxBtcFundingAmount
burnAddr = "bcrt1qxsnqpdc842lu8c0xlllgvejt6rhy49u6fmpgyz"
)
fundWithTypes := []func(amt btcutil.Amount, target *node.HarnessNode){
ht.FundCoins, ht.FundCoinsNP2WKH, ht.FundCoinsP2TR,
}
alice := ht.Alice
// We'll start off by creating a node for Carol. // We'll start off by creating a node for Carol.
carol := ht.NewNode("Carol", nil) carol := ht.NewNode("Carol", nil)
// Now, we'll connect her to Alice so that they can open a // Now, we'll connect her to Alice so that they can open a
// channel together. // channel together.
ht.ConnectNodes(carol, alice) ht.ConnectNodes(carol, ht.Alice)
runChannelFundingInputTypes(ht, ht.Alice, carol)
}
// runChannelFundingInputTypes tests that any type of supported input type can
// be used to fund channels.
func runChannelFundingInputTypes(ht *lntemp.HarnessTest, alice,
carol *node.HarnessNode) {
const (
chanAmt = funding.MaxBtcFundingAmount
burnAddr = "bcrt1qxsnqpdc842lu8c0xlllgvejt6rhy49u6fmpgyz"
)
fundMixed := func(amt btcutil.Amount, target *node.HarnessNode) {
ht.FundCoins(amt/5, target)
ht.FundCoins(amt/5, target)
ht.FundCoinsP2TR(amt/5, target)
ht.FundCoinsP2TR(amt/5, target)
ht.FundCoinsP2TR(amt/5, target)
}
fundMultipleP2TR := func(amt btcutil.Amount, target *node.HarnessNode) {
ht.FundCoinsP2TR(amt/4, target)
ht.FundCoinsP2TR(amt/4, target)
ht.FundCoinsP2TR(amt/4, target)
ht.FundCoinsP2TR(amt/4, target)
}
fundWithTypes := []func(amt btcutil.Amount, target *node.HarnessNode){
ht.FundCoins, ht.FundCoinsNP2WKH, ht.FundCoinsP2TR, fundMixed,
fundMultipleP2TR,
}
// Creates a helper closure to be used below which asserts the // Creates a helper closure to be used below which asserts the
// proper response to a channel balance RPC. // proper response to a channel balance RPC.
@ -386,8 +406,9 @@ func testChannelFundingInputTypes(ht *lntemp.HarnessTest) {
} }
for _, funder := range fundWithTypes { for _, funder := range fundWithTypes {
// We'll send her some confirmed funds. // We'll send her some confirmed funds. We send 10% more than
funder(chanAmt*2, carol) // we need to account for fees.
funder((chanAmt*11)/10, carol)
chanOpenUpdate := ht.OpenChannelAssertStream( chanOpenUpdate := ht.OpenChannelAssertStream(
carol, alice, lntemp.OpenChannelParams{ carol, alice, lntemp.OpenChannelParams{

View file

@ -84,6 +84,12 @@ func testRemoteSigner(ht *lntemp.HarnessTest) {
fn: func(tt *lntemp.HarnessTest, wo, carol *node.HarnessNode) { fn: func(tt *lntemp.HarnessTest, wo, carol *node.HarnessNode) {
runBasicChannelCreationAndUpdates(tt, wo, carol) runBasicChannelCreationAndUpdates(tt, wo, carol)
}, },
}, {
name: "channel funding input types",
sendCoins: false,
fn: func(tt *lntemp.HarnessTest, wo, carol *node.HarnessNode) {
runChannelFundingInputTypes(tt, carol, wo)
},
}, { }, {
name: "async payments", name: "async payments",
sendCoins: true, sendCoins: true,