Skip to content

Commit efcab17

Browse files
committed
Fixup: fix musig2 tests
1 parent 72bfca5 commit efcab17

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/commonTest/kotlin/fr/acinq/bitcoin/crypto/musig2/Musig2TestsCommon.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class Musig2TestsCommon {
3131
KeyAggCache.create(keyIndices.map { pubkeys[it] })
3232
}
3333
}
34+
3435
else -> {
3536
// The tweak cannot be applied, it would result in an invalid public key.
3637
val (_, cache) = KeyAggCache.create(keyIndices.map { pubkeys[it] })
@@ -103,10 +104,6 @@ class Musig2TestsCommon {
103104
val nonce = SecretNonce.generateWithCounter(1UL, privateKey, null, null, null)
104105
assertEquals(ByteVector.fromHex("0340A08273BBC9ED0A2BFBDBDAFCCB43073865643593988841F67E665864767047037844A24EC0B763CE73F8252445DDDDFB7CD10498D796AD7217B841882A3A9961"), nonce.second.data)
105106
}
106-
run {
107-
val nonce = SecretNonce.generateWithCounter(1UL, privateKey, null, null, null)
108-
assertEquals(ByteVector.fromHex("0340A08273BBC9ED0A2BFBDBDAFCCB43073865643593988841F67E665864767047037844A24EC0B763CE73F8252445DDDDFB7CD10498D796AD7217B841882A3A9961"), nonce.second.data)
109-
}
110107
}
111108

112109
@Test
@@ -375,7 +372,7 @@ class Musig2TestsCommon {
375372
assertFalse(Musig2.verify(aliceSig, aliceNonce.second, alicePubKey, spendingTx, 0, listOf(tx.txOut[0]), listOf(alicePubKey, bobPubKey), listOf(aliceNonce.second, aliceNonce.second), scriptTree = null))
376373

377374
// wrong inputs
378-
assertFalse(Musig2.verify(aliceSig, aliceNonce.second, alicePubKey, spendingTx, 0, listOf(tx.txOut[0], tx.txOut[0]), listOf(alicePubKey, bobPubKey), listOf(aliceNonce.second, aliceNonce.second), scriptTree = null))
375+
assertFalse(Musig2.verify(aliceSig, aliceNonce.second, alicePubKey, spendingTx, 0, listOf(tx.txOut[0], tx.txOut[0]), listOf(alicePubKey, bobPubKey), publicNonces, scriptTree = null))
379376
}
380377

381378
@Test

0 commit comments

Comments
 (0)