diff --git a/bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/LiveElectrumClientTest.kt b/bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/LiveElectrumClientTest.kt index 0e4801c8..0eebc2b8 100644 --- a/bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/LiveElectrumClientTest.kt +++ b/bdk-jvm/lib/src/test/kotlin/org/bitcoindevkit/LiveElectrumClientTest.kt @@ -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" @@ -38,4 +40,16 @@ class LiveElectrumClientTest { println("Received ${sentAndReceived.received.toSat()}") } } -} \ No newline at end of file + + @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 + ) + } +} diff --git a/bdk-swift/Tests/BitcoinDevKitTests/LiveElectrumClientTests.swift b/bdk-swift/Tests/BitcoinDevKitTests/LiveElectrumClientTests.swift index 12b20218..85327d3f 100644 --- a/bdk-swift/Tests/BitcoinDevKitTests/LiveElectrumClientTests.swift +++ b/bdk-swift/Tests/BitcoinDevKitTests/LiveElectrumClientTests.swift @@ -47,4 +47,15 @@ final class LiveElectrumClientTests: XCTestCase { print("Received \(sentAndReceived.received.toSat())") } } + + func testServerFeatures() throws { + let electrumClient: ElectrumClient = try ElectrumClient(url: "ssl://electrum.blockstream.info:60002") + let features: ServerFeaturesRes = try electrumClient.serverFeatures() + print("Server Features:\n\(features)") + + XCTAssertEqual( + features.genesisHash, + "000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943" + ) + } }