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:
Johan T. Halseth committed 2020-01-06 11:42:03 +01:00
1 parent 13a108e578
commit 613d771daf
4 files changed
+58 -35

No files matched your search

+4 -4
View File
@@ -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 {