From e6d0f422ab3be5ffa99c91cb0bc33215aece191e Mon Sep 17 00:00:00 2001 From: thunderbiscuit Date: Wed, 18 Dec 2024 11:03:50 -0500 Subject: [PATCH] test: add test for ElectrumClient::server_features method --- .../org/bitcoindevkit/LiveElectrumClientTest.kt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) 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 + ) + } +}