@@ -5,7 +5,7 @@ import fr.acinq.bitcoin.Transaction
55import fr.acinq.bitcoin.TxId
66import fr.acinq.lightning.Lightning.randomBytes32
77import fr.acinq.lightning.blockchain.*
8- import fr.acinq.lightning.blockchain.mempool.MempoolSpaceClient.Companion.OfficialMempoolTestnet
8+ import fr.acinq.lightning.blockchain.mempool.MempoolSpaceClient.Companion.OfficialMempoolTestnet4
99import fr.acinq.lightning.tests.utils.LightningTestSuite
1010import fr.acinq.lightning.tests.utils.runSuspendTest
1111import fr.acinq.lightning.tests.utils.testLoggerFactory
@@ -17,26 +17,25 @@ import kotlin.test.assertEquals
1717import kotlin.test.assertIs
1818import kotlin.time.Duration.Companion.seconds
1919
20- @Ignore
2120class MempoolSpaceWatcherTest : LightningTestSuite () {
2221
2322 @Test
2423 fun `watch-spent on a transaction` () = runSuspendTest {
25- val client = MempoolSpaceClient (mempoolUrl = OfficialMempoolTestnet , testLoggerFactory)
24+ val client = MempoolSpaceClient (mempoolUrl = OfficialMempoolTestnet4 , testLoggerFactory)
2625 val watcher = MempoolSpaceWatcher (client, scope = this , testLoggerFactory)
2726
2827 val notifications = watcher.openWatchNotificationsFlow()
2928
3029 val watch = WatchSpent (
3130 channelId = randomBytes32(),
32- txId = TxId (" b97167ea09da62daaa1d3198460fc4c204a553cb3e5c80ab48f5b75a870f15c5 " ),
33- outputIndex = 0 ,
31+ txId = TxId (" 002f3246fa012ded792050f4a834e2eccdd772e1c7dc3a6a88cd6acdcbb9a2b2 " ),
32+ outputIndex = 1 ,
3433 publicKeyScript = ByteVector .empty,
3534 event = BITCOIN_FUNDING_SPENT
3635 )
3736 watcher.watch(watch)
3837 val event = assertIs<WatchEventSpent >(notifications.first())
39- assertEquals(TxId (" 5693d68997abfacb65cc7e6019e8ed2edb3f9f2260ae8d221e8726b8fe870ae0 " ), event.tx.txid)
38+ assertEquals(TxId (" 8bce727fe08fbb79f02682f71d0b1f33a79039cd7a70623a51945bf2dc86d77c " ), event.tx.txid)
4039 // Right after checking whether the watched utxo is spent, a 2nd call is made by the watcher
4140 // to find out whether the spending tx is confirmed, and the watch can be cleaned up. We give
4241 // some time for that call to complete, in order to prevent a coroutine cancellation stack trace.
@@ -45,20 +44,20 @@ class MempoolSpaceWatcherTest : LightningTestSuite() {
4544
4645 @Test
4746 fun `watch-confirmed on a transaction` () = runSuspendTest {
48- val client = MempoolSpaceClient (mempoolUrl = OfficialMempoolTestnet , testLoggerFactory)
47+ val client = MempoolSpaceClient (mempoolUrl = OfficialMempoolTestnet4 , testLoggerFactory)
4948 val watcher = MempoolSpaceWatcher (client, scope = this , testLoggerFactory)
5049
5150 val notifications = watcher.openWatchNotificationsFlow()
5251
5352 val watch = WatchConfirmed (
5453 channelId = randomBytes32(),
55- txId = TxId (" 5693d68997abfacb65cc7e6019e8ed2edb3f9f2260ae8d221e8726b8fe870ae0 " ),
54+ txId = TxId (" 8bce727fe08fbb79f02682f71d0b1f33a79039cd7a70623a51945bf2dc86d77c " ),
5655 publicKeyScript = ByteVector .empty,
5756 event = BITCOIN_FUNDING_DEPTHOK ,
5857 minDepth = 5
5958 )
6059 watcher.watch(watch)
6160 val event = assertIs<WatchEventConfirmed >(notifications.first())
62- assertEquals(TxId (" 5693d68997abfacb65cc7e6019e8ed2edb3f9f2260ae8d221e8726b8fe870ae0 " ), event.tx.txid)
61+ assertEquals(TxId (" 8bce727fe08fbb79f02682f71d0b1f33a79039cd7a70623a51945bf2dc86d77c " ), event.tx.txid)
6362 }
6463}
0 commit comments