From b76d475b6042c1e3460cfad92cc088ce2924828a Mon Sep 17 00:00:00 2001 From: Alva Swanson Date: Wed, 4 Sep 2024 14:03:56 +0000 Subject: [PATCH 1/5] Move JUnit 5 BitcoindExtension to wallets.regtest module The wallets.regtest can't depend on any Bisq 2 API to be able to re-use the bitcoind regtest module in Bisq 1. I migrated our BitcoinJ fork to the upstream version but Bisq 1 uses deprecated/removed BitcoinJ APIs, and it's too risky to update critical code without testing the changes. Bisq 1 doesn't have any bitcoind-based integration testing code and quicker to re-use Bisq 2 bitcoind integration test infrastructure. --- ...oindConnectionFailureIntegrationTests.java | 2 +- ...lletNameDocumentationIntegrationTests.java | 2 +- ...coindCreateWalletNameIntegrationTests.java | 2 +- ...itcoindListDescriptorsIntegrationTest.java | 2 +- .../BitcoindPsbtMultiSigIntegrationTests.java | 2 +- .../BitcoindReceiveAddrIntegrationTests.java | 2 +- ...itcoindSendAndListTxsIntegrationTests.java | 2 +- ...indSendAndListUnspentIntegrationTests.java | 2 +- .../BitcoindSendIntegrationTests.java | 2 +- .../BitcoindSigningIntegrationTests.java | 2 +- ...WalletCreationAndListIntegrationTests.java | 2 +- ...qBlockHashIntegrationIntegrationTests.java | 2 +- ...qConnectionInfoFinderIntegrationTests.java | 2 +- .../wallets}/regtest/BitcoindExtension.java | 2 +- .../main/java/bisq/wallets/regtest/Os.java | 62 +++++++++++++++++++ .../bitcoind/BitcoindRegtestSetup.java | 4 +- 16 files changed, 78 insertions(+), 16 deletions(-) rename wallets/{bitcoind/src/integrationTest/java/bisq/wallets/bitcoind => regtest/src/main/java/bisq/wallets}/regtest/BitcoindExtension.java (98%) create mode 100644 wallets/regtest/src/main/java/bisq/wallets/regtest/Os.java diff --git a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindConnectionFailureIntegrationTests.java b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindConnectionFailureIntegrationTests.java index e46b05c529..1f63b6ecab 100644 --- a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindConnectionFailureIntegrationTests.java +++ b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindConnectionFailureIntegrationTests.java @@ -17,7 +17,7 @@ package bisq.wallets.bitcoind; -import bisq.wallets.bitcoind.regtest.BitcoindExtension; +import bisq.wallets.regtest.BitcoindExtension; import bisq.wallets.regtest.ConnectionFailureIntegrationTests; import bisq.wallets.regtest.bitcoind.BitcoindRegtestSetup; import bisq.wallets.regtest.process.MultiProcessCoordinator; diff --git a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindCreateWalletNameDocumentationIntegrationTests.java b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindCreateWalletNameDocumentationIntegrationTests.java index 5a48995c73..c94405cc82 100644 --- a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindCreateWalletNameDocumentationIntegrationTests.java +++ b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindCreateWalletNameDocumentationIntegrationTests.java @@ -17,7 +17,7 @@ package bisq.wallets.bitcoind; -import bisq.wallets.bitcoind.regtest.BitcoindExtension; +import bisq.wallets.regtest.BitcoindExtension; import bisq.wallets.bitcoind.rpc.BitcoindDaemon; import bisq.wallets.bitcoind.rpc.calls.BitcoindCreateWalletRpcCall; import bisq.wallets.json_rpc.RpcConfig; diff --git a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindCreateWalletNameIntegrationTests.java b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindCreateWalletNameIntegrationTests.java index fbf4a2580f..a5f32ec33d 100644 --- a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindCreateWalletNameIntegrationTests.java +++ b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindCreateWalletNameIntegrationTests.java @@ -17,7 +17,7 @@ package bisq.wallets.bitcoind; -import bisq.wallets.bitcoind.regtest.BitcoindExtension; +import bisq.wallets.regtest.BitcoindExtension; import bisq.wallets.bitcoind.rpc.BitcoindDaemon; import bisq.wallets.regtest.AbstractRegtestSetup; import bisq.wallets.regtest.bitcoind.BitcoindRegtestSetup; diff --git a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindListDescriptorsIntegrationTest.java b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindListDescriptorsIntegrationTest.java index ea9d3b9569..982e2f1417 100644 --- a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindListDescriptorsIntegrationTest.java +++ b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindListDescriptorsIntegrationTest.java @@ -17,7 +17,7 @@ package bisq.wallets.bitcoind; -import bisq.wallets.bitcoind.regtest.BitcoindExtension; +import bisq.wallets.regtest.BitcoindExtension; import bisq.wallets.bitcoind.rpc.BitcoindWallet; import bisq.wallets.bitcoind.rpc.responses.BitcoindDescriptor; import bisq.wallets.bitcoind.rpc.responses.BitcoindListDescriptorResponse; diff --git a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindPsbtMultiSigIntegrationTests.java b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindPsbtMultiSigIntegrationTests.java index 92584887b5..c828c2d273 100644 --- a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindPsbtMultiSigIntegrationTests.java +++ b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindPsbtMultiSigIntegrationTests.java @@ -17,7 +17,7 @@ package bisq.wallets.bitcoind; -import bisq.wallets.bitcoind.regtest.BitcoindExtension; +import bisq.wallets.regtest.BitcoindExtension; import bisq.wallets.bitcoind.rpc.BitcoindDaemon; import bisq.wallets.bitcoind.rpc.BitcoindWallet; import bisq.wallets.bitcoind.rpc.calls.requests.BitcoindImportDescriptorRequestEntry; diff --git a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindReceiveAddrIntegrationTests.java b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindReceiveAddrIntegrationTests.java index 6db67db26d..f67b23b348 100644 --- a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindReceiveAddrIntegrationTests.java +++ b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindReceiveAddrIntegrationTests.java @@ -17,7 +17,7 @@ package bisq.wallets.bitcoind; -import bisq.wallets.bitcoind.regtest.BitcoindExtension; +import bisq.wallets.regtest.BitcoindExtension; import bisq.wallets.bitcoind.rpc.BitcoindWallet; import bisq.wallets.core.model.AddressType; import bisq.wallets.regtest.bitcoind.BitcoindRegtestSetup; diff --git a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindSendAndListTxsIntegrationTests.java b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindSendAndListTxsIntegrationTests.java index fd5cd7b8e8..56e9d60132 100644 --- a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindSendAndListTxsIntegrationTests.java +++ b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindSendAndListTxsIntegrationTests.java @@ -17,7 +17,7 @@ package bisq.wallets.bitcoind; -import bisq.wallets.bitcoind.regtest.BitcoindExtension; +import bisq.wallets.regtest.BitcoindExtension; import bisq.wallets.bitcoind.rpc.BitcoindWallet; import bisq.wallets.bitcoind.rpc.responses.BitcoindListTransactionsResponse; import bisq.wallets.core.model.AddressType; diff --git a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindSendAndListUnspentIntegrationTests.java b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindSendAndListUnspentIntegrationTests.java index 1576cf6690..53af7c4706 100644 --- a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindSendAndListUnspentIntegrationTests.java +++ b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindSendAndListUnspentIntegrationTests.java @@ -17,7 +17,7 @@ package bisq.wallets.bitcoind; -import bisq.wallets.bitcoind.regtest.BitcoindExtension; +import bisq.wallets.regtest.BitcoindExtension; import bisq.wallets.bitcoind.rpc.BitcoindWallet; import bisq.wallets.bitcoind.rpc.responses.BitcoindListUnspentResponse; import bisq.wallets.regtest.bitcoind.BitcoindRegtestSetup; diff --git a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindSendIntegrationTests.java b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindSendIntegrationTests.java index 05d9872634..93ab4085eb 100644 --- a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindSendIntegrationTests.java +++ b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindSendIntegrationTests.java @@ -17,7 +17,7 @@ package bisq.wallets.bitcoind; -import bisq.wallets.bitcoind.regtest.BitcoindExtension; +import bisq.wallets.regtest.BitcoindExtension; import bisq.wallets.bitcoind.rpc.BitcoindWallet; import bisq.wallets.core.model.AddressType; import bisq.wallets.regtest.bitcoind.BitcoindRegtestSetup; diff --git a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindSigningIntegrationTests.java b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindSigningIntegrationTests.java index cfbff70c0b..9706256631 100644 --- a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindSigningIntegrationTests.java +++ b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindSigningIntegrationTests.java @@ -17,7 +17,7 @@ package bisq.wallets.bitcoind; -import bisq.wallets.bitcoind.regtest.BitcoindExtension; +import bisq.wallets.regtest.BitcoindExtension; import bisq.wallets.bitcoind.rpc.BitcoindWallet; import bisq.wallets.core.model.AddressType; import bisq.wallets.regtest.bitcoind.BitcoindRegtestSetup; diff --git a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindWalletCreationAndListIntegrationTests.java b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindWalletCreationAndListIntegrationTests.java index a717f9f185..606e8fc4b9 100644 --- a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindWalletCreationAndListIntegrationTests.java +++ b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/BitcoindWalletCreationAndListIntegrationTests.java @@ -17,7 +17,7 @@ package bisq.wallets.bitcoind; -import bisq.wallets.bitcoind.regtest.BitcoindExtension; +import bisq.wallets.regtest.BitcoindExtension; import bisq.wallets.bitcoind.rpc.BitcoindDaemon; import bisq.wallets.bitcoind.rpc.BitcoindWallet; import bisq.wallets.json_rpc.RpcConfig; diff --git a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/zmq/BitcoindZeroMqBlockHashIntegrationIntegrationTests.java b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/zmq/BitcoindZeroMqBlockHashIntegrationIntegrationTests.java index 33a7e61c0c..cf2b49b1ea 100644 --- a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/zmq/BitcoindZeroMqBlockHashIntegrationIntegrationTests.java +++ b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/zmq/BitcoindZeroMqBlockHashIntegrationIntegrationTests.java @@ -17,7 +17,7 @@ package bisq.wallets.bitcoind.zmq; -import bisq.wallets.bitcoind.regtest.BitcoindExtension; +import bisq.wallets.regtest.BitcoindExtension; import bisq.wallets.regtest.bitcoind.BitcoindRegtestSetup; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; diff --git a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/zmq/BitcoindZeroMqConnectionInfoFinderIntegrationTests.java b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/zmq/BitcoindZeroMqConnectionInfoFinderIntegrationTests.java index 88228a948f..b84ce4ed4e 100644 --- a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/zmq/BitcoindZeroMqConnectionInfoFinderIntegrationTests.java +++ b/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/zmq/BitcoindZeroMqConnectionInfoFinderIntegrationTests.java @@ -17,7 +17,7 @@ package bisq.wallets.bitcoind.zmq; -import bisq.wallets.bitcoind.regtest.BitcoindExtension; +import bisq.wallets.regtest.BitcoindExtension; import bisq.wallets.bitcoind.rpc.BitcoindDaemon; import bisq.wallets.bitcoind.rpc.responses.BitcoindGetZmqNotificationsResponse; import bisq.wallets.regtest.bitcoind.BitcoindRegtestSetup; diff --git a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/regtest/BitcoindExtension.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/BitcoindExtension.java similarity index 98% rename from wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/regtest/BitcoindExtension.java rename to wallets/regtest/src/main/java/bisq/wallets/regtest/BitcoindExtension.java index edb5a99bd2..9f0891b3c0 100644 --- a/wallets/bitcoind/src/integrationTest/java/bisq/wallets/bitcoind/regtest/BitcoindExtension.java +++ b/wallets/regtest/src/main/java/bisq/wallets/regtest/BitcoindExtension.java @@ -15,7 +15,7 @@ * along with Bisq. If not, see . */ -package bisq.wallets.bitcoind.regtest; +package bisq.wallets.regtest; import bisq.wallets.regtest.bitcoind.BitcoindRegtestSetup; import org.junit.jupiter.api.extension.BeforeAllCallback; diff --git a/wallets/regtest/src/main/java/bisq/wallets/regtest/Os.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/Os.java new file mode 100644 index 0000000000..82bfe13bb8 --- /dev/null +++ b/wallets/regtest/src/main/java/bisq/wallets/regtest/Os.java @@ -0,0 +1,62 @@ +package bisq.wallets.regtest; + +import lombok.Getter; + +import java.util.Locale; + +public enum Os { + LINUX("linux"), + MAC_OS("macos"), + WINDOWS("win"); + + @Getter + private final String canonicalName; + + Os(String canonicalName) { + this.canonicalName = canonicalName; + } + + public static bisq.common.platform.OS getOS() { + String osName = getOsName(); + if (isLinux(osName)) { + return bisq.common.platform.OS.LINUX; + } else if (isMacOs(osName)) { + return bisq.common.platform.OS.MAC_OS; + } else if (isWindows(osName)) { + return bisq.common.platform.OS.WINDOWS; + } + throw new IllegalStateException("Running on unsupported OS: " + osName); + } + + public static boolean isLinux() { + return isLinux(getOsName()); + } + + public static boolean isLinux(String osName) { + return osName.contains("linux"); + } + + public static boolean isMacOs() { + return isMacOs(getOsName()); + } + + public static boolean isMacOs(String osName) { + return osName.contains("mac") || osName.contains("darwin"); + } + + public static boolean isWindows() { + return isWindows(getOsName()); + } + + public static boolean isWindows(String osName) { + return osName.contains("win"); + } + + public static String getOsName() { + return System.getProperty("os.name").toLowerCase(Locale.US); + } + + public static String getOsVersion() { + return System.getProperty("os.version"); + } +} diff --git a/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/BitcoindRegtestSetup.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/BitcoindRegtestSetup.java index af3a8717b6..d641487508 100644 --- a/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/BitcoindRegtestSetup.java +++ b/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/BitcoindRegtestSetup.java @@ -17,7 +17,6 @@ package bisq.wallets.regtest.bitcoind; -import bisq.common.platform.OS; import bisq.common.util.NetworkUtils; import bisq.wallets.bitcoind.rpc.BitcoindDaemon; import bisq.wallets.bitcoind.rpc.BitcoindWallet; @@ -25,6 +24,7 @@ import bisq.wallets.bitcoind.zmq.ZmqListeners; import bisq.wallets.json_rpc.RpcConfig; import bisq.wallets.regtest.AbstractRegtestSetup; +import bisq.wallets.regtest.Os; import bisq.wallets.regtest.process.MultiProcessCoordinator; import lombok.Getter; @@ -158,7 +158,7 @@ private Path installBitcoind(Path bitcoindBinaryDir) throws IOException { throw new IllegalStateException("Couldn't extract bitcoind binary."); } - if (OS.isLinux() || OS.isMacOs()) { + if (Os.isLinux() || Os.isMacOs()) { isSuccess = bitcoindPath.toFile().setExecutable(true); if (!isSuccess) { throw new IllegalStateException("Couldn't set executable bit on bitcoind binary."); From ed3edf881145649459ce70f3ca2389e7768447f1 Mon Sep 17 00:00:00 2001 From: Alva Swanson Date: Wed, 4 Sep 2024 14:17:58 +0000 Subject: [PATCH 2/5] Move DaemonProcess to wallets.regtest module --- wallets/electrum/build.gradle.kts | 3 ++- .../wallets/electrum/regtest/electrum/ElectrumRegtest.java | 2 +- .../regtest/electrumx/ElectrumXServerRegtestProcess.java | 2 +- .../src/main/java/bisq/wallets/electrum/ElectrumProcess.java | 2 +- .../java/bisq/wallets/electrum/ElectrumRegtestProcess.java | 2 +- .../main/java/bisq/wallets/regtest/AbstractRegtestSetup.java | 2 +- .../wallets/regtest/AbstractSharedRegtestInstanceTests.java | 2 +- .../wallets/regtest/ConnectionFailureIntegrationTests.java | 2 +- .../main/java/bisq/wallets/regtest/WalletStartupTests.java | 2 +- .../wallets/regtest/bitcoind/BitcoindRegtestProcess.java | 2 +- .../java/bisq/wallets/regtest/bitcoind/RemoteBitcoind.java | 2 +- .../main/java/bisq/wallets/regtest}/process/BisqProcess.java | 2 +- .../java/bisq/wallets/regtest}/process/DaemonProcess.java | 5 +++-- .../wallets/regtest/process/MultiProcessCoordinator.java | 2 -- .../regtest/process}/WalletStartupFailedException.java | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) rename wallets/{process/src/main/java/bisq/wallets => regtest/src/main/java/bisq/wallets/regtest}/process/BisqProcess.java (95%) rename wallets/{process/src/main/java/bisq/wallets => regtest/src/main/java/bisq/wallets/regtest}/process/DaemonProcess.java (96%) rename wallets/{core/src/main/java/bisq/wallets/core/exceptions => regtest/src/main/java/bisq/wallets/regtest/process}/WalletStartupFailedException.java (95%) diff --git a/wallets/electrum/build.gradle.kts b/wallets/electrum/build.gradle.kts index 94aaa7255b..bd00b58c9c 100644 --- a/wallets/electrum/build.gradle.kts +++ b/wallets/electrum/build.gradle.kts @@ -23,7 +23,8 @@ dependencies { implementation("bisq:persistence") implementation(project(":json-rpc")) implementation(project(":process")) - + implementation(project(":regtest")) + implementation(libs.typesafe.config) implementation(libs.bundles.glassfish.jersey) diff --git a/wallets/electrum/src/integrationTest/java/bisq/wallets/electrum/regtest/electrum/ElectrumRegtest.java b/wallets/electrum/src/integrationTest/java/bisq/wallets/electrum/regtest/electrum/ElectrumRegtest.java index 63341fe518..b32768fc98 100644 --- a/wallets/electrum/src/integrationTest/java/bisq/wallets/electrum/regtest/electrum/ElectrumRegtest.java +++ b/wallets/electrum/src/integrationTest/java/bisq/wallets/electrum/regtest/electrum/ElectrumRegtest.java @@ -24,7 +24,7 @@ import bisq.wallets.electrum.rpc.ElectrumDaemon; import bisq.wallets.electrum.rpc.ElectrumProcessConfig; import bisq.wallets.electrum.rpc.responses.ElectrumCreateResponse; -import bisq.wallets.process.BisqProcess; +import bisq.wallets.regtest.process.BisqProcess; import bisq.wallets.regtest.AbstractRegtestSetup; import bisq.wallets.regtest.bitcoind.RemoteBitcoind; import lombok.Getter; diff --git a/wallets/electrum/src/integrationTest/java/bisq/wallets/electrum/regtest/electrumx/ElectrumXServerRegtestProcess.java b/wallets/electrum/src/integrationTest/java/bisq/wallets/electrum/regtest/electrumx/ElectrumXServerRegtestProcess.java index 3653361b00..dcfb4e8412 100644 --- a/wallets/electrum/src/integrationTest/java/bisq/wallets/electrum/regtest/electrumx/ElectrumXServerRegtestProcess.java +++ b/wallets/electrum/src/integrationTest/java/bisq/wallets/electrum/regtest/electrumx/ElectrumXServerRegtestProcess.java @@ -20,7 +20,7 @@ import bisq.common.file.InputStreamScanner; import bisq.common.file.LogScanner; import bisq.wallets.json_rpc.RpcConfig; -import bisq.wallets.process.DaemonProcess; +import bisq.wallets.regtest.process.DaemonProcess; import bisq.wallets.process.ProcessConfig; import lombok.extern.slf4j.Slf4j; diff --git a/wallets/electrum/src/main/java/bisq/wallets/electrum/ElectrumProcess.java b/wallets/electrum/src/main/java/bisq/wallets/electrum/ElectrumProcess.java index 1510386770..e4988b75d0 100644 --- a/wallets/electrum/src/main/java/bisq/wallets/electrum/ElectrumProcess.java +++ b/wallets/electrum/src/main/java/bisq/wallets/electrum/ElectrumProcess.java @@ -21,7 +21,7 @@ import bisq.common.platform.PlatformUtils; import bisq.wallets.electrum.rpc.ElectrumDaemon; import bisq.wallets.electrum.rpc.ElectrumProcessConfig; -import bisq.wallets.process.BisqProcess; +import bisq.wallets.regtest.process.BisqProcess; import lombok.Getter; import lombok.extern.slf4j.Slf4j; diff --git a/wallets/electrum/src/main/java/bisq/wallets/electrum/ElectrumRegtestProcess.java b/wallets/electrum/src/main/java/bisq/wallets/electrum/ElectrumRegtestProcess.java index 3520a95d26..c8906b5ff9 100644 --- a/wallets/electrum/src/main/java/bisq/wallets/electrum/ElectrumRegtestProcess.java +++ b/wallets/electrum/src/main/java/bisq/wallets/electrum/ElectrumRegtestProcess.java @@ -26,8 +26,8 @@ import bisq.wallets.json_rpc.JsonRpcClient; import bisq.wallets.json_rpc.RpcClientFactory; import bisq.wallets.json_rpc.RpcConfig; -import bisq.wallets.process.DaemonProcess; import bisq.wallets.process.ProcessConfig; +import bisq.wallets.regtest.process.DaemonProcess; import com.fasterxml.jackson.databind.ObjectMapper; import lombok.Getter; import lombok.extern.slf4j.Slf4j; diff --git a/wallets/regtest/src/main/java/bisq/wallets/regtest/AbstractRegtestSetup.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/AbstractRegtestSetup.java index 0eef33f032..1bd0e42fa6 100644 --- a/wallets/regtest/src/main/java/bisq/wallets/regtest/AbstractRegtestSetup.java +++ b/wallets/regtest/src/main/java/bisq/wallets/regtest/AbstractRegtestSetup.java @@ -19,7 +19,7 @@ import bisq.common.file.FileUtils; import bisq.wallets.json_rpc.RpcConfig; -import bisq.wallets.process.BisqProcess; +import bisq.wallets.regtest.process.BisqProcess; import java.io.IOException; import java.nio.file.Path; diff --git a/wallets/regtest/src/main/java/bisq/wallets/regtest/AbstractSharedRegtestInstanceTests.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/AbstractSharedRegtestInstanceTests.java index 6237699abf..20ad193519 100644 --- a/wallets/regtest/src/main/java/bisq/wallets/regtest/AbstractSharedRegtestInstanceTests.java +++ b/wallets/regtest/src/main/java/bisq/wallets/regtest/AbstractSharedRegtestInstanceTests.java @@ -17,7 +17,7 @@ package bisq.wallets.regtest; -import bisq.wallets.process.BisqProcess; +import bisq.wallets.regtest.process.BisqProcess; import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.TestInstance; diff --git a/wallets/regtest/src/main/java/bisq/wallets/regtest/ConnectionFailureIntegrationTests.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/ConnectionFailureIntegrationTests.java index 9b5dd9d9f6..0d725bcbeb 100644 --- a/wallets/regtest/src/main/java/bisq/wallets/regtest/ConnectionFailureIntegrationTests.java +++ b/wallets/regtest/src/main/java/bisq/wallets/regtest/ConnectionFailureIntegrationTests.java @@ -22,7 +22,7 @@ import bisq.wallets.json_rpc.RpcClientFactory; import bisq.wallets.json_rpc.JsonRpcClient; import bisq.wallets.json_rpc.exceptions.InvalidRpcCredentialsException; -import bisq.wallets.process.BisqProcess; +import bisq.wallets.regtest.process.BisqProcess; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/wallets/regtest/src/main/java/bisq/wallets/regtest/WalletStartupTests.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/WalletStartupTests.java index e3856a212f..9abfa79ab1 100644 --- a/wallets/regtest/src/main/java/bisq/wallets/regtest/WalletStartupTests.java +++ b/wallets/regtest/src/main/java/bisq/wallets/regtest/WalletStartupTests.java @@ -17,7 +17,7 @@ package bisq.wallets.regtest; -import bisq.wallets.process.BisqProcess; +import bisq.wallets.regtest.process.BisqProcess; import org.junit.jupiter.api.Test; import java.io.IOException; diff --git a/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/BitcoindRegtestProcess.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/BitcoindRegtestProcess.java index 8c37458290..7cc45b3b44 100644 --- a/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/BitcoindRegtestProcess.java +++ b/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/BitcoindRegtestProcess.java @@ -23,7 +23,7 @@ import bisq.wallets.json_rpc.RpcCallFailureException; import bisq.wallets.json_rpc.RpcClientFactory; import bisq.wallets.json_rpc.RpcConfig; -import bisq.wallets.process.DaemonProcess; +import bisq.wallets.regtest.process.DaemonProcess; import bisq.wallets.process.ProcessConfig; import lombok.Getter; import lombok.extern.slf4j.Slf4j; diff --git a/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/RemoteBitcoind.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/RemoteBitcoind.java index d25793c6d3..11e71c42e8 100644 --- a/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/RemoteBitcoind.java +++ b/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/RemoteBitcoind.java @@ -28,7 +28,7 @@ import bisq.wallets.json_rpc.JsonRpcClient; import bisq.wallets.json_rpc.RpcClientFactory; import bisq.wallets.json_rpc.RpcConfig; -import bisq.wallets.process.BisqProcess; +import bisq.wallets.regtest.process.BisqProcess; import lombok.Getter; import java.util.ArrayList; diff --git a/wallets/process/src/main/java/bisq/wallets/process/BisqProcess.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/process/BisqProcess.java similarity index 95% rename from wallets/process/src/main/java/bisq/wallets/process/BisqProcess.java rename to wallets/regtest/src/main/java/bisq/wallets/regtest/process/BisqProcess.java index ad7ee23862..46b65f467d 100644 --- a/wallets/process/src/main/java/bisq/wallets/process/BisqProcess.java +++ b/wallets/regtest/src/main/java/bisq/wallets/regtest/process/BisqProcess.java @@ -15,7 +15,7 @@ * along with Bisq. If not, see . */ -package bisq.wallets.process; +package bisq.wallets.regtest.process; public interface BisqProcess { void start() throws InterruptedException; diff --git a/wallets/process/src/main/java/bisq/wallets/process/DaemonProcess.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/process/DaemonProcess.java similarity index 96% rename from wallets/process/src/main/java/bisq/wallets/process/DaemonProcess.java rename to wallets/regtest/src/main/java/bisq/wallets/regtest/process/DaemonProcess.java index 942804317a..cca19adbf6 100644 --- a/wallets/process/src/main/java/bisq/wallets/process/DaemonProcess.java +++ b/wallets/regtest/src/main/java/bisq/wallets/regtest/process/DaemonProcess.java @@ -15,11 +15,12 @@ * along with Bisq. If not, see . */ -package bisq.wallets.process; +package bisq.wallets.regtest.process; import bisq.common.file.FileUtils; import bisq.common.file.LogScanner; -import bisq.wallets.core.exceptions.WalletStartupFailedException; +import bisq.wallets.process.CannotStartProcessException; +import bisq.wallets.process.ProcessConfig; import lombok.Getter; import lombok.extern.slf4j.Slf4j; diff --git a/wallets/regtest/src/main/java/bisq/wallets/regtest/process/MultiProcessCoordinator.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/process/MultiProcessCoordinator.java index 76842ee962..fb6c78c328 100644 --- a/wallets/regtest/src/main/java/bisq/wallets/regtest/process/MultiProcessCoordinator.java +++ b/wallets/regtest/src/main/java/bisq/wallets/regtest/process/MultiProcessCoordinator.java @@ -17,8 +17,6 @@ package bisq.wallets.regtest.process; -import bisq.wallets.core.exceptions.WalletStartupFailedException; -import bisq.wallets.process.BisqProcess; import com.google.common.collect.Lists; import java.util.List; diff --git a/wallets/core/src/main/java/bisq/wallets/core/exceptions/WalletStartupFailedException.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/process/WalletStartupFailedException.java similarity index 95% rename from wallets/core/src/main/java/bisq/wallets/core/exceptions/WalletStartupFailedException.java rename to wallets/regtest/src/main/java/bisq/wallets/regtest/process/WalletStartupFailedException.java index d064ee8a1d..77fbbedc2d 100644 --- a/wallets/core/src/main/java/bisq/wallets/core/exceptions/WalletStartupFailedException.java +++ b/wallets/regtest/src/main/java/bisq/wallets/regtest/process/WalletStartupFailedException.java @@ -15,7 +15,7 @@ * along with Bisq. If not, see . */ -package bisq.wallets.core.exceptions; +package bisq.wallets.regtest.process; public class WalletStartupFailedException extends RuntimeException { public WalletStartupFailedException(String message, Throwable cause) { From 2e3eba2a8434015c8a828d7a537aeff60dcf285d Mon Sep 17 00:00:00 2001 From: Alva Swanson Date: Wed, 4 Sep 2024 14:21:10 +0000 Subject: [PATCH 3/5] Move CannotStartProcessException to wallets.regtest module --- .../wallets/regtest}/process/CannotStartProcessException.java | 2 +- .../main/java/bisq/wallets/regtest/process/DaemonProcess.java | 1 - .../main/java/bisq/wallets/regtest}/process/ProcessConfig.java | 0 3 files changed, 1 insertion(+), 2 deletions(-) rename wallets/{process/src/main/java/bisq/wallets => regtest/src/main/java/bisq/wallets/regtest}/process/CannotStartProcessException.java (95%) rename wallets/{process/src/main/java/bisq/wallets => regtest/src/main/java/bisq/wallets/regtest}/process/ProcessConfig.java (100%) diff --git a/wallets/process/src/main/java/bisq/wallets/process/CannotStartProcessException.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/process/CannotStartProcessException.java similarity index 95% rename from wallets/process/src/main/java/bisq/wallets/process/CannotStartProcessException.java rename to wallets/regtest/src/main/java/bisq/wallets/regtest/process/CannotStartProcessException.java index b9ba9546aa..0d8bc4ef7c 100644 --- a/wallets/process/src/main/java/bisq/wallets/process/CannotStartProcessException.java +++ b/wallets/regtest/src/main/java/bisq/wallets/regtest/process/CannotStartProcessException.java @@ -15,7 +15,7 @@ * along with Bisq. If not, see . */ -package bisq.wallets.process; +package bisq.wallets.regtest.process; public class CannotStartProcessException extends RuntimeException { public CannotStartProcessException(String message, Throwable cause) { diff --git a/wallets/regtest/src/main/java/bisq/wallets/regtest/process/DaemonProcess.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/process/DaemonProcess.java index cca19adbf6..46aabdc08f 100644 --- a/wallets/regtest/src/main/java/bisq/wallets/regtest/process/DaemonProcess.java +++ b/wallets/regtest/src/main/java/bisq/wallets/regtest/process/DaemonProcess.java @@ -19,7 +19,6 @@ import bisq.common.file.FileUtils; import bisq.common.file.LogScanner; -import bisq.wallets.process.CannotStartProcessException; import bisq.wallets.process.ProcessConfig; import lombok.Getter; import lombok.extern.slf4j.Slf4j; diff --git a/wallets/process/src/main/java/bisq/wallets/process/ProcessConfig.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/process/ProcessConfig.java similarity index 100% rename from wallets/process/src/main/java/bisq/wallets/process/ProcessConfig.java rename to wallets/regtest/src/main/java/bisq/wallets/regtest/process/ProcessConfig.java From e48f41cbb6b1c46bda82c2390b3e50c6ef3f9dbf Mon Sep 17 00:00:00 2001 From: Alva Swanson Date: Wed, 4 Sep 2024 14:26:33 +0000 Subject: [PATCH 4/5] Move ProcessConfig to wallets.regtest module --- .../regtest/electrumx/ElectrumXServerRegtestProcess.java | 2 +- .../main/java/bisq/wallets/electrum/ElectrumRegtestProcess.java | 2 +- .../bisq/wallets/elementsd/regtest/ElementsdRegtestProcess.java | 2 +- .../bisq/wallets/regtest/bitcoind/BitcoindRegtestProcess.java | 2 +- .../main/java/bisq/wallets/regtest/process/DaemonProcess.java | 1 - .../main/java/bisq/wallets/regtest/process/ProcessConfig.java | 2 +- 6 files changed, 5 insertions(+), 6 deletions(-) diff --git a/wallets/electrum/src/integrationTest/java/bisq/wallets/electrum/regtest/electrumx/ElectrumXServerRegtestProcess.java b/wallets/electrum/src/integrationTest/java/bisq/wallets/electrum/regtest/electrumx/ElectrumXServerRegtestProcess.java index dcfb4e8412..721a73aa8c 100644 --- a/wallets/electrum/src/integrationTest/java/bisq/wallets/electrum/regtest/electrumx/ElectrumXServerRegtestProcess.java +++ b/wallets/electrum/src/integrationTest/java/bisq/wallets/electrum/regtest/electrumx/ElectrumXServerRegtestProcess.java @@ -21,7 +21,7 @@ import bisq.common.file.LogScanner; import bisq.wallets.json_rpc.RpcConfig; import bisq.wallets.regtest.process.DaemonProcess; -import bisq.wallets.process.ProcessConfig; +import bisq.wallets.regtest.process.ProcessConfig; import lombok.extern.slf4j.Slf4j; import java.util.Collections; diff --git a/wallets/electrum/src/main/java/bisq/wallets/electrum/ElectrumRegtestProcess.java b/wallets/electrum/src/main/java/bisq/wallets/electrum/ElectrumRegtestProcess.java index c8906b5ff9..a904ffbfb8 100644 --- a/wallets/electrum/src/main/java/bisq/wallets/electrum/ElectrumRegtestProcess.java +++ b/wallets/electrum/src/main/java/bisq/wallets/electrum/ElectrumRegtestProcess.java @@ -26,8 +26,8 @@ import bisq.wallets.json_rpc.JsonRpcClient; import bisq.wallets.json_rpc.RpcClientFactory; import bisq.wallets.json_rpc.RpcConfig; -import bisq.wallets.process.ProcessConfig; import bisq.wallets.regtest.process.DaemonProcess; +import bisq.wallets.regtest.process.ProcessConfig; import com.fasterxml.jackson.databind.ObjectMapper; import lombok.Getter; import lombok.extern.slf4j.Slf4j; diff --git a/wallets/elementsd/src/integrationTest/java/bisq/wallets/elementsd/regtest/ElementsdRegtestProcess.java b/wallets/elementsd/src/integrationTest/java/bisq/wallets/elementsd/regtest/ElementsdRegtestProcess.java index 59ea561bcf..6c36cdbf4c 100644 --- a/wallets/elementsd/src/integrationTest/java/bisq/wallets/elementsd/regtest/ElementsdRegtestProcess.java +++ b/wallets/elementsd/src/integrationTest/java/bisq/wallets/elementsd/regtest/ElementsdRegtestProcess.java @@ -24,7 +24,7 @@ import bisq.wallets.elementsd.ElementsdConfig; import bisq.wallets.elementsd.rpc.ElementsdDaemon; import bisq.wallets.json_rpc.JsonRpcClient; -import bisq.wallets.process.ProcessConfig; +import bisq.wallets.regtest.process.ProcessConfig; import bisq.wallets.regtest.bitcoind.BitcoindRegtestProcess; import lombok.extern.slf4j.Slf4j; diff --git a/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/BitcoindRegtestProcess.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/BitcoindRegtestProcess.java index 7cc45b3b44..30b2a325d1 100644 --- a/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/BitcoindRegtestProcess.java +++ b/wallets/regtest/src/main/java/bisq/wallets/regtest/bitcoind/BitcoindRegtestProcess.java @@ -24,7 +24,7 @@ import bisq.wallets.json_rpc.RpcClientFactory; import bisq.wallets.json_rpc.RpcConfig; import bisq.wallets.regtest.process.DaemonProcess; -import bisq.wallets.process.ProcessConfig; +import bisq.wallets.regtest.process.ProcessConfig; import lombok.Getter; import lombok.extern.slf4j.Slf4j; diff --git a/wallets/regtest/src/main/java/bisq/wallets/regtest/process/DaemonProcess.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/process/DaemonProcess.java index 46aabdc08f..02bc71039f 100644 --- a/wallets/regtest/src/main/java/bisq/wallets/regtest/process/DaemonProcess.java +++ b/wallets/regtest/src/main/java/bisq/wallets/regtest/process/DaemonProcess.java @@ -19,7 +19,6 @@ import bisq.common.file.FileUtils; import bisq.common.file.LogScanner; -import bisq.wallets.process.ProcessConfig; import lombok.Getter; import lombok.extern.slf4j.Slf4j; diff --git a/wallets/regtest/src/main/java/bisq/wallets/regtest/process/ProcessConfig.java b/wallets/regtest/src/main/java/bisq/wallets/regtest/process/ProcessConfig.java index 5aea5c25ed..325f45b6d9 100644 --- a/wallets/regtest/src/main/java/bisq/wallets/regtest/process/ProcessConfig.java +++ b/wallets/regtest/src/main/java/bisq/wallets/regtest/process/ProcessConfig.java @@ -15,7 +15,7 @@ * along with Bisq. If not, see . */ -package bisq.wallets.process; +package bisq.wallets.regtest.process; import lombok.Builder; import lombok.EqualsAndHashCode; From 40e63d67cd3563450d1a55884111c5dd48f55e79 Mon Sep 17 00:00:00 2001 From: Alva Swanson Date: Wed, 4 Sep 2024 14:28:47 +0000 Subject: [PATCH 5/5] regtest: Remove dependency to process module --- wallets/regtest/build.gradle.kts | 3 --- 1 file changed, 3 deletions(-) diff --git a/wallets/regtest/build.gradle.kts b/wallets/regtest/build.gradle.kts index 6058cc84de..3590f4624e 100644 --- a/wallets/regtest/build.gradle.kts +++ b/wallets/regtest/build.gradle.kts @@ -19,9 +19,6 @@ dependencies { implementation(project(":core")) implementation(project(":bitcoind")) implementation(project(":json-rpc")) - implementation(project(":process")) - - api(project(":process")) implementation(libs.assertj.core) implementation(libs.junit.jupiter)