multi: refactor testFundingPersistence

This commit refactors the test `testFundingPersistence`. In addition, it
also changes the old `OpenChannelAssertPending` method and adds a new
method `OpenChannelAssertStream` for clarity.
This commit is contained in:
yyforyongyu
2022-08-04 02:36:12 +08:00
parent 6a66f3984f
commit 21097feb85
8 changed files with 127 additions and 96 deletions

View File

@@ -8,6 +8,7 @@ import (
"strconv"
"strings"
"github.com/lightningnetwork/lnd/lnrpc"
"github.com/lightningnetwork/lnd/lntest"
)
@@ -92,3 +93,16 @@ func ParseDerivationPath(path string) ([]uint32, error) {
return indices, nil
}
// ChanPointFromPendingUpdate constructs a channel point from a lnrpc pending
// update.
func ChanPointFromPendingUpdate(pu *lnrpc.PendingUpdate) *lnrpc.ChannelPoint {
chanPoint := &lnrpc.ChannelPoint{
FundingTxid: &lnrpc.ChannelPoint_FundingTxidBytes{
FundingTxidBytes: pu.Txid,
},
OutputIndex: pu.OutputIndex,
}
return chanPoint
}