From a51642ff13eac42fa6347cfd8ed3dbdf2aa70a3c Mon Sep 17 00:00:00 2001 From: Sean Gilligan Date: Fri, 6 Mar 2020 10:09:22 -0800 Subject: [PATCH] Another hack related to RPC port change --- .../groovy/foundation/omni/test/RegTestContext.groovy | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/omnij-rpc/src/main/groovy/foundation/omni/test/RegTestContext.groovy b/omnij-rpc/src/main/groovy/foundation/omni/test/RegTestContext.groovy index 1b74bcc4..591c4791 100644 --- a/omnij-rpc/src/main/groovy/foundation/omni/test/RegTestContext.groovy +++ b/omnij-rpc/src/main/groovy/foundation/omni/test/RegTestContext.groovy @@ -10,7 +10,14 @@ import org.bitcoinj.params.RegTestParams */ class RegTestContext { static setup(String user, String pass) { - def client = new OmniTestClient(RegTestParams.get(), RpcURI.defaultRegTestURI, user, pass) + // If Bitcoin Core 0.16.0 or greater, rpc port for RegTest has changed. ConsensusJ 0.5.0 + // reflects this change, but Travis tests are still testing an old Omni Core. + // Previously Bitcoin Core (and Omni Core) used the same port as TESTNET for REGTEST + // This recentBitcoinCore hack allows those tests to pass until we update `travis.yml` + // and any other test configuration/infrastructure, etc. + def recentBitcoinCore = false; + URI regTestRpcUri = recentBitcoinCore ? RpcURI.defaultRegTestURI : RpcURI.defaultTestNetURI + def client = new OmniTestClient(RegTestParams.get(), regTestRpcUri, user, pass) def env = new RegTestEnvironment(client) def funder = new RegTestOmniFundingSource(client) return [client, env, funder]