lnwallet+htlcswitch: add NewCommitState struct, modify send/recv sig to accept
In this commit, we add a new NewCommitState struct. This preps us for the future change wherein a partial signature is also added to the mix. All related tests and type signatures have also been updated accordingly.
This commit is contained in:
9 files changed
+342
-322
No files matched your search
@@ -93,14 +93,14 @@ func (l *linkTestContext) receiveHtlcAliceToBob() {
|
||||
func (l *linkTestContext) sendCommitSigBobToAlice(expHtlcs int) {
|
||||
l.t.Helper()
|
||||
|
||||
sig, htlcSigs, _, err := l.bobChannel.SignNextCommitment()
|
||||
sigs, err := l.bobChannel.SignNextCommitment()
|
||||
if err != nil {
|
||||
l.t.Fatalf("error signing commitment: %v", err)
|
||||
}
|
||||
|
||||
commitSig := &lnwire.CommitSig{
|
||||
CommitSig: sig,
|
||||
HtlcSigs: htlcSigs,
|
||||
CommitSig: sigs.CommitSig,
|
||||
HtlcSigs: sigs.HtlcSigs,
|
||||
}
|
||||
|
||||
if len(commitSig.HtlcSigs) != expHtlcs {
|
||||
@@ -141,9 +141,10 @@ func (l *linkTestContext) receiveCommitSigAliceToBob(expHtlcs int) {
|
||||
|
||||
comSig := l.receiveCommitSigAlice(expHtlcs)
|
||||
|
||||
err := l.bobChannel.ReceiveNewCommitment(
|
||||
comSig.CommitSig, comSig.HtlcSigs,
|
||||
)
|
||||
err := l.bobChannel.ReceiveNewCommitment(&lnwallet.CommitSigs{
|
||||
CommitSig: comSig.CommitSig,
|
||||
HtlcSigs: comSig.HtlcSigs,
|
||||
})
|
||||
if err != nil {
|
||||
l.t.Fatalf("bob failed receiving commitment: %v", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user