forked from bisq-network/bisq2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
16 changed files
with
78 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
wallets/regtest/src/main/java/bisq/wallets/regtest/Os.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters