mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-19 05:43:51 +01:00
Add sanity tests for .hashCode() and .equals() for multiple instances for EclairRpcClient/BitcoindRpcClient (#881)
This commit is contained in:
parent
14d3878d01
commit
abffe5d7a9
@ -23,12 +23,20 @@ class BitcoindV18RpcClientTest extends BitcoindRpcTest {
|
|||||||
|
|
||||||
behavior of "BitcoindV18RpcClient"
|
behavior of "BitcoindV18RpcClient"
|
||||||
|
|
||||||
|
it must "have our BitcoindRpcClient work with .hashCode() and equals" in {
|
||||||
|
for {
|
||||||
|
(client1, client2) <- clientPairF
|
||||||
|
} yield {
|
||||||
|
assert(client1 != client2)
|
||||||
|
assert(client1.hashCode() != client2.hashCode())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
it should "be able to start a V18 bitcoind instance" in {
|
it should "be able to start a V18 bitcoind instance" in {
|
||||||
|
|
||||||
clientF.map { client =>
|
clientF.map { client =>
|
||||||
assert(client.version == BitcoindVersion.V18)
|
assert(client.version == BitcoindVersion.V18)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
it should "return active rpc commands" in {
|
it should "return active rpc commands" in {
|
||||||
|
@ -126,7 +126,18 @@ class EclairRpcClientTest extends BitcoinSAsyncTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
behavior of "RpcClient"
|
behavior of "EclairRpcClient"
|
||||||
|
|
||||||
|
it must "have our EclairRpcClient work with .hashCode() and equals" in {
|
||||||
|
val f = (client1: EclairApi, client2: EclairApi) => {
|
||||||
|
Future {
|
||||||
|
assert(client1 != client2)
|
||||||
|
assert(client1.hashCode() != client2.hashCode())
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
executeWithClientOtherClient(f)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Please keep this test the very first. All other tests rely on the propagated gossip messages.
|
* Please keep this test the very first. All other tests rely on the propagated gossip messages.
|
||||||
|
Loading…
Reference in New Issue
Block a user