diff --git a/itest/lnd_channel_force_close_test.go b/itest/lnd_channel_force_close_test.go index cd22e524a..0a0c4d0a6 100644 --- a/itest/lnd_channel_force_close_test.go +++ b/itest/lnd_channel_force_close_test.go @@ -2,6 +2,7 @@ package itest import ( "bytes" + "encoding/hex" "fmt" "testing" @@ -141,7 +142,24 @@ func testCommitmentTransactionDeadline(ht *lntest.HarnessTest) { // Now that the channel has been force closed, it should show // up in the PendingChannels RPC under the waiting close // section. - ht.AssertChannelWaitingClose(alice, chanPoint) + waitingClose := ht.AssertChannelWaitingClose(alice, chanPoint) + + // The waiting close channel closing tx hex should be set and + // be valid. + require.NotEmpty(ht, waitingClose.ClosingTxHex) + rawTxBytes, err := hex.DecodeString(waitingClose.ClosingTxHex) + require.NoError( + ht, err, + "waiting close channel closingTxHex invalid hex", + ) + rawTx := &wire.MsgTx{} + err = rawTx.Deserialize(bytes.NewReader(rawTxBytes)) + require.NoError( + ht, err, "waiting close channel ClosingTxHex invalid", + ) + require.Equal( + ht, waitingClose.ClosingTxid, rawTx.TxHash().String(), + ) // We should see Alice's force closing tx in the mempool. expectedNumTxes := 1 diff --git a/lntest/rpc/lnd.go b/lntest/rpc/lnd.go index 270da0800..8f55271f8 100644 --- a/lntest/rpc/lnd.go +++ b/lntest/rpc/lnd.go @@ -131,7 +131,9 @@ func (h *HarnessRPC) PendingChannels() *lnrpc.PendingChannelsResponse { ctxt, cancel := context.WithTimeout(h.runCtx, DefaultTimeout) defer cancel() - pendingChansRequest := &lnrpc.PendingChannelsRequest{} + pendingChansRequest := &lnrpc.PendingChannelsRequest{ + IncludeRawTx: true, + } resp, err := h.LN.PendingChannels(ctxt, pendingChansRequest) // TODO(yy): We may get a `unable to find arbitrator` error from the