itest: zero-conf, scid-alias channel-type integration tests
This commit is contained in:
11 files changed
+1248
-32
No files matched your search
@@ -447,6 +447,97 @@ func testChannelBackupRestore(net *lntest.NetworkHarness, t *harnessTest) {
|
|||||||
)
|
)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Restore the backup from the on-disk file, using the RPC
|
||||||
|
// interface, for zero-conf anchor channels.
|
||||||
|
{
|
||||||
|
name: "restore from backup file for zero-conf " +
|
||||||
|
"anchors channel",
|
||||||
|
initiator: true,
|
||||||
|
private: false,
|
||||||
|
commitmentType: lnrpc.CommitmentType_ANCHORS,
|
||||||
|
zeroConf: true,
|
||||||
|
restoreMethod: func(oldNode *lntest.HarnessNode,
|
||||||
|
backupFilePath string,
|
||||||
|
mnemonic []string) (nodeRestorer, error) {
|
||||||
|
|
||||||
|
// Read the entire Multi backup stored within
|
||||||
|
// this node's channels.backup file.
|
||||||
|
multi, err := ioutil.ReadFile(backupFilePath)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now that we have Dave's backup file, we'll
|
||||||
|
// create a new nodeRestorer that we'll restore
|
||||||
|
// using the on-disk channels.backup.
|
||||||
|
return chanRestoreViaRPC(
|
||||||
|
net, password, mnemonic, multi,
|
||||||
|
oldNode,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
// Restore the backup from the on-disk file, using the RPC
|
||||||
|
// interface for a zero-conf script-enforced leased channel.
|
||||||
|
{
|
||||||
|
name: "restore from backup file zero-conf " +
|
||||||
|
"script-enforced leased channel",
|
||||||
|
initiator: true,
|
||||||
|
private: false,
|
||||||
|
commitmentType: lnrpc.CommitmentType_SCRIPT_ENFORCED_LEASE,
|
||||||
|
zeroConf: true,
|
||||||
|
restoreMethod: func(oldNode *lntest.HarnessNode,
|
||||||
|
backupFilePath string,
|
||||||
|
mnemonic []string) (nodeRestorer, error) {
|
||||||
|
|
||||||
|
// Read the entire Multi backup stored within
|
||||||
|
// this node's channel.backup file.
|
||||||
|
multi, err := ioutil.ReadFile(backupFilePath)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now that we have Dave's backup file, we'll
|
||||||
|
// create a new nodeRestorer that we'll restore
|
||||||
|
// using the on-disk channel backup.
|
||||||
|
return chanRestoreViaRPC(
|
||||||
|
net, password, mnemonic, multi,
|
||||||
|
oldNode,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
// Restore a zero-conf anchors channel that was force closed by
|
||||||
|
// dave just before going offline.
|
||||||
|
{
|
||||||
|
name: "restore force closed from backup file " +
|
||||||
|
"anchors w/ zero-conf",
|
||||||
|
initiator: true,
|
||||||
|
private: false,
|
||||||
|
commitmentType: lnrpc.CommitmentType_ANCHORS,
|
||||||
|
localForceClose: true,
|
||||||
|
zeroConf: true,
|
||||||
|
restoreMethod: func(oldNode *lntest.HarnessNode,
|
||||||
|
backupFilePath string,
|
||||||
|
mnemonic []string) (nodeRestorer, error) {
|
||||||
|
|
||||||
|
// Read the entire Multi backup stored within
|
||||||
|
// this node's channel.backup file.
|
||||||
|
multi, err := ioutil.ReadFile(backupFilePath)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
// Now that we have Dave's backup file, we'll
|
||||||
|
// create a new nodeRestorer that we'll restore
|
||||||
|
// using the on-disk channel backup.
|
||||||
|
return chanRestoreViaRPC(
|
||||||
|
net, password, mnemonic, multi,
|
||||||
|
oldNode,
|
||||||
|
)
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO(roasbeef): online vs offline close?
|
// TODO(roasbeef): online vs offline close?
|
||||||
@@ -861,6 +952,10 @@ type chanRestoreTestCase struct {
|
|||||||
restoreMethod func(oldNode *lntest.HarnessNode,
|
restoreMethod func(oldNode *lntest.HarnessNode,
|
||||||
backupFilePath string,
|
backupFilePath string,
|
||||||
mnemonic []string) (nodeRestorer, error)
|
mnemonic []string) (nodeRestorer, error)
|
||||||
|
|
||||||
|
// zeroConf denotes whether the opened channel is a zero-conf channel
|
||||||
|
// or not.
|
||||||
|
zeroConf bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// testChanRestoreScenario executes a chanRestoreTestCase from end to end,
|
// testChanRestoreScenario executes a chanRestoreTestCase from end to end,
|
||||||
@@ -886,6 +981,13 @@ func testChanRestoreScenario(t *harnessTest, net *lntest.NetworkHarness,
|
|||||||
nodeArgs = append(nodeArgs, args...)
|
nodeArgs = append(nodeArgs, args...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if testCase.zeroConf {
|
||||||
|
nodeArgs = append(
|
||||||
|
nodeArgs, "--protocol.option-scid-alias",
|
||||||
|
"--protocol.zero-conf",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
// First, we'll create a brand new node we'll use within the test. If
|
// First, we'll create a brand new node we'll use within the test. If
|
||||||
// we have a custom backup file specified, then we'll also create that
|
// we have a custom backup file specified, then we'll also create that
|
||||||
// for use.
|
// for use.
|
||||||
@@ -971,14 +1073,16 @@ func testChanRestoreScenario(t *harnessTest, net *lntest.NetworkHarness,
|
|||||||
net, t, from, to, chanAmt, thawHeight, true,
|
net, t, from, to, chanAmt, thawHeight, true,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
params := lntest.OpenChannelParams{
|
||||||
|
Amt: chanAmt,
|
||||||
|
PushAmt: pushAmt,
|
||||||
|
Private: testCase.private,
|
||||||
|
FundingShim: fundingShim,
|
||||||
|
CommitmentType: testCase.commitmentType,
|
||||||
|
ZeroConf: testCase.zeroConf,
|
||||||
|
}
|
||||||
chanPoint = openChannelAndAssert(
|
chanPoint = openChannelAndAssert(
|
||||||
t, net, from, to, lntest.OpenChannelParams{
|
t, net, from, to, params,
|
||||||
Amt: chanAmt,
|
|
||||||
PushAmt: pushAmt,
|
|
||||||
Private: testCase.private,
|
|
||||||
FundingShim: fundingShim,
|
|
||||||
CommitmentType: testCase.commitmentType,
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Wait for both sides to see the opened channel.
|
// Wait for both sides to see the opened channel.
|
||||||
|
|||||||
@@ -23,14 +23,15 @@ import (
|
|||||||
// case of anchor channels, the second-level spends can also be aggregated and
|
// case of anchor channels, the second-level spends can also be aggregated and
|
||||||
// properly feebumped, so we'll check that as well.
|
// properly feebumped, so we'll check that as well.
|
||||||
func testMultiHopHtlcAggregation(net *lntest.NetworkHarness, t *harnessTest,
|
func testMultiHopHtlcAggregation(net *lntest.NetworkHarness, t *harnessTest,
|
||||||
alice, bob *lntest.HarnessNode, c lnrpc.CommitmentType) {
|
alice, bob *lntest.HarnessNode, c lnrpc.CommitmentType,
|
||||||
|
zeroConf bool) {
|
||||||
|
|
||||||
const finalCltvDelta = 40
|
const finalCltvDelta = 40
|
||||||
ctxb := context.Background()
|
ctxb := context.Background()
|
||||||
|
|
||||||
// First, we'll create a three hop network: Alice -> Bob -> Carol.
|
// First, we'll create a three hop network: Alice -> Bob -> Carol.
|
||||||
aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork(
|
aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork(
|
||||||
t, net, alice, bob, false, c,
|
t, net, alice, bob, false, c, zeroConf,
|
||||||
)
|
)
|
||||||
defer shutdownAndAssert(net, t, carol)
|
defer shutdownAndAssert(net, t, carol)
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ import (
|
|||||||
// preimage via the witness beacon, we properly settle the HTLC on-chain using
|
// preimage via the witness beacon, we properly settle the HTLC on-chain using
|
||||||
// the HTLC success transaction in order to ensure we don't lose any funds.
|
// the HTLC success transaction in order to ensure we don't lose any funds.
|
||||||
func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest,
|
func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest,
|
||||||
alice, bob *lntest.HarnessNode, c lnrpc.CommitmentType) {
|
alice, bob *lntest.HarnessNode, c lnrpc.CommitmentType,
|
||||||
|
zeroConf bool) {
|
||||||
|
|
||||||
ctxb := context.Background()
|
ctxb := context.Background()
|
||||||
|
|
||||||
@@ -28,7 +29,7 @@ func testMultiHopHtlcLocalChainClaim(net *lntest.NetworkHarness, t *harnessTest,
|
|||||||
// Carol refusing to actually settle or directly cancel any HTLC's
|
// Carol refusing to actually settle or directly cancel any HTLC's
|
||||||
// self.
|
// self.
|
||||||
aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork(
|
aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork(
|
||||||
t, net, alice, bob, false, c,
|
t, net, alice, bob, false, c, zeroConf,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Clean up carol's node when the test finishes.
|
// Clean up carol's node when the test finishes.
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ import (
|
|||||||
// canceled backwards. Once the timeout has been reached, then we should sweep
|
// canceled backwards. Once the timeout has been reached, then we should sweep
|
||||||
// it on-chain, and cancel the HTLC backwards.
|
// it on-chain, and cancel the HTLC backwards.
|
||||||
func testMultiHopHtlcLocalTimeout(net *lntest.NetworkHarness, t *harnessTest,
|
func testMultiHopHtlcLocalTimeout(net *lntest.NetworkHarness, t *harnessTest,
|
||||||
alice, bob *lntest.HarnessNode, c lnrpc.CommitmentType) {
|
alice, bob *lntest.HarnessNode, c lnrpc.CommitmentType,
|
||||||
|
zeroConf bool) {
|
||||||
|
|
||||||
ctxb := context.Background()
|
ctxb := context.Background()
|
||||||
|
|
||||||
@@ -28,7 +29,7 @@ func testMultiHopHtlcLocalTimeout(net *lntest.NetworkHarness, t *harnessTest,
|
|||||||
// Carol refusing to actually settle or directly cancel any HTLC's
|
// Carol refusing to actually settle or directly cancel any HTLC's
|
||||||
// self.
|
// self.
|
||||||
aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork(
|
aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork(
|
||||||
t, net, alice, bob, true, c,
|
t, net, alice, bob, true, c, zeroConf,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Clean up carol's node when the test finishes.
|
// Clean up carol's node when the test finishes.
|
||||||
|
|||||||
@@ -22,7 +22,8 @@ import (
|
|||||||
// extract the preimage from the sweep transaction, and finish settling the
|
// extract the preimage from the sweep transaction, and finish settling the
|
||||||
// HTLC backwards into the route.
|
// HTLC backwards into the route.
|
||||||
func testMultiHopReceiverChainClaim(net *lntest.NetworkHarness, t *harnessTest,
|
func testMultiHopReceiverChainClaim(net *lntest.NetworkHarness, t *harnessTest,
|
||||||
alice, bob *lntest.HarnessNode, c lnrpc.CommitmentType) {
|
alice, bob *lntest.HarnessNode, c lnrpc.CommitmentType,
|
||||||
|
zeroConf bool) {
|
||||||
|
|
||||||
ctxb := context.Background()
|
ctxb := context.Background()
|
||||||
|
|
||||||
@@ -30,7 +31,7 @@ func testMultiHopReceiverChainClaim(net *lntest.NetworkHarness, t *harnessTest,
|
|||||||
// Carol refusing to actually settle or directly cancel any HTLC's
|
// Carol refusing to actually settle or directly cancel any HTLC's
|
||||||
// self.
|
// self.
|
||||||
aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork(
|
aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork(
|
||||||
t, net, alice, bob, false, c,
|
t, net, alice, bob, false, c, zeroConf,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Clean up carol's node when the test finishes.
|
// Clean up carol's node when the test finishes.
|
||||||
|
|||||||
@@ -20,7 +20,8 @@ import (
|
|||||||
// HTLC directly on-chain using the preimage in order to ensure that we don't
|
// HTLC directly on-chain using the preimage in order to ensure that we don't
|
||||||
// lose any funds.
|
// lose any funds.
|
||||||
func testMultiHopHtlcRemoteChainClaim(net *lntest.NetworkHarness, t *harnessTest,
|
func testMultiHopHtlcRemoteChainClaim(net *lntest.NetworkHarness, t *harnessTest,
|
||||||
alice, bob *lntest.HarnessNode, c lnrpc.CommitmentType) {
|
alice, bob *lntest.HarnessNode, c lnrpc.CommitmentType,
|
||||||
|
zeroConf bool) {
|
||||||
|
|
||||||
ctxb := context.Background()
|
ctxb := context.Background()
|
||||||
|
|
||||||
@@ -28,7 +29,7 @@ func testMultiHopHtlcRemoteChainClaim(net *lntest.NetworkHarness, t *harnessTest
|
|||||||
// Carol refusing to actually settle or directly cancel any HTLC's
|
// Carol refusing to actually settle or directly cancel any HTLC's
|
||||||
// self.
|
// self.
|
||||||
aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork(
|
aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork(
|
||||||
t, net, alice, bob, false, c,
|
t, net, alice, bob, false, c, zeroConf,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Clean up carol's node when the test finishes.
|
// Clean up carol's node when the test finishes.
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ import (
|
|||||||
// that's timed out. At this point, the node should timeout the HTLC using the
|
// that's timed out. At this point, the node should timeout the HTLC using the
|
||||||
// HTLC timeout transaction, then cancel it backwards as normal.
|
// HTLC timeout transaction, then cancel it backwards as normal.
|
||||||
func testMultiHopLocalForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
|
func testMultiHopLocalForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
|
||||||
t *harnessTest, alice, bob *lntest.HarnessNode, c lnrpc.CommitmentType) {
|
t *harnessTest, alice, bob *lntest.HarnessNode, c lnrpc.CommitmentType,
|
||||||
|
zeroConf bool) {
|
||||||
|
|
||||||
ctxb := context.Background()
|
ctxb := context.Background()
|
||||||
|
|
||||||
@@ -27,7 +28,7 @@ func testMultiHopLocalForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
|
|||||||
// Carol refusing to actually settle or directly cancel any HTLC's
|
// Carol refusing to actually settle or directly cancel any HTLC's
|
||||||
// self.
|
// self.
|
||||||
aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork(
|
aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork(
|
||||||
t, net, alice, bob, true, c,
|
t, net, alice, bob, true, c, zeroConf,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Clean up carol's node when the test finishes.
|
// Clean up carol's node when the test finishes.
|
||||||
|
|||||||
@@ -21,7 +21,8 @@ import (
|
|||||||
// transaction once the timeout has expired. Once we sweep the transaction, we
|
// transaction once the timeout has expired. Once we sweep the transaction, we
|
||||||
// should also cancel back the initial HTLC.
|
// should also cancel back the initial HTLC.
|
||||||
func testMultiHopRemoteForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
|
func testMultiHopRemoteForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
|
||||||
t *harnessTest, alice, bob *lntest.HarnessNode, c lnrpc.CommitmentType) {
|
t *harnessTest, alice, bob *lntest.HarnessNode, c lnrpc.CommitmentType,
|
||||||
|
zeroConf bool) {
|
||||||
|
|
||||||
ctxb := context.Background()
|
ctxb := context.Background()
|
||||||
|
|
||||||
@@ -29,7 +30,7 @@ func testMultiHopRemoteForceCloseOnChainHtlcTimeout(net *lntest.NetworkHarness,
|
|||||||
// Carol refusing to actually settle or directly cancel any HTLC's
|
// Carol refusing to actually settle or directly cancel any HTLC's
|
||||||
// self.
|
// self.
|
||||||
aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork(
|
aliceChanPoint, bobChanPoint, carol := createThreeHopNetwork(
|
||||||
t, net, alice, bob, true, c,
|
t, net, alice, bob, true, c, zeroConf,
|
||||||
)
|
)
|
||||||
|
|
||||||
// Clean up carol's node when the test finishes.
|
// Clean up carol's node when the test finishes.
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ func testMultiHopHtlcClaims(net *lntest.NetworkHarness, t *harnessTest) {
|
|||||||
type testCase struct {
|
type testCase struct {
|
||||||
name string
|
name string
|
||||||
test func(net *lntest.NetworkHarness, t *harnessTest, alice,
|
test func(net *lntest.NetworkHarness, t *harnessTest, alice,
|
||||||
bob *lntest.HarnessNode, c lnrpc.CommitmentType)
|
bob *lntest.HarnessNode, c lnrpc.CommitmentType,
|
||||||
|
zeroConf bool)
|
||||||
}
|
}
|
||||||
|
|
||||||
subTests := []testCase{
|
subTests := []testCase{
|
||||||
@@ -68,20 +69,51 @@ func testMultiHopHtlcClaims(net *lntest.NetworkHarness, t *harnessTest) {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
commitTypes := []lnrpc.CommitmentType{
|
commitWithZeroConf := []struct {
|
||||||
lnrpc.CommitmentType_LEGACY,
|
commitType lnrpc.CommitmentType
|
||||||
lnrpc.CommitmentType_ANCHORS,
|
zeroConf bool
|
||||||
lnrpc.CommitmentType_SCRIPT_ENFORCED_LEASE,
|
}{
|
||||||
|
{
|
||||||
|
commitType: lnrpc.CommitmentType_LEGACY,
|
||||||
|
zeroConf: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
commitType: lnrpc.CommitmentType_ANCHORS,
|
||||||
|
zeroConf: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
commitType: lnrpc.CommitmentType_ANCHORS,
|
||||||
|
zeroConf: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
commitType: lnrpc.CommitmentType_SCRIPT_ENFORCED_LEASE,
|
||||||
|
zeroConf: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
commitType: lnrpc.CommitmentType_SCRIPT_ENFORCED_LEASE,
|
||||||
|
zeroConf: true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, commitType := range commitTypes {
|
for _, typeAndConf := range commitWithZeroConf {
|
||||||
commitType := commitType
|
typeAndConf := typeAndConf
|
||||||
testName := fmt.Sprintf("committype=%v", commitType.String())
|
testName := fmt.Sprintf(
|
||||||
|
"committype=%v zeroconf=%v",
|
||||||
|
typeAndConf.commitType.String(), typeAndConf.zeroConf,
|
||||||
|
)
|
||||||
|
|
||||||
success := t.t.Run(testName, func(t *testing.T) {
|
success := t.t.Run(testName, func(t *testing.T) {
|
||||||
ht := newHarnessTest(t, net)
|
ht := newHarnessTest(t, net)
|
||||||
|
|
||||||
args := nodeArgsForCommitType(commitType)
|
args := nodeArgsForCommitType(typeAndConf.commitType)
|
||||||
|
|
||||||
|
if typeAndConf.zeroConf {
|
||||||
|
args = append(
|
||||||
|
args, "--protocol.option-scid-alias",
|
||||||
|
"--protocol.zero-conf",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
alice := net.NewNode(t, "Alice", args)
|
alice := net.NewNode(t, "Alice", args)
|
||||||
defer shutdownAndAssert(net, ht, alice)
|
defer shutdownAndAssert(net, ht, alice)
|
||||||
|
|
||||||
@@ -107,7 +139,11 @@ func testMultiHopHtlcClaims(net *lntest.NetworkHarness, t *harnessTest) {
|
|||||||
// static fee estimate.
|
// static fee estimate.
|
||||||
net.SetFeeEstimate(12500)
|
net.SetFeeEstimate(12500)
|
||||||
|
|
||||||
subTest.test(net, ht, alice, bob, commitType)
|
subTest.test(
|
||||||
|
net, ht, alice, bob,
|
||||||
|
typeAndConf.commitType,
|
||||||
|
typeAndConf.zeroConf,
|
||||||
|
)
|
||||||
})
|
})
|
||||||
if !success {
|
if !success {
|
||||||
return
|
return
|
||||||
@@ -204,7 +240,8 @@ func checkPaymentStatus(node *lntest.HarnessNode, preimage lntypes.Preimage,
|
|||||||
}
|
}
|
||||||
|
|
||||||
func createThreeHopNetwork(t *harnessTest, net *lntest.NetworkHarness,
|
func createThreeHopNetwork(t *harnessTest, net *lntest.NetworkHarness,
|
||||||
alice, bob *lntest.HarnessNode, carolHodl bool, c lnrpc.CommitmentType) (
|
alice, bob *lntest.HarnessNode, carolHodl bool, c lnrpc.CommitmentType,
|
||||||
|
zeroConf bool) (
|
||||||
*lnrpc.ChannelPoint, *lnrpc.ChannelPoint, *lntest.HarnessNode) {
|
*lnrpc.ChannelPoint, *lnrpc.ChannelPoint, *lntest.HarnessNode) {
|
||||||
|
|
||||||
net.EnsureConnected(t.t, alice, bob)
|
net.EnsureConnected(t.t, alice, bob)
|
||||||
@@ -234,6 +271,7 @@ func createThreeHopNetwork(t *harnessTest, net *lntest.NetworkHarness,
|
|||||||
Amt: chanAmt,
|
Amt: chanAmt,
|
||||||
CommitmentType: c,
|
CommitmentType: c,
|
||||||
FundingShim: aliceFundingShim,
|
FundingShim: aliceFundingShim,
|
||||||
|
ZeroConf: zeroConf,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -254,6 +292,14 @@ func createThreeHopNetwork(t *harnessTest, net *lntest.NetworkHarness,
|
|||||||
if carolHodl {
|
if carolHodl {
|
||||||
carolFlags = append(carolFlags, "--hodl.exit-settle")
|
carolFlags = append(carolFlags, "--hodl.exit-settle")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if zeroConf {
|
||||||
|
carolFlags = append(
|
||||||
|
carolFlags, "--protocol.option-scid-alias",
|
||||||
|
"--protocol.zero-conf",
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
carol := net.NewNode(t.t, "Carol", carolFlags)
|
carol := net.NewNode(t.t, "Carol", carolFlags)
|
||||||
|
|
||||||
net.ConnectNodes(t.t, bob, carol)
|
net.ConnectNodes(t.t, bob, carol)
|
||||||
@@ -280,6 +326,7 @@ func createThreeHopNetwork(t *harnessTest, net *lntest.NetworkHarness,
|
|||||||
Amt: chanAmt,
|
Amt: chanAmt,
|
||||||
CommitmentType: c,
|
CommitmentType: c,
|
||||||
FundingShim: bobFundingShim,
|
FundingShim: bobFundingShim,
|
||||||
|
ZeroConf: zeroConf,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
err = bob.WaitForNetworkChannelOpen(bobChanPoint)
|
err = bob.WaitForNetworkChannelOpen(bobChanPoint)
|
||||||
|
|||||||
@@ -407,4 +407,20 @@ var allTestCases = []*testCase{
|
|||||||
name: "resolution handoff",
|
name: "resolution handoff",
|
||||||
test: testResHandoff,
|
test: testResHandoff,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
name: "zero conf channel open",
|
||||||
|
test: testZeroConfChannelOpen,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "option scid alias",
|
||||||
|
test: testOptionScidAlias,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "scid alias channel update",
|
||||||
|
test: testUpdateChannelPolicyScidAlias,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "scid alias upgrade",
|
||||||
|
test: testOptionScidUpgrade,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user