mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-06-03 03:29:50 +02:00
itest: simple taproot channel status
This commit is contained in:
parent
b2a5368846
commit
9fa2057cd4
@ -462,6 +462,10 @@ var allTestCases = []*lntest.TestCase{
|
|||||||
Name: "taproot",
|
Name: "taproot",
|
||||||
TestFunc: testTaproot,
|
TestFunc: testTaproot,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Name: "simple taproot channel activation",
|
||||||
|
TestFunc: testSimpleTaprootChannelActivation,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
Name: "wallet import account",
|
Name: "wallet import account",
|
||||||
TestFunc: testWalletImportAccount,
|
TestFunc: testWalletImportAccount,
|
||||||
|
@ -768,3 +768,57 @@ func testFundingExpiryBlocksOnPending(ht *lntest.HarnessTest) {
|
|||||||
chanPoint := lntest.ChanPointFromPendingUpdate(update)
|
chanPoint := lntest.ChanPointFromPendingUpdate(update)
|
||||||
ht.CloseChannel(alice, chanPoint)
|
ht.CloseChannel(alice, chanPoint)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// testSimpleTaprootChannelActivation ensures that a simple taproot channel is
|
||||||
|
// active if the initiator disconnects and reconnects in between channel opening
|
||||||
|
// and channel confirmation.
|
||||||
|
func testSimpleTaprootChannelActivation(ht *lntest.HarnessTest) {
|
||||||
|
simpleTaprootChanArgs := lntest.NodeArgsForCommitType(
|
||||||
|
lnrpc.CommitmentType_SIMPLE_TAPROOT,
|
||||||
|
)
|
||||||
|
|
||||||
|
// Make the new set of participants.
|
||||||
|
alice := ht.NewNode("alice", simpleTaprootChanArgs)
|
||||||
|
defer ht.Shutdown(alice)
|
||||||
|
bob := ht.NewNode("bob", simpleTaprootChanArgs)
|
||||||
|
defer ht.Shutdown(bob)
|
||||||
|
|
||||||
|
ht.FundCoins(btcutil.SatoshiPerBitcoin, alice)
|
||||||
|
|
||||||
|
// Make sure Alice and Bob are connected.
|
||||||
|
ht.EnsureConnected(alice, bob)
|
||||||
|
|
||||||
|
// Create simple taproot channel opening parameters.
|
||||||
|
params := lntest.OpenChannelParams{
|
||||||
|
FundMax: true,
|
||||||
|
CommitmentType: lnrpc.CommitmentType_SIMPLE_TAPROOT,
|
||||||
|
Private: true,
|
||||||
|
}
|
||||||
|
|
||||||
|
// Alice opens the channel to Bob.
|
||||||
|
pendingChan := ht.OpenChannelAssertPending(alice, bob, params)
|
||||||
|
|
||||||
|
// We'll create the channel point to be able to close the channel once
|
||||||
|
// our test is done.
|
||||||
|
chanPoint := &lnrpc.ChannelPoint{
|
||||||
|
FundingTxid: &lnrpc.ChannelPoint_FundingTxidBytes{
|
||||||
|
FundingTxidBytes: pendingChan.Txid,
|
||||||
|
},
|
||||||
|
OutputIndex: pendingChan.OutputIndex,
|
||||||
|
}
|
||||||
|
|
||||||
|
// We disconnect and reconnect Alice and Bob before the channel is
|
||||||
|
// confirmed. Our expectation is that the channel is active once the
|
||||||
|
// channel is confirmed.
|
||||||
|
ht.DisconnectNodes(alice, bob)
|
||||||
|
ht.EnsureConnected(alice, bob)
|
||||||
|
|
||||||
|
// Mine six blocks to confirm the channel funding transaction.
|
||||||
|
ht.MineBlocksAndAssertNumTxes(6, 1)
|
||||||
|
|
||||||
|
// Verify that Alice sees an active channel to Bob.
|
||||||
|
ht.AssertChannelActive(alice, chanPoint)
|
||||||
|
|
||||||
|
// Our test is done and Alice closes her channel to Bob.
|
||||||
|
ht.CloseChannel(alice, chanPoint)
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user