lnwallet: create CommitmentBuilder
We define a new struct CommitmentBuilder that will be used to craft the final commitment transaction based on the current active channel type.
This commit is contained in:
4 files changed
+58
-35
No files matched your search
@@ -421,14 +421,14 @@ func TestCommitmentAndHTLCTransactions(t *testing.T) {
|
||||
// Construct a LightningChannel manually because we don't have nor need all
|
||||
// of the dependencies.
|
||||
channel := LightningChannel{
|
||||
channelState: &channelState,
|
||||
Signer: signer,
|
||||
channelState: &channelState,
|
||||
Signer: signer,
|
||||
commitBuilder: NewCommitmentBuilder(&channelState),
|
||||
}
|
||||
err = channel.createSignDesc()
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to generate channel sign descriptor: %v", err)
|
||||
}
|
||||
channel.createStateHintObfuscator()
|
||||
|
||||
// The commitmentPoint is technically hidden in the spec, but we need it to
|
||||
// generate the correct tweak.
|
||||
@@ -803,7 +803,7 @@ func TestCommitmentAndHTLCTransactions(t *testing.T) {
|
||||
dustLimit: tc.dustLimit,
|
||||
isOurs: true,
|
||||
}
|
||||
err = channel.createCommitmentTx(
|
||||
err = channel.commitBuilder.createCommitmentTx(
|
||||
commitmentView, theHTLCView, keys,
|
||||
)
|
||||
if err != nil {
|
||||
|
||||
Reference in new issue
Block a user