@@ -25,6 +25,7 @@ import fr.acinq.eclair.TestUtils.randomTxId
2525import fr .acinq .eclair ._
2626import fr .acinq .eclair .blockchain .fee .{ConfirmationTarget , FeeratePerKw }
2727import fr .acinq .eclair .channel .Helpers .Funding
28+ import fr .acinq .eclair .channel .fund .InteractiveTxBuilder .{Multisig2of2Input , Musig2Input }
2829import fr .acinq .eclair .transactions .CommitmentOutput .{InHtlc , OutHtlc }
2930import fr .acinq .eclair .transactions .Scripts ._
3031import fr .acinq .eclair .transactions .Transactions .AnchorOutputsCommitmentFormat .anchorAmount
@@ -555,6 +556,8 @@ class TransactionsSpec extends AnyFunSuite with Logging {
555556 val commitTx = Transactions .addAggregatedSignature(txInfo, sig)
556557 val expectedCommitTxWeight = commitmentFormat.commitWeight + 5 * commitmentFormat.htlcOutputWeight
557558 assertWeightMatches(commitTx.tx.weight(), expectedCommitTxWeight, commitmentFormat)
559+ val sharedInput = Musig2Input (InputInfo .TaprootInput (fundingTxOutpoint, fundingOutput, Taproot .musig2Aggregate(localFundingPriv.publicKey, remoteFundingPriv.publicKey), InputInfo .RedeemPath .KeyPath (None )), 0 , remoteFundingPriv.publicKey, 0 )
560+ assertWitnessWeightMatches(commitTx.tx.txIn(0 ).witness, sharedInput.weight, commitmentFormat)
558561 commitTx
559562 case DefaultCommitmentFormat | _ : AnchorOutputsCommitmentFormat =>
560563 val localSig = txInfo.sign(localFundingPriv, TxOwner .Local , commitmentFormat)
@@ -563,6 +566,8 @@ class TransactionsSpec extends AnyFunSuite with Logging {
563566 val expectedCommitTxWeight = commitmentFormat.commitWeight + 5 * commitmentFormat.htlcOutputWeight
564567 // we cannot do exact matches because DER signature encoding is variable length
565568 assertWeightMatches(commitTx.tx.weight(), expectedCommitTxWeight, commitmentFormat)
569+ val sharedInput = Multisig2of2Input (InputInfo .SegwitInput (fundingTxOutpoint, fundingOutput, Scripts .multiSig2of2(localFundingPriv.publicKey, remoteFundingPriv.publicKey)), 0 , remoteFundingPriv.publicKey)
570+ assertWitnessWeightMatches(commitTx.tx.txIn(0 ).witness, sharedInput.weight, commitmentFormat)
566571 commitTx
567572 }
568573 assert(checkSpendable(commitTx).isSuccess)
0 commit comments