Skip to content

Commit

Permalink
test: add test for ElectrumClient::server_features method
Browse files Browse the repository at this point in the history
  • Loading branch information
thunderbiscuit committed Dec 18, 2024
1 parent b8b5a0a commit e6d0f42
Showing 1 changed file with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package org.bitcoindevkit

import kotlin.test.Test
import kotlin.test.assertEquals
import org.rustbitcoin.bitcoin.Network
import org.bitcoindevkit.ServerFeaturesRes

private const val SIGNET_ELECTRUM_URL = "ssl://mempool.space:60602"

Expand Down Expand Up @@ -38,4 +40,16 @@ class LiveElectrumClientTest {
println("Received ${sentAndReceived.received.toSat()}")
}
}
}

@Test
fun testServerFeatures() {
val electrumClient: ElectrumClient = ElectrumClient("ssl://electrum.blockstream.info:60002")
val features: ServerFeaturesRes = electrumClient.serverFeatures()
println("Server Features:\n$features")

assertEquals(
expected = "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943",
actual = features.genesisHash
)
}
}

0 comments on commit e6d0f42

Please sign in to comment.