Add sanity tests for .hashCode() and .equals() for multiple instances for EclairRpcClient/BitcoindRpcClient (#881)

This commit is contained in:
Chris Stewart 2019-11-22 07:59:26 -06:00 committed by GitHub
parent 14d3878d01
commit abffe5d7a9
2 changed files with 21 additions and 2 deletions

View File

@ -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 {

View File

@ -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.