@@ -741,7 +741,7 @@ class TransactionsSpec extends AnyFunSuite with Logging {
741741 }
742742
743743 test(" generate valid commitment and htlc transactions (simple taproot channels)" ) {
744- val commitmentFormat = SimpleTaprootChannelCommitmentFormat
744+ val commitmentFormat : CommitmentFormat = SimpleTaprootChannelCommitmentFormat
745745 val finalPubKeyScript = Script .write(Script .pay2wpkh(PrivateKey (randomBytes32()).publicKey))
746746 // funding tx sends to musig2 aggregate of local and remote funding keys
747747 val fundingTx = Transaction (version = 2 , txIn = Nil , txOut = TxOut (Btc (1 ), Script .pay2tr(Taproot .musig2Aggregate(localFundingPriv.publicKey, remoteFundingPriv.publicKey), None )) :: Nil , lockTime = 0 )
@@ -779,7 +779,7 @@ class TransactionsSpec extends AnyFunSuite with Logging {
779779 sig <- Musig2 .aggregateTaprootSignatures(Seq (localPartialSig, remotePartialSig), txInfo.tx, 0 , Seq (fundingOutput), publicKeys, publicNonces, None )
780780 } yield sig
781781 Transactions .addAggregatedSignature(txInfo, sig)
782- case _ =>
782+ case DefaultCommitmentFormat | _ : AnchorOutputsCommitmentFormat =>
783783 val localSig = txInfo.sign(localPaymentPriv, TxOwner .Local , commitmentFormat)
784784 val remoteSig = txInfo.sign(remotePaymentPriv, TxOwner .Remote , commitmentFormat)
785785 Transactions .addSigs(txInfo, localFundingPriv.publicKey, remoteFundingPriv.publicKey, localSig, remoteSig)
@@ -820,7 +820,7 @@ class TransactionsSpec extends AnyFunSuite with Logging {
820820 // local spends local anchor
821821 val anchorKey = commitmentFormat match {
822822 case SimpleTaprootChannelCommitmentFormat => localDelayedPaymentPriv
823- case _ => localFundingPriv
823+ case DefaultCommitmentFormat | _ : AnchorOutputsCommitmentFormat => localFundingPriv
824824 }
825825 val Right (claimAnchorOutputTx) = makeClaimLocalAnchorOutputTx(commitTx.tx, anchorKey.publicKey, ConfirmationTarget .Absolute (BlockHeight (0 )))
826826 assert(checkSpendable(claimAnchorOutputTx).isFailure)
@@ -832,7 +832,7 @@ class TransactionsSpec extends AnyFunSuite with Logging {
832832 // remote spends remote anchor
833833 val anchorKey = commitmentFormat match {
834834 case SimpleTaprootChannelCommitmentFormat => remotePaymentPriv
835- case _ => remoteFundingPriv
835+ case DefaultCommitmentFormat | _ : AnchorOutputsCommitmentFormat => remoteFundingPriv
836836 }
837837 val Right (claimAnchorOutputTx) = makeClaimLocalAnchorOutputTx(commitTx.tx, anchorKey.publicKey, ConfirmationTarget .Absolute (BlockHeight (0 )))
838838 assert(checkSpendable(claimAnchorOutputTx).isFailure)
@@ -955,7 +955,7 @@ class TransactionsSpec extends AnyFunSuite with Logging {
955955 case SimpleTaprootChannelCommitmentFormat =>
956956 val scriptTree = Taproot .offeredHtlcScriptTree(localHtlcPriv.publicKey, remoteHtlcPriv.publicKey, htlc1.paymentHash)
957957 makeHtlcPenaltyTx(commitTx.tx, htlcOutputIndex, localRevocationPriv.publicKey.xOnly, scriptTree, localDustLimit, finalPubKeyScript, feeratePerKw)
958- case _ =>
958+ case DefaultCommitmentFormat | _ : AnchorOutputsCommitmentFormat =>
959959 val script = Script .write(Scripts .htlcOffered(localHtlcPriv.publicKey, remoteHtlcPriv.publicKey, localRevocationPriv.publicKey, Crypto .ripemd160(htlc1.paymentHash), commitmentFormat))
960960 makeHtlcPenaltyTx(commitTx.tx, htlcOutputIndex, script, localDustLimit, finalPubKeyScript, feeratePerKw)
961961 }
@@ -973,7 +973,7 @@ class TransactionsSpec extends AnyFunSuite with Logging {
973973 case SimpleTaprootChannelCommitmentFormat =>
974974 val scriptTree = Taproot .receivedHtlcScriptTree(localHtlcPriv.publicKey, remoteHtlcPriv.publicKey, htlc.paymentHash, htlc.cltvExpiry)
975975 makeHtlcPenaltyTx(commitTx.tx, htlcOutputIndex, localRevocationPriv.publicKey.xOnly, scriptTree, localDustLimit, finalPubKeyScript, feeratePerKw)
976- case _ =>
976+ case DefaultCommitmentFormat | _ : AnchorOutputsCommitmentFormat =>
977977 val script = Script .write(Scripts .htlcReceived(localHtlcPriv.publicKey, remoteHtlcPriv.publicKey, localRevocationPriv.publicKey, Crypto .ripemd160(htlc.paymentHash), htlc.cltvExpiry, commitmentFormat))
978978 makeHtlcPenaltyTx(commitTx.tx, htlcOutputIndex, script, localDustLimit, finalPubKeyScript, feeratePerKw)
979979 }
0 commit comments