From 5e6ebf561b91b80195f498798fd6d99dd92376f2 Mon Sep 17 00:00:00 2001 From: eugene Date: Fri, 8 Sep 2023 12:12:26 -0400 Subject: [PATCH] chanfunding: introduce NewShimIntent for testing This is needed so that the next commit can create a ShimIntent without having to export the ShimIntent's fields. --- lnwallet/chanfunding/canned_assembler.go | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/lnwallet/chanfunding/canned_assembler.go b/lnwallet/chanfunding/canned_assembler.go index cf2c55e08..21dd47339 100644 --- a/lnwallet/chanfunding/canned_assembler.go +++ b/lnwallet/chanfunding/canned_assembler.go @@ -10,6 +10,22 @@ import ( "github.com/lightningnetwork/lnd/keychain" ) +// NewShimIntent creates a new ShimIntent. This is only used for testing. +func NewShimIntent(localAmt, remoteAmt btcutil.Amount, + localKey *keychain.KeyDescriptor, remoteKey *btcec.PublicKey, + chanPoint *wire.OutPoint, thawHeight uint32, musig2 bool) *ShimIntent { + + return &ShimIntent{ + localFundingAmt: localAmt, + remoteFundingAmt: remoteAmt, + localKey: localKey, + remoteKey: remoteKey, + chanPoint: chanPoint, + thawHeight: thawHeight, + musig2: musig2, + } +} + // ShimIntent is an intent created by the CannedAssembler which represents a // funding output to be created that was constructed outside the wallet. This // might be used when a hardware wallet, or a channel factory is the entity