rename all packages and other names from bisq to haveno

This commit is contained in:
woodser 2023-03-06 19:14:00 -05:00
parent ab0b9e3b77
commit 1a1fb130c0
1775 changed files with 14575 additions and 16767 deletions

2
.gitignore vendored
View File

@ -3,7 +3,7 @@ bin/
*/log
*/out
.idea
!.idea/copyright/bisq_Affero_GPLv3.xml
!.idea/copyright/haveno_Affero_GPLv3.xml
!.idea/copyright/profiles_settings.xml
!.idea/codeStyleSettings.xml
*.iml

View File

@ -1,6 +1,6 @@
import sys, os, json
# Writes a Bisq json F2F payment account form for the given country_code to the current working directory.
# Writes a Haveno json F2F payment account form for the given country_code to the current working directory.
if len(sys.argv) < 2:
print("usage: editf2faccountform.py country_code")

View File

@ -8,14 +8,14 @@
#
# - Linux or OSX with bash, Java 11-15 (JDK language compatibility 11), and bitcoin-core (v0.19 - v22).
#
# - Bisq must be fully built with apitest dao setup files installed.
# - Haveno must be fully built with apitest dao setup files installed.
# Build command: `./gradlew clean build :apitest:installDaoSetup`
#
# - All supporting nodes must be run locally, in dev/dao/regtest mode:
# bitcoind, seednode, arbdaemon, alicedaemon, bobdaemon
#
# These should be run using the apitest harness. From the root project dir, run:
# `$ ./bisq-apitest --apiPassword=xyz --supportingApps=bitcoind,seednode,arbdaemon,alicedaemon,bobdaemon --shutdownAfterTests=false`
# `$ ./haveno-apitest --apiPassword=xyz --supportingApps=bitcoind,seednode,arbdaemon,alicedaemon,bobdaemon --shutdownAfterTests=false`
#
# - Only regtest btc can be bought or sold with the test payment account.
#

View File

@ -1,13 +1,13 @@
#!/usr/bin/env bats
#
# Smoke tests for bisq-cli running against a live bisq-daemon (on mainnet)
# Smoke tests for haveno-cli running against a live haveno-daemon (on mainnet)
#
# Prerequisites:
#
# - bats-core 1.2.0+ must be installed (brew install bats-core on macOS)
# see https://github.com/bats-core/bats-core
#
# - Run `./bisq-daemon --apiPassword=xyz --appDataDir=$TESTDIR` where $TESTDIR
# - Run `./haveno-daemon --apiPassword=xyz --appDataDir=$TESTDIR` where $TESTDIR
# is empty or otherwise contains an unencrypted wallet with a 0 BTC balance
#
# Usage:
@ -17,28 +17,28 @@
# bats apitest/scripts/mainnet-test.sh
@test "test unsupported method error" {
run ./bisq-cli --password=xyz bogus
run ./haveno-cli --password=xyz bogus
[ "$status" -eq 1 ]
echo "actual output: $output" >&2 # printed only on test failure
[ "$output" = "Error: 'bogus' is not a supported method" ]
}
@test "test unrecognized option error" {
run ./bisq-cli --bogus getversion
run ./haveno-cli --bogus getversion
[ "$status" -eq 1 ]
echo "actual output: $output" >&2
[ "$output" = "Error: missing required 'password' option" ]
}
@test "test missing required password option error" {
run ./bisq-cli getversion
run ./haveno-cli getversion
[ "$status" -eq 1 ]
echo "actual output: $output" >&2
[ "$output" = "Error: missing required 'password' option" ]
}
@test "test incorrect password error" {
run ./bisq-cli --password=bogus getversion
run ./haveno-cli --password=bogus getversion
[ "$status" -eq 1 ]
echo "actual output: $output" >&2
[ "$output" = "Error: incorrect 'password' rpc header value" ]
@ -46,7 +46,7 @@
@test "test getversion call with quoted password" {
load 'version-parser'
run ./bisq-cli --password="xyz" getversion
run ./haveno-cli --password="xyz" getversion
[ "$status" -eq 0 ]
echo "actual output: $output" >&2
[ "$output" = "$CURRENT_VERSION" ]
@ -56,14 +56,14 @@
# Wait 1 second before calling getversion again.
sleep 1
load 'version-parser'
run ./bisq-cli --password=xyz getversion
run ./haveno-cli --password=xyz getversion
[ "$status" -eq 0 ]
echo "actual output: $output" >&2
[ "$output" = "$CURRENT_VERSION" ]
}
@test "test setwalletpassword \"a b c\"" {
run ./bisq-cli --password=xyz setwalletpassword --wallet-password="a b c"
run ./haveno-cli --password=xyz setwalletpassword --wallet-password="a b c"
[ "$status" -eq 0 ]
echo "actual output: $output" >&2
[ "$output" = "wallet encrypted" ]
@ -71,14 +71,14 @@
}
@test "test unlockwallet without password & timeout args" {
run ./bisq-cli --password=xyz unlockwallet
run ./haveno-cli --password=xyz unlockwallet
[ "$status" -eq 1 ]
echo "actual output: $output" >&2
[ "$output" = "Error: no password specified" ]
}
@test "test unlockwallet without timeout arg" {
run ./bisq-cli --password=xyz unlockwallet --wallet-password="a b c"
run ./haveno-cli --password=xyz unlockwallet --wallet-password="a b c"
[ "$status" -eq 1 ]
echo "actual output: $output" >&2
[ "$output" = "Error: no unlock timeout specified" ]
@ -86,34 +86,34 @@
@test "test unlockwallet \"a b c\" 8" {
run ./bisq-cli --password=xyz unlockwallet --wallet-password="a b c" --timeout=8
run ./haveno-cli --password=xyz unlockwallet --wallet-password="a b c" --timeout=8
[ "$status" -eq 0 ]
echo "actual output: $output" >&2
[ "$output" = "wallet unlocked" ]
}
@test "test getbalance while wallet unlocked for 8s" {
run ./bisq-cli --password=xyz getbalance
run ./haveno-cli --password=xyz getbalance
[ "$status" -eq 0 ]
sleep 8
}
@test "test unlockwallet \"a b c\" 6" {
run ./bisq-cli --password=xyz unlockwallet --wallet-password="a b c" --timeout=6
run ./haveno-cli --password=xyz unlockwallet --wallet-password="a b c" --timeout=6
[ "$status" -eq 0 ]
echo "actual output: $output" >&2
[ "$output" = "wallet unlocked" ]
}
@test "test lockwallet before unlockwallet timeout=6s expires" {
run ./bisq-cli --password=xyz lockwallet
run ./haveno-cli --password=xyz lockwallet
[ "$status" -eq 0 ]
echo "actual output: $output" >&2
[ "$output" = "wallet locked" ]
}
@test "test setwalletpassword incorrect old pwd error" {
run ./bisq-cli --password=xyz setwalletpassword --wallet-password="z z z" --new-wallet-password="d e f"
run ./haveno-cli --password=xyz setwalletpassword --wallet-password="z z z" --new-wallet-password="d e f"
[ "$status" -eq 1 ]
echo "actual output: $output" >&2
[ "$output" = "Error: incorrect old password" ]
@ -122,7 +122,7 @@
@test "test setwalletpassword oldpwd newpwd" {
# Wait 5 seconds before calling setwalletpassword again.
sleep 5
run ./bisq-cli --password=xyz setwalletpassword --wallet-password="a b c" --new-wallet-password="d e f"
run ./haveno-cli --password=xyz setwalletpassword --wallet-password="a b c" --new-wallet-password="d e f"
[ "$status" -eq 0 ]
echo "actual output: $output" >&2
[ "$output" = "wallet encrypted with new password" ]
@ -130,14 +130,14 @@
}
@test "test getbalance wallet locked error" {
run ./bisq-cli --password=xyz getbalance
run ./haveno-cli --password=xyz getbalance
[ "$status" -eq 1 ]
echo "actual output: $output" >&2
[ "$output" = "Error: wallet is locked" ]
}
@test "test removewalletpassword" {
run ./bisq-cli --password=xyz removewalletpassword --wallet-password="d e f"
run ./haveno-cli --password=xyz removewalletpassword --wallet-password="d e f"
[ "$status" -eq 0 ]
echo "actual output: $output" >&2
[ "$output" = "wallet decrypted" ]
@ -145,17 +145,17 @@
}
@test "test getbalance when wallet available & unlocked with 0 btc balance" {
run ./bisq-cli --password=xyz getbalance
run ./haveno-cli --password=xyz getbalance
[ "$status" -eq 0 ]
}
@test "test getfundingaddresses" {
run ./bisq-cli --password=xyz getfundingaddresses
run ./haveno-cli --password=xyz getfundingaddresses
[ "$status" -eq 0 ]
}
@test "test getaddressbalance missing address argument" {
run ./bisq-cli --password=xyz getaddressbalance
run ./haveno-cli --password=xyz getaddressbalance
[ "$status" -eq 1 ]
echo "actual output: $output" >&2
[ "$output" = "Error: no address specified" ]
@ -164,24 +164,24 @@
@test "test getaddressbalance bogus address argument" {
# Wait 1 second before calling getaddressbalance again.
sleep 1
run ./bisq-cli --password=xyz getaddressbalance --address=bogus
run ./haveno-cli --password=xyz getaddressbalance --address=bogus
[ "$status" -eq 1 ]
echo "actual output: $output" >&2
[ "$output" = "Error: address bogus not found in wallet" ]
}
@test "test getpaymentmethods" {
run ./bisq-cli --password=xyz getpaymentmethods
run ./haveno-cli --password=xyz getpaymentmethods
[ "$status" -eq 0 ]
}
@test "test getpaymentaccts" {
run ./bisq-cli --password=xyz getpaymentaccts
run ./haveno-cli --password=xyz getpaymentaccts
[ "$status" -eq 0 ]
}
@test "test getoffers missing direction argument" {
run ./bisq-cli --password=xyz getoffers
run ./haveno-cli --password=xyz getoffers
[ "$status" -eq 1 ]
echo "actual output: $output" >&2
[ "$output" = "Error: no direction (buy|sell) specified" ]
@ -190,42 +190,42 @@
@test "test getoffers sell eur check return status" {
# Wait 1 second before calling getoffers again.
sleep 1
run ./bisq-cli --password=xyz getoffers --direction=sell --currency-code=eur
run ./haveno-cli --password=xyz getoffers --direction=sell --currency-code=eur
[ "$status" -eq 0 ]
}
@test "test getoffers buy eur check return status" {
# Wait 1 second before calling getoffers again.
sleep 1
run ./bisq-cli --password=xyz getoffers --direction=buy --currency-code=eur
run ./haveno-cli --password=xyz getoffers --direction=buy --currency-code=eur
[ "$status" -eq 0 ]
}
@test "test getoffers sell gbp check return status" {
# Wait 1 second before calling getoffers again.
sleep 1
run ./bisq-cli --password=xyz getoffers --direction=sell --currency-code=gbp
run ./haveno-cli --password=xyz getoffers --direction=sell --currency-code=gbp
[ "$status" -eq 0 ]
}
@test "test help displayed on stderr if no options or arguments" {
run ./bisq-cli
run ./haveno-cli
[ "$status" -eq 1 ]
[ "${lines[0]}" = "Bisq RPC Client" ]
[ "${lines[1]}" = "Usage: bisq-cli [options] <method> [params]" ]
[ "${lines[0]}" = "Haveno RPC Client" ]
[ "${lines[1]}" = "Usage: haveno-cli [options] <method> [params]" ]
# TODO add asserts after help text is modified for new endpoints
}
@test "test --help option" {
run ./bisq-cli --help
run ./haveno-cli --help
[ "$status" -eq 0 ]
[ "${lines[0]}" = "Bisq RPC Client" ]
[ "${lines[1]}" = "Usage: bisq-cli [options] <method> [params]" ]
[ "${lines[0]}" = "Haveno RPC Client" ]
[ "${lines[1]}" = "Usage: haveno-cli [options] <method> [params]" ]
# TODO add asserts after help text is modified for new endpoints
}
@test "test takeoffer method --help" {
run ./bisq-cli --password=xyz takeoffer --help
run ./haveno-cli --password=xyz takeoffer --help
[ "$status" -eq 0 ]
[ "${lines[0]}" = "takeoffer" ]
}

View File

@ -12,14 +12,14 @@
#
# - Linux or OSX with bash, Java 11-15 (JDK language compatibility 11), and bitcoin-core (v0.19 - v22).
#
# - Bisq must be fully built with apitest dao setup files installed.
# - Haveno must be fully built with apitest dao setup files installed.
# Build command: `./gradlew clean build :apitest:installDaoSetup`
#
# - All supporting nodes must be run locally, in dev/dao/regtest mode:
# bitcoind, seednode, arbdaemon, alicedaemon, bobdaemon
#
# These should be run using the apitest harness. From the root project dir, run:
# `$ ./bisq-apitest --apiPassword=xyz --supportingApps=bitcoind,seednode,arbdaemon,alicedaemon,bobdaemon --shutdownAfterTests=false`
# `$ ./haveno-apitest --apiPassword=xyz --supportingApps=bitcoind,seednode,arbdaemon,alicedaemon,bobdaemon --shutdownAfterTests=false`
#
# - Only regtest btc can be bought or sold with the test payment account.
#

View File

@ -2,7 +2,7 @@
# This file must be sourced by the main driver.
export CLI_BASE="./bisq-cli --password=xyz"
export CLI_BASE="./haveno-cli --password=xyz"
export ARBITRATOR_PORT=9997
export ALICE_PORT=9998
export BOB_PORT=9999
@ -38,7 +38,7 @@ checksetup() {
echo "Bob & Alice daemons, and bitcoin-core's bitcoin-cli must be in the system PATH."
echo ""
echo "From the project's root dir, start all supporting nodes from a terminal:"
echo "./bisq-apitest --apiPassword=xyz --supportingApps=bitcoind,seednode,arbdaemon,alicedaemon,bobdaemon --shutdownAfterTests=false"
echo "./haveno-apitest --apiPassword=xyz --supportingApps=bitcoind,seednode,arbdaemon,alicedaemon,bobdaemon --shutdownAfterTests=false"
exit 1;
}
printdate "Checking $APP_HOME for some expected directories and files."
@ -48,16 +48,16 @@ checksetup() {
printdate "Error: Subproject apitest not found, maybe because you are not running the script from the project root dir."
exit 1
fi
if [ -f "$APP_HOME/bisq-cli" ]; then
printdate "The bisq-cli script exists.";
if [ -f "$APP_HOME/haveno-cli" ]; then
printdate "The haveno-cli script exists.";
else
printdate "Error: The bisq-cli script not found, maybe because you are not running the script from the project root dir."
printdate "Error: The haveno-cli script not found, maybe because you are not running the script from the project root dir."
exit 1
fi
printdate "Checking to see local bitcoind is running, and bitcoin-cli is in PATH."
checkbitcoindrunning
checkbitcoincliinpath
printdate "Checking to see bisq servers are running."
printdate "Checking to see haveno servers are running."
checkseednoderunning
checkarbnoderunning
checkalicenoderunning
@ -205,7 +205,7 @@ checkbitcoincliinpath() {
checkseednoderunning() {
if [[ "$LINUX" == "TRUE" ]]; then
if pgrep -f "bisq.seednode.SeedNodeMain" > /dev/null ; then
if pgrep -f "haveno.seednode.SeedNodeMain" > /dev/null ; then
printdate "The seed node is running on host."
else
printdate "Error: seed node is not running on host, exiting."
@ -226,14 +226,14 @@ checkseednoderunning() {
checkarbnoderunning() {
if [[ "$LINUX" == "TRUE" ]]; then
if pgrep -f "bisq.daemon.app.HavenoDaemonMain --appName=bisq-XMR_STAGENET_Arb" > /dev/null ; then
if pgrep -f "haveno.daemon.app.HavenoDaemonMain --appName=haveno-XMR_STAGENET_Arb" > /dev/null ; then
printdate "The arbitration node is running on host."
else
printdate "Error: arbitration node is not running on host, exiting."
apitestusage
fi
elif [[ "$DARWIN" == "TRUE" ]]; then
if ps -A | awk '/[b]isq.daemon.app.HavenoDaemonMain --appName=bisq-XMR_STAGENET_Arb/ {print $1}' > /dev/null ; then
if ps -A | awk '/[b]isq.daemon.app.HavenoDaemonMain --appName=haveno-XMR_STAGENET_Arb/ {print $1}' > /dev/null ; then
printdate "The arbitration node is running on host."
else
printdate "Error: arbitration node is not running on host, exiting."
@ -247,14 +247,14 @@ checkarbnoderunning() {
checkalicenoderunning() {
if [[ "$LINUX" == "TRUE" ]]; then
if pgrep -f "bisq.daemon.app.HavenoDaemonMain --appName=bisq-XMR_STAGENET_Alice" > /dev/null ; then
if pgrep -f "haveno.daemon.app.HavenoDaemonMain --appName=haveno-XMR_STAGENET_Alice" > /dev/null ; then
printdate "Alice's node is running on host."
else
printdate "Error: Alice's node is not running on host, exiting."
apitestusage
fi
elif [[ "$DARWIN" == "TRUE" ]]; then
if ps -A | awk '/[b]isq.daemon.app.HavenoDaemonMain --appName=bisq-XMR_STAGENET_Alice/ {print $1}' > /dev/null ; then
if ps -A | awk '/[b]isq.daemon.app.HavenoDaemonMain --appName=haveno-XMR_STAGENET_Alice/ {print $1}' > /dev/null ; then
printdate "Alice's node node is running on host."
else
printdate "Error: Alice's node is not running on host, exiting."
@ -268,14 +268,14 @@ checkalicenoderunning() {
checkbobnoderunning() {
if [[ "$LINUX" == "TRUE" ]]; then
if pgrep -f "bisq.daemon.app.HavenoDaemonMain --appName=bisq-XMR_STAGENET_Alice" > /dev/null ; then
if pgrep -f "haveno.daemon.app.HavenoDaemonMain --appName=haveno-XMR_STAGENET_Alice" > /dev/null ; then
printdate "Bob's node is running on host."
else
printdate "Error: Bob's node is not running on host, exiting."
apitestusage
fi
elif [[ "$DARWIN" == "TRUE" ]]; then
if ps -A | awk '/[b]isq.daemon.app.HavenoDaemonMain --appName=bisq-XMR_STAGENET_Alice/ {print $1}' > /dev/null ; then
if ps -A | awk '/[b]isq.daemon.app.HavenoDaemonMain --appName=haveno-XMR_STAGENET_Alice/ {print $1}' > /dev/null ; then
printdate "Bob's node node is running on host."
else
printdate "Error: Bob's node is not running on host, exiting."

View File

@ -535,7 +535,7 @@ executetrade() {
printbreak
# Complete the trade on both sides
printdate "BOB $BOB_ROLE: Closing trade and keeping funds in Bisq wallet."
printdate "BOB $BOB_ROLE: Closing trade and keeping funds in Haveno wallet."
CMD="$CLI_BASE --port=$BOB_PORT closetrade --trade-id=$OFFER_ID"
printdate "BOB CLI: $CMD"
KEEP_FUNDS_MSG=$($CMD)
@ -545,7 +545,7 @@ executetrade() {
sleeptraced 3
printbreak
printdate "ALICE (taker): Closing trade and keeping funds in Bisq wallet."
printdate "ALICE (taker): Closing trade and keeping funds in Haveno wallet."
CMD="$CLI_BASE --port=$ALICE_PORT closetrade --trade-id=$OFFER_ID"
printdate "ALICE CLI: $CMD"
KEEP_FUNDS_MSG=$($CMD)

View File

@ -9,14 +9,14 @@
#
# - Linux or OSX with bash, Java 11-15 (JDK language compatibility 11), and bitcoin-core (v0.19 - v22).
#
# - Bisq must be fully built with apitest dao setup files installed.
# - Haveno must be fully built with apitest dao setup files installed.
# Build command: `./gradlew clean build :apitest:installDaoSetup`
#
# - All supporting nodes must be run locally, in dev/dao/regtest mode:
# bitcoind, seednode, arbdaemon, alicedaemon, bobdaemon
#
# These should be run using the apitest harness. From the root project dir, run:
# `$ ./bisq-apitest --apiPassword=xyz --supportingApps=bitcoind,seednode,arbdaemon,alicedaemon,bobdaemon --shutdownAfterTests=false`
# `$ ./haveno-apitest --apiPassword=xyz --supportingApps=bitcoind,seednode,arbdaemon,alicedaemon,bobdaemon --shutdownAfterTests=false`
#
# - Only regtest btc can be bought or sold with the test payment account.
#

View File

@ -6,14 +6,14 @@
#
# - Linux or OSX with bash, Java 11-15 (JDK language compatibility 11), and bitcoin-core (v0.19 - v22).
#
# - Bisq must be fully built with apitest dao setup files installed.
# - Haveno must be fully built with apitest dao setup files installed.
# Build command: `./gradlew clean build :apitest:installDaoSetup`
#
# - All supporting nodes must be run locally, in dev/dao/regtest mode:
# bitcoind, seednode, arbdaemon, alicedaemon, bobdaemon
#
# These should be run using the apitest harness. From the root project dir, run:
# `$ ./bisq-apitest --apiPassword=xyz --supportingApps=bitcoind,seednode,arbdaemon,alicedaemon,bobdaemon --shutdownAfterTests=false`
# `$ ./haveno-apitest --apiPassword=xyz --supportingApps=bitcoind,seednode,arbdaemon,alicedaemon,bobdaemon --shutdownAfterTests=false`
#
# Usage:
#

View File

@ -2,4 +2,4 @@
# Bats helper script for parsing current version from Version.java.
export CURRENT_VERSION=$(grep "String VERSION =" common/src/main/java/bisq/common/app/Version.java | sed 's/[^0-9.]*//g')
export CURRENT_VERSION=$(grep "String VERSION =" common/src/main/java/haveno/common/app/Version.java | sed 's/[^0-9.]*//g')

View File

@ -15,23 +15,21 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest;
package haveno.apitest;
import java.io.File;
import lombok.extern.slf4j.Slf4j;
import static bisq.apitest.Scaffold.EXIT_FAILURE;
import static bisq.apitest.Scaffold.EXIT_SUCCESS;
import static bisq.apitest.config.ApiTestRateMeterInterceptorConfig.appendCallRateMeteringConfigPathOpt;
import static bisq.apitest.config.ApiTestRateMeterInterceptorConfig.getTestRateMeterInterceptorConfig;
import static bisq.apitest.config.ApiTestRateMeterInterceptorConfig.hasCallRateMeteringConfigPathOpt;
import static haveno.apitest.Scaffold.EXIT_FAILURE;
import static haveno.apitest.Scaffold.EXIT_SUCCESS;
import static haveno.apitest.config.ApiTestRateMeterInterceptorConfig.appendCallRateMeteringConfigPathOpt;
import static haveno.apitest.config.ApiTestRateMeterInterceptorConfig.getTestRateMeterInterceptorConfig;
import static haveno.apitest.config.ApiTestRateMeterInterceptorConfig.hasCallRateMeteringConfigPathOpt;
import static java.lang.System.err;
import static java.lang.System.exit;
import bisq.apitest.config.ApiTestConfig;
import haveno.apitest.config.ApiTestConfig;
/**
* ApiTestMain is a placeholder for the gradle build file, which requires a valid
@ -39,12 +37,12 @@ import bisq.apitest.config.ApiTestConfig;
*
* It has some uses:
*
* It can be used to print test scaffolding options: bisq-apitest --help.
* It can be used to print test scaffolding options: haveno-apitest --help.
*
* It can be used to smoke test your bitcoind environment: bisq-apitest.
* It can be used to smoke test your bitcoind environment: haveno-apitest.
*
* It can be used to run the regtest environment for release testing:
* bisq-test --shutdownAfterTests=false
* haveno-test --shutdownAfterTests=false
*
* All method, scenario and end-to-end tests are found in the test sources folder.
*
@ -81,7 +79,7 @@ public class ApiTestMain {
} catch (Throwable ex) {
err.println("Fault: An unexpected error occurred. " +
"Please file a report at https://bisq.network/issues");
"Please file a report at https://haveno.network/issues");
ex.printStackTrace(err);
exit(EXIT_FAILURE);
}

View File

@ -15,11 +15,17 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest;
import bisq.common.config.HavenoHelpFormatter;
import bisq.common.util.Utilities;
package haveno.apitest;
import haveno.apitest.config.ApiTestConfig;
import haveno.apitest.config.HavenoAppConfig;
import haveno.apitest.linux.BashCommand;
import haveno.apitest.linux.BitcoinDaemon;
import haveno.apitest.linux.HavenoProcess;
import haveno.apitest.linux.LinuxProcess;
import haveno.cli.GrpcClient;
import haveno.common.config.HavenoHelpFormatter;
import haveno.common.util.Utilities;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
@ -41,11 +47,11 @@ import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static bisq.apitest.config.ApiTestConfig.MEDIATOR;
import static bisq.apitest.config.ApiTestConfig.REFUND_AGENT;
import static bisq.apitest.config.HavenoAppConfig.*;
import static bisq.common.app.DevEnv.DEV_PRIVILEGE_PRIV_KEY;
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static haveno.apitest.config.ApiTestConfig.MEDIATOR;
import static haveno.apitest.config.ApiTestConfig.REFUND_AGENT;
import static haveno.apitest.config.HavenoAppConfig.*;
import static haveno.common.app.DevEnv.DEV_PRIVILEGE_PRIV_KEY;
import static java.lang.String.format;
import static java.lang.System.exit;
import static java.lang.System.out;
@ -54,16 +60,6 @@ import static java.nio.file.StandardCopyOption.REPLACE_EXISTING;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.SECONDS;
import bisq.apitest.config.ApiTestConfig;
import bisq.apitest.config.HavenoAppConfig;
import bisq.apitest.linux.BashCommand;
import bisq.apitest.linux.HavenoProcess;
import bisq.apitest.linux.BitcoinDaemon;
import bisq.apitest.linux.LinuxProcess;
import bisq.cli.GrpcClient;
@Slf4j
public class Scaffold {
@ -130,8 +126,8 @@ public class Scaffold {
if (config.helpRequested) {
config.printHelp(out,
new HavenoHelpFormatter(
"Bisq ApiTest",
"bisq-apitest",
"Haveno ApiTest",
"haveno-apitest",
"0.1.0"));
exit(EXIT_SUCCESS);
}
@ -249,7 +245,7 @@ public class Scaffold {
Runtime.getRuntime().addShutdownHook(new Thread(this::tearDown));
}
// Starts bitcoind and bisq apps (seednode, arbnode, etc...)
// Starts bitcoind and haveno apps (seednode, arbnode, etc...)
private void startBackgroundProcesses(ExecutorService executor,
CountDownLatch countdownLatch)
throws InterruptedException, IOException {
@ -261,7 +257,7 @@ public class Scaffold {
bitcoinDaemon.verifyBitcoinPathsExist(true);
bitcoindTask = new SetupTask(bitcoinDaemon, countdownLatch);
bitcoindTaskFuture = executor.submit(bitcoindTask);
MILLISECONDS.sleep(config.bisqAppInitTime);
MILLISECONDS.sleep(config.havenoAppInitTime);
LinuxProcess bitcoindProcess = bitcoindTask.getLinuxProcess();
if (bitcoindProcess.hasStartupExceptions()) {
@ -272,28 +268,28 @@ public class Scaffold {
bitcoinDaemon.verifyBitcoindRunning();
}
// Start Bisq apps defined by the supportingApps option, in the in proper order.
// Start Haveno apps defined by the supportingApps option, in the in proper order.
if (config.hasSupportingApp(seednode.name()))
startBisqApp(seednode, executor, countdownLatch);
startHavenoApp(seednode, executor, countdownLatch);
if (config.hasSupportingApp(arbdaemon.name()))
startBisqApp(arbdaemon, executor, countdownLatch);
startHavenoApp(arbdaemon, executor, countdownLatch);
else if (config.hasSupportingApp(arbdesktop.name()))
startBisqApp(arbdesktop, executor, countdownLatch);
startHavenoApp(arbdesktop, executor, countdownLatch);
if (config.hasSupportingApp(alicedaemon.name()))
startBisqApp(alicedaemon, executor, countdownLatch);
startHavenoApp(alicedaemon, executor, countdownLatch);
else if (config.hasSupportingApp(alicedesktop.name()))
startBisqApp(alicedesktop, executor, countdownLatch);
startHavenoApp(alicedesktop, executor, countdownLatch);
if (config.hasSupportingApp(bobdaemon.name()))
startBisqApp(bobdaemon, executor, countdownLatch);
startHavenoApp(bobdaemon, executor, countdownLatch);
else if (config.hasSupportingApp(bobdesktop.name()))
startBisqApp(bobdesktop, executor, countdownLatch);
startHavenoApp(bobdesktop, executor, countdownLatch);
}
private void startBisqApp(HavenoAppConfig HavenoAppConfig,
private void startHavenoApp(HavenoAppConfig HavenoAppConfig,
ExecutorService executor,
CountDownLatch countdownLatch)
throws IOException, InterruptedException {
@ -322,8 +318,8 @@ public class Scaffold {
default:
throw new IllegalStateException("Unknown HavenoAppConfig " + HavenoAppConfig.name());
}
log.info("Giving {} ms for {} to initialize ...", config.bisqAppInitTime, HavenoAppConfig.appName);
MILLISECONDS.sleep(config.bisqAppInitTime);
log.info("Giving {} ms for {} to initialize ...", config.havenoAppInitTime, HavenoAppConfig.appName);
MILLISECONDS.sleep(config.havenoAppInitTime);
if (HavenoProcess.hasStartupExceptions()) {
HavenoProcess.logExceptions(HavenoProcess.getStartupExceptions(), log);
throw new IllegalStateException(HavenoProcess.getStartupExceptions().get(0));

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest;
package haveno.apitest;
import java.time.LocalDateTime;
@ -28,9 +28,7 @@ import lombok.extern.slf4j.Slf4j;
import static java.lang.String.format;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import bisq.apitest.linux.LinuxProcess;
import haveno.apitest.linux.LinuxProcess;
@Slf4j
public class SetupTask implements Callable<SetupTask.Status> {

View File

@ -15,16 +15,13 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest;
package haveno.apitest;
import haveno.apitest.linux.BashCommand;
import java.io.IOException;
import lombok.extern.slf4j.Slf4j;
import bisq.apitest.linux.BashCommand;
@Slf4j
class SmokeTestBashCommand {

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest;
package haveno.apitest;
import java.io.IOException;
@ -23,10 +23,8 @@ import lombok.extern.slf4j.Slf4j;
import static java.lang.String.format;
import bisq.apitest.config.ApiTestConfig;
import bisq.apitest.linux.BitcoinCli;
import haveno.apitest.config.ApiTestConfig;
import haveno.apitest.linux.BitcoinCli;
@Slf4j
class SmokeTestBitcoind {

View File

@ -15,9 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.config;
import bisq.common.config.CompositeOptionSet;
package haveno.apitest.config;
import joptsimple.AbstractOptionSpec;
import joptsimple.ArgumentAcceptingOptionSpec;
@ -51,6 +49,8 @@ import static java.util.Arrays.asList;
import static java.util.Arrays.stream;
import static joptsimple.internal.Strings.EMPTY;
import haveno.common.config.CompositeOptionSet;
@Slf4j
public class ApiTestConfig {
@ -76,12 +76,12 @@ public class ApiTestConfig {
static final String ROOT_APP_DATA_DIR = "rootAppDataDir";
static final String API_PASSWORD = "apiPassword";
static final String RUN_SUBPROJECT_JARS = "runSubprojectJars";
static final String BISQ_APP_INIT_TIME = "bisqAppInitTime";
static final String HAVENO_APP_INIT_TIME = "havenoAppInitTime";
static final String SKIP_TESTS = "skipTests";
static final String SHUTDOWN_AFTER_TESTS = "shutdownAfterTests";
static final String SUPPORTING_APPS = "supportingApps";
static final String CALL_RATE_METERING_CONFIG_PATH = "callRateMeteringConfigPath";
static final String ENABLE_BISQ_DEBUGGING = "enableBisqDebugging";
static final String ENABLE_HAVENO_DEBUGGING = "enableHavenoDebugging";
static final String REGISTER_DISPUTE_AGENTS = "registerDisputeAgents";
// Default values for certain options
@ -109,12 +109,12 @@ public class ApiTestConfig {
// Daemon instances can use same gRPC password, but each needs a different apiPort.
public final String apiPassword;
public final boolean runSubprojectJars;
public final long bisqAppInitTime;
public final long havenoAppInitTime;
public final boolean skipTests;
public final boolean shutdownAfterTests;
public final List<String> supportingApps;
public final String callRateMeteringConfigPath;
public final boolean enableBisqDebugging;
public final boolean enableHavenoDebugging;
public final boolean registerDisputeAgents;
// Immutable system configurations set in the constructor.
@ -132,7 +132,7 @@ public class ApiTestConfig {
this.userDir = getProperty("user.dir");
// If running a @Test, the current working directory is the :apitest subproject
// folder. If running ApiTestMain, the current working directory is the
// bisq root project folder.
// haveno root project folder.
this.isRunningTest = Paths.get(userDir).getFileName().toString().equals("apitest");
this.rootProjectDir = isRunningTest
? Paths.get(userDir).getParent().toFile().getAbsolutePath()
@ -213,9 +213,9 @@ public class ApiTestConfig {
.ofType(Boolean.class)
.defaultsTo(false);
ArgumentAcceptingOptionSpec<Long> bisqAppInitTimeOpt =
parser.accepts(BISQ_APP_INIT_TIME,
"Amount of time (ms) to wait on a Bisq instance's initialization")
ArgumentAcceptingOptionSpec<Long> havenoAppInitTimeOpt =
parser.accepts(HAVENO_APP_INIT_TIME,
"Amount of time (ms) to wait on a Haveno instance's initialization")
.withRequiredArg()
.ofType(Long.class)
.defaultsTo(5000L);
@ -247,9 +247,9 @@ public class ApiTestConfig {
.withRequiredArg()
.defaultsTo(EMPTY);
ArgumentAcceptingOptionSpec<Boolean> enableBisqDebuggingOpt =
parser.accepts(ENABLE_BISQ_DEBUGGING,
"Start Bisq apps with remote debug options")
ArgumentAcceptingOptionSpec<Boolean> enableHavenoDebuggingOpt =
parser.accepts(ENABLE_HAVENO_DEBUGGING,
"Start Haveno apps with remote debug options")
.withRequiredArg()
.ofType(Boolean.class)
.defaultsTo(false);
@ -311,12 +311,12 @@ public class ApiTestConfig {
this.bitcoinRpcPassword = options.valueOf(bitcoinRpcPasswordOpt);
this.apiPassword = options.valueOf(apiPasswordOpt);
this.runSubprojectJars = options.valueOf(runSubprojectJarsOpt);
this.bisqAppInitTime = options.valueOf(bisqAppInitTimeOpt);
this.havenoAppInitTime = options.valueOf(havenoAppInitTimeOpt);
this.skipTests = options.valueOf(skipTestsOpt);
this.shutdownAfterTests = options.valueOf(shutdownAfterTestsOpt);
this.supportingApps = asList(options.valueOf(supportingAppsOpt).split(","));
this.callRateMeteringConfigPath = options.valueOf(callRateMeteringConfigPathOpt);
this.enableBisqDebugging = options.valueOf(enableBisqDebuggingOpt);
this.enableHavenoDebugging = options.valueOf(enableHavenoDebuggingOpt);
this.registerDisputeAgents = options.valueOf(registerDisputeAgentsOpt);
// Assign values to special-case static fields.

View File

@ -1,19 +1,17 @@
package bisq.apitest.config;
package haveno.apitest.config;
import java.io.File;
import static bisq.apitest.config.ApiTestConfig.CALL_RATE_METERING_CONFIG_PATH;
import static bisq.proto.grpc.DisputeAgentsGrpc.getRegisterDisputeAgentMethod;
import static bisq.proto.grpc.GetVersionGrpc.getGetVersionMethod;
import static haveno.proto.grpc.DisputeAgentsGrpc.getRegisterDisputeAgentMethod;
import static haveno.proto.grpc.GetVersionGrpc.getGetVersionMethod;
import static haveno.apitest.config.ApiTestConfig.CALL_RATE_METERING_CONFIG_PATH;
import static java.lang.System.arraycopy;
import static java.util.Arrays.stream;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.SECONDS;
import bisq.daemon.grpc.GrpcVersionService;
import bisq.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig;
import haveno.daemon.grpc.GrpcVersionService;
import haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig;
public class ApiTestRateMeterInterceptorConfig {

View File

@ -15,72 +15,68 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.config;
package haveno.apitest.config;
import bisq.seednode.SeedNodeMain;
import bisq.desktop.app.HavenoAppMain;
import bisq.daemon.app.HavenoDaemonMain;
import haveno.daemon.app.HavenoDaemonMain;
import haveno.desktop.app.HavenoAppMain;
import haveno.seednode.SeedNodeMain;
/**
Some non user configurable Bisq seednode, arb node, bob and alice daemon option values.
Some non user configurable Haveno seednode, arb node, bob and alice daemon option values.
@see <a href="https://github.com/bisq-network/bisq/blob/master/docs/dev-setup.md">dev-setup.md</a>
*/
public enum HavenoAppConfig {
seednode("bisq-XMR_STAGENET_Seed_2002",
"bisq-seednode",
seednode("haveno-XMR_STAGENET_Seed_2002",
"haveno-seednode",
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
SeedNodeMain.class.getName(),
2002,
5120,
-1,
49996),
arbdaemon("bisq-XMR_STAGENET_Arb",
"bisq-daemon",
arbdaemon("haveno-XMR_STAGENET_Arb",
"haveno-daemon",
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
HavenoDaemonMain.class.getName(),
4444,
5121,
9997,
49997),
arbdesktop("bisq-XMR_STAGENET_Arb",
"bisq-desktop",
arbdesktop("haveno-XMR_STAGENET_Arb",
"haveno-desktop",
"-XX:MaxRAM=3g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
HavenoAppMain.class.getName(),
4444,
5121,
-1,
49997),
alicedaemon("bisq-XMR_STAGENET_Alice",
"bisq-daemon",
alicedaemon("haveno-XMR_STAGENET_Alice",
"haveno-daemon",
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
HavenoDaemonMain.class.getName(),
7777,
5122,
9998,
49998),
alicedesktop("bisq-XMR_STAGENET_Alice",
"bisq-desktop",
alicedesktop("haveno-XMR_STAGENET_Alice",
"haveno-desktop",
"-XX:MaxRAM=4g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
HavenoAppMain.class.getName(),
7777,
5122,
-1,
49998),
bobdaemon("bisq-XMR_STAGENET_Bob",
"bisq-daemon",
bobdaemon("haveno-XMR_STAGENET_Bob",
"haveno-daemon",
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
HavenoDaemonMain.class.getName(),
8888,
5123,
9999,
49999),
bobdesktop("bisq-XMR_STAGENET_Bob",
"bisq-desktop",
bobdesktop("haveno-XMR_STAGENET_Bob",
"haveno-desktop",
"-XX:MaxRAM=4g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
HavenoAppMain.class.getName(),
8888,

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.linux;
package haveno.apitest.linux;
import java.nio.file.Paths;
@ -27,13 +27,11 @@ import java.util.List;
import lombok.extern.slf4j.Slf4j;
import static bisq.apitest.linux.BashCommand.isAlive;
import static haveno.apitest.linux.BashCommand.isAlive;
import static java.lang.String.format;
import static joptsimple.internal.Strings.EMPTY;
import bisq.apitest.config.ApiTestConfig;
import haveno.apitest.config.ApiTestConfig;
@Slf4j
abstract class AbstractLinuxProcess implements LinuxProcess {

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.linux;
package haveno.apitest.linux;
import java.io.IOException;
@ -26,7 +26,7 @@ import lombok.extern.slf4j.Slf4j;
import javax.annotation.Nullable;
import static bisq.apitest.config.ApiTestConfig.BASH_PATH_VALUE;
import static haveno.apitest.config.ApiTestConfig.BASH_PATH_VALUE;
import static java.lang.management.ManagementFactory.getRuntimeMXBean;
@Slf4j

View File

@ -15,16 +15,13 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.linux;
package haveno.apitest.linux;
import haveno.apitest.config.ApiTestConfig;
import java.io.IOException;
import lombok.extern.slf4j.Slf4j;
import bisq.apitest.config.ApiTestConfig;
@Slf4j
public class BitcoinCli extends AbstractLinuxProcess implements LinuxProcess {

View File

@ -15,20 +15,18 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.linux;
package haveno.apitest.linux;
import java.io.IOException;
import lombok.extern.slf4j.Slf4j;
import static bisq.apitest.linux.BashCommand.isAlive;
import static haveno.apitest.linux.BashCommand.isAlive;
import static java.lang.String.format;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static joptsimple.internal.Strings.EMPTY;
import bisq.apitest.config.ApiTestConfig;
import haveno.apitest.config.ApiTestConfig;
@Slf4j
public class BitcoinDaemon extends AbstractLinuxProcess implements LinuxProcess {

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.linux;
package haveno.apitest.linux;
import java.nio.file.Paths;
@ -27,18 +27,16 @@ import java.util.List;
import lombok.extern.slf4j.Slf4j;
import static bisq.apitest.linux.BashCommand.isAlive;
import static haveno.apitest.linux.BashCommand.isAlive;
import static java.lang.String.format;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import bisq.apitest.config.ApiTestConfig;
import bisq.apitest.config.HavenoAppConfig;
import bisq.daemon.app.HavenoDaemonMain;
import haveno.apitest.config.ApiTestConfig;
import haveno.apitest.config.HavenoAppConfig;
import haveno.daemon.app.HavenoDaemonMain;
/**
* Runs a regtest/dao Bisq application instance in the background.
* Runs a regtest/dao Haveno application instance in the background.
*/
@Slf4j
public class HavenoProcess extends AbstractLinuxProcess implements LinuxProcess {
@ -50,7 +48,7 @@ public class HavenoProcess extends AbstractLinuxProcess implements LinuxProcess
private final String seedNodes;
private final boolean useLocalhostForP2P;
public final boolean useDevPrivilegeKeys;
private final String findBisqPidScript;
private final String findHavenoPidScript;
private final String debugOpts;
public HavenoProcess(HavenoAppConfig havenoAppConfig, ApiTestConfig config) {
@ -62,9 +60,9 @@ public class HavenoProcess extends AbstractLinuxProcess implements LinuxProcess
this.seedNodes = "localhost:2002";
this.useLocalhostForP2P = true;
this.useDevPrivilegeKeys = true;
this.findBisqPidScript = (config.isRunningTest ? "." : "./apitest")
+ "/scripts/get-bisq-pid.sh";
this.debugOpts = config.enableBisqDebugging
this.findHavenoPidScript = (config.isRunningTest ? "." : "./apitest")
+ "/scripts/get-haveno-pid.sh";
this.debugOpts = config.enableHavenoDebugging
? " -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:" + havenoAppConfig.remoteDebugPort
: "";
}
@ -75,7 +73,7 @@ public class HavenoProcess extends AbstractLinuxProcess implements LinuxProcess
if (config.runSubprojectJars)
runJar(); // run subproject/build/lib/*.jar (not full build)
else
runStartupScript(); // run bisq-* script for end to end test (default)
runStartupScript(); // run haveno-* script for end to end test (default)
} catch (Throwable t) {
startupExceptions.add(t);
}
@ -120,7 +118,7 @@ public class HavenoProcess extends AbstractLinuxProcess implements LinuxProcess
}
public void verifyAppNotRunning() throws IOException, InterruptedException {
long pid = findBisqAppPid();
long pid = findHavenoAppPid();
if (pid >= 0)
throw new IllegalStateException(format("%s %s already running with pid %d",
havenoAppConfig.mainClassName, havenoAppConfig.appName, pid));
@ -134,8 +132,8 @@ public class HavenoProcess extends AbstractLinuxProcess implements LinuxProcess
case alicedesktop:
case bobdaemon:
case bobdesktop:
File bisqDataDir = new File(config.rootAppDataDir, havenoAppConfig.appName);
if (!bisqDataDir.exists())
File havenoDataDir = new File(config.rootAppDataDir, havenoAppConfig.appName);
if (!havenoDataDir.exists())
throw new IllegalStateException(format("Application dataDir %s/%s not found",
config.rootAppDataDir, havenoAppConfig.appName));
break;
@ -144,50 +142,50 @@ public class HavenoProcess extends AbstractLinuxProcess implements LinuxProcess
}
}
// This is the non-default way of running a Bisq app (--runSubprojectJars=true).
// It runs a java cmd, and does not depend on a full build. Bisq jars are loaded
// This is the non-default way of running a Haveno app (--runSubprojectJars=true).
// It runs a java cmd, and does not depend on a full build. Haveno jars are loaded
// from the :subproject/build/libs directories.
private void runJar() throws IOException, InterruptedException {
String java = getJavaExecutable().getAbsolutePath();
String classpath = System.getProperty("java.class.path");
String bisqCmd = getJavaOptsSpec()
String havenoCmd = getJavaOptsSpec()
+ " " + java + " -cp " + classpath
+ " " + havenoAppConfig.mainClassName
+ " " + String.join(" ", getOptsList())
+ " &"; // run in background without nohup
runBashCommand(bisqCmd);
runBashCommand(havenoCmd);
}
// This is the default way of running a Bisq app (--runSubprojectJars=false).
// It runs a bisq-* startup script, and depends on a full build. Bisq jars
// This is the default way of running a Haveno app (--runSubprojectJars=false).
// It runs a haveno-* startup script, and depends on a full build. Haveno jars
// are loaded from the root project's lib directory.
private void runStartupScript() throws IOException, InterruptedException {
String startupScriptPath = config.rootProjectDir
+ "/" + havenoAppConfig.startupScript;
String bisqCmd = getJavaOptsSpec()
String havenoCmd = getJavaOptsSpec()
+ " " + startupScriptPath
+ " " + String.join(" ", getOptsList())
+ " &"; // run in background without nohup
runBashCommand(bisqCmd);
runBashCommand(havenoCmd);
}
private void runBashCommand(String bisqCmd) throws IOException, InterruptedException {
private void runBashCommand(String havenoCmd) throws IOException, InterruptedException {
String cmdDescription = config.runSubprojectJars
? "java -> " + havenoAppConfig.mainClassName + " -> " + havenoAppConfig.appName
: havenoAppConfig.startupScript + " -> " + havenoAppConfig.appName;
BashCommand bashCommand = new BashCommand(bisqCmd);
BashCommand bashCommand = new BashCommand(havenoCmd);
log.info("Starting {} ...\n$ {}", cmdDescription, bashCommand.getCommand());
bashCommand.runInBackground();
if (bashCommand.getExitStatus() != 0)
throw new IllegalStateException(format("Error starting BisqApp%n%s%nError: %s",
throw new IllegalStateException(format("Error starting HavenoApp%n%s%nError: %s",
havenoAppConfig.appName,
bashCommand.getError()));
// Sometimes it takes a little extra time to find the linux process id.
// Wait up to two seconds before giving up and throwing an Exception.
for (int i = 0; i < 4; i++) {
pid = findBisqAppPid();
pid = findHavenoAppPid();
if (pid != -1)
break;
@ -197,12 +195,12 @@ public class HavenoProcess extends AbstractLinuxProcess implements LinuxProcess
throw new IllegalStateException(format("Error finding pid for %s", this.name));
log.info("{} running with pid {}", cmdDescription, pid);
log.info("Log {}", config.rootAppDataDir + "/" + havenoAppConfig.appName + "/bisq.log");
log.info("Log {}", config.rootAppDataDir + "/" + havenoAppConfig.appName + "/haveno.log");
}
private long findBisqAppPid() throws IOException, InterruptedException {
private long findHavenoAppPid() throws IOException, InterruptedException {
// Find the pid of the java process by grepping for the mainClassName and appName.
String findPidCmd = findBisqPidScript + " " + havenoAppConfig.mainClassName + " " + havenoAppConfig.appName;
String findPidCmd = findHavenoPidScript + " " + havenoAppConfig.mainClassName + " " + havenoAppConfig.appName;
String psCmdOutput = new BashCommand(findPidCmd).run().getOutput();
return (psCmdOutput == null || psCmdOutput.isEmpty()) ? -1 : Long.parseLong(psCmdOutput);
}

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.linux;
package haveno.apitest.linux;
import java.io.IOException;

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.linux;
package haveno.apitest.linux;
import java.io.IOException;
import java.io.InputStream;

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.linux;
package haveno.apitest.linux;
import java.io.BufferedReader;
import java.io.InputStream;

View File

@ -2,7 +2,7 @@
# Regtest ports start with 512*
# To avoid pesky bitcoind io errors, do not specify ports Bisq is not listening to.
# To avoid pesky bitcoind io errors, do not specify ports Haveno is not listening to.
# SeedNode listens on port 5120
echo $1 | nc -w 1 127.0.0.1 5120

View File

@ -4,7 +4,7 @@
The :daemon & :cli jars contain their own logback.xml config files, which causes chatty logback startup.
To avoid chatty logback msgs during its configuration, pass logback.configurationFile as a system property:
-Dlogback.configurationFile=apitest/build/resources/main/logback.xml
The gradle build file takes care of adding this system property to the bisq-apitest script.
The gradle build file takes care of adding this system property to the haveno-apitest script.
-->
<appender name="CONSOLE_APPENDER" class="ch.qos.logback.core.ConsoleAppender">
<encoder>

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest;
package haveno.apitest;
import java.time.Duration;
@ -30,32 +30,31 @@ import javax.annotation.Nullable;
import org.junit.jupiter.api.TestInfo;
import static bisq.apitest.config.ApiTestRateMeterInterceptorConfig.getTestRateMeterInterceptorConfig;
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
import static bisq.apitest.config.HavenoAppConfig.arbdaemon;
import static bisq.apitest.config.HavenoAppConfig.bobdaemon;
import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
import static haveno.apitest.config.ApiTestRateMeterInterceptorConfig.getTestRateMeterInterceptorConfig;
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
import static haveno.apitest.config.HavenoAppConfig.arbdaemon;
import static haveno.apitest.config.HavenoAppConfig.bobdaemon;
import static java.net.InetAddress.getLoopbackAddress;
import static java.util.Arrays.stream;
import bisq.apitest.config.ApiTestConfig;
import bisq.apitest.method.BitcoinCliHelper;
import bisq.cli.GrpcClient;
import haveno.apitest.Scaffold;
import haveno.apitest.config.ApiTestConfig;
import haveno.apitest.method.BitcoinCliHelper;
import haveno.cli.GrpcClient;
/**
* Base class for all test types: 'method', 'scenario' and 'e2e'.
* <p>
* During scaffold setup, various combinations of bitcoind and bisq instances
* During scaffold setup, various combinations of bitcoind and haveno instances
* can be started in the background before test cases are run. Currently, this test
* harness supports only the "Bisq DAO development environment running against a
* harness supports only the "Haveno DAO development environment running against a
* local Bitcoin regtest network" as described in
* <a href="https://github.com/bisq-network/bisq/blob/master/docs/dev-setup.md">dev-setup.md</a>
* and <a href="https://github.com/bisq-network/bisq/blob/master/docs/dao-setup.md">dao-setup.md</a>.
* <p>
* Those documents contain information about the configurations used by this test harness:
* bitcoin-core's bitcoin.conf and blocknotify values, bisq instance options, the DAO genesis
* bitcoin-core's bitcoin.conf and blocknotify values, haveno instance options, the DAO genesis
* transaction id, initial BTC balances for Bob & Alice accounts, and Bob and
* Alice's default payment accounts.
* <p>
@ -88,7 +87,7 @@ public class ApiTestCase {
String[] params = new String[]{
"--supportingApps", stream(supportingApps).map(Enum::name).collect(Collectors.joining(",")),
"--callRateMeteringConfigPath", getTestRateMeterInterceptorConfig().getAbsolutePath(),
"--enableBisqDebugging", "false"
"--enableHavenoDebugging", "false"
};
setUpScaffold(params);
}

View File

@ -1,4 +1,4 @@
package bisq.apitest;
package haveno.apitest;
import lombok.extern.slf4j.Slf4j;

View File

@ -15,17 +15,15 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.method;
package haveno.apitest.method;
import java.io.IOException;
import static java.lang.String.format;
import static org.junit.jupiter.api.Assertions.fail;
import bisq.apitest.config.ApiTestConfig;
import bisq.apitest.linux.BitcoinCli;
import haveno.apitest.config.ApiTestConfig;
import haveno.apitest.linux.BitcoinCli;
public final class BitcoinCliHelper {

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.method;
package haveno.apitest.method;
import io.grpc.StatusRuntimeException;
@ -30,8 +30,8 @@ import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.method;
package haveno.apitest.method;
import lombok.extern.slf4j.Slf4j;
@ -26,8 +26,8 @@ import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
import static bisq.cli.Method.createoffer;
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
import static haveno.cli.Method.createoffer;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.method;
package haveno.apitest.method;
import lombok.extern.slf4j.Slf4j;
@ -26,8 +26,8 @@ import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
import static bisq.common.app.Version.VERSION;
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
import static haveno.common.app.Version.VERSION;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;

View File

@ -15,17 +15,18 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.method;
import bisq.core.api.model.PaymentAccountForm;
import bisq.core.payment.F2FAccount;
import bisq.core.payment.NationalBankAccount;
import bisq.core.proto.CoreProtoResolver;
import bisq.common.util.Utilities;
import bisq.proto.grpc.BalancesInfo;
package haveno.apitest.method;
import haveno.proto.grpc.BalancesInfo;
import haveno.apitest.ApiTestCase;
import haveno.apitest.linux.BashCommand;
import haveno.cli.GrpcClient;
import haveno.cli.table.builder.TableBuilder;
import haveno.common.util.Utilities;
import haveno.core.api.model.PaymentAccountForm;
import haveno.core.payment.F2FAccount;
import haveno.core.payment.NationalBankAccount;
import haveno.core.proto.CoreProtoResolver;
import io.grpc.Status;
import io.grpc.StatusRuntimeException;
@ -43,22 +44,15 @@ import org.slf4j.Logger;
import javax.annotation.Nullable;
import static bisq.apitest.config.ApiTestConfig.BTC;
import static bisq.apitest.config.ApiTestRateMeterInterceptorConfig.getTestRateMeterInterceptorConfig;
import static bisq.cli.table.builder.TableType.BTC_BALANCE_TBL;
import static bisq.core.btc.wallet.Restrictions.getDefaultBuyerSecurityDepositAsPercent;
import static haveno.apitest.config.ApiTestConfig.BTC;
import static haveno.apitest.config.ApiTestRateMeterInterceptorConfig.getTestRateMeterInterceptorConfig;
import static haveno.cli.table.builder.TableType.BTC_BALANCE_TBL;
import static haveno.core.btc.wallet.Restrictions.getDefaultBuyerSecurityDepositAsPercent;
import static java.lang.String.format;
import static java.nio.charset.StandardCharsets.UTF_8;
import static java.util.Arrays.stream;
import static org.junit.jupiter.api.Assertions.fail;
import bisq.apitest.ApiTestCase;
import bisq.apitest.linux.BashCommand;
import bisq.cli.GrpcClient;
import bisq.cli.table.builder.TableBuilder;
public class MethodTest extends ApiTestCase {
protected static final CoreProtoResolver CORE_PROTO_RESOLVER = new CoreProtoResolver();
@ -74,7 +68,7 @@ public class MethodTest extends ApiTestCase {
setUpScaffold(new String[]{
"--supportingApps", toNameList.apply(supportingApps),
"--callRateMeteringConfigPath", callRateMeteringConfigFile.getAbsolutePath(),
"--enableBisqDebugging", startSupportingAppsInDebugMode ? "true" : "false"
"--enableHavenoDebugging", startSupportingAppsInDebugMode ? "true" : "false"
});
doPostStartup(generateBtcBlock);
} catch (Exception ex) {
@ -91,7 +85,7 @@ public class MethodTest extends ApiTestCase {
setUpScaffold(new String[]{
"--supportingApps", toNameList.apply(supportingApps),
"--callRateMeteringConfigPath", callRateMeteringConfigFile.getAbsolutePath(),
"--enableBisqDebugging", startSupportingAppsInDebugMode ? "true" : "false"
"--enableHavenoDebugging", startSupportingAppsInDebugMode ? "true" : "false"
});
doPostStartup(generateBtcBlock);
} catch (Exception ex) {
@ -108,7 +102,7 @@ public class MethodTest extends ApiTestCase {
protected final File getPaymentAccountForm(GrpcClient grpcClient, String paymentMethodId) {
// We take seemingly unnecessary steps to get a File object, but the point is to
// test the API, and we do not directly ask bisq.core.api.model.PaymentAccountForm
// test the API, and we do not directly ask haveno.core.api.model.PaymentAccountForm
// for an empty json form (file).
String jsonString = grpcClient.getPaymentAcctFormAsJson(paymentMethodId);
// Write the json string to a file here in the test case.
@ -122,7 +116,7 @@ public class MethodTest extends ApiTestCase {
}
protected bisq.core.payment.PaymentAccount createDummyF2FAccount(GrpcClient grpcClient,
protected haveno.core.payment.PaymentAccount createDummyF2FAccount(GrpcClient grpcClient,
String countryCode) {
String f2fAccountJsonString = "{\n" +
" \"_COMMENTS_\": \"This is a dummy account.\",\n" +
@ -138,7 +132,7 @@ public class MethodTest extends ApiTestCase {
}
protected bisq.core.payment.PaymentAccount createDummyBRLAccount(GrpcClient grpcClient,
protected haveno.core.payment.PaymentAccount createDummyBRLAccount(GrpcClient grpcClient,
String holderName,
String nationalAccountId,
String holderTaxId) {
@ -159,12 +153,12 @@ public class MethodTest extends ApiTestCase {
return nationalBankAccount;
}
protected final bisq.core.payment.PaymentAccount createPaymentAccount(GrpcClient grpcClient, String jsonString) {
protected final haveno.core.payment.PaymentAccount createPaymentAccount(GrpcClient grpcClient, String jsonString) {
// Normally, we do asserts on the protos from the gRPC service, but in this
// case we need a bisq.core.payment.PaymentAccount so it can be cast to its
// case we need a haveno.core.payment.PaymentAccount so it can be cast to its
// sub-type.
var paymentAccount = grpcClient.createPaymentAccount(jsonString);
return bisq.core.payment.PaymentAccount.fromProto(paymentAccount, CORE_PROTO_RESOLVER);
return haveno.core.payment.PaymentAccount.fromProto(paymentAccount, CORE_PROTO_RESOLVER);
}
public static final Supplier<Double> defaultBuyerSecurityDepositPct = () -> {
@ -214,7 +208,7 @@ public class MethodTest extends ApiTestCase {
@Nullable
protected static String getNodeExceptionMessages() {
var nodeLogsSpec = config.rootAppDataDir.getAbsolutePath() + "/bisq-BTC_REGTEST_*_dao/bisq.log";
var nodeLogsSpec = config.rootAppDataDir.getAbsolutePath() + "/haveno-BTC_REGTEST_*_dao/haveno.log";
var grep = "grep Exception " + nodeLogsSpec;
var bashCommand = new BashCommand(grep);
try {

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.method;
package haveno.apitest.method;
import io.grpc.StatusRuntimeException;
@ -28,13 +28,13 @@ import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static bisq.apitest.config.ApiTestConfig.ARBITRATOR;
import static bisq.apitest.config.ApiTestConfig.MEDIATOR;
import static bisq.apitest.config.ApiTestConfig.REFUND_AGENT;
import static bisq.apitest.config.HavenoAppConfig.arbdaemon;
import static bisq.apitest.config.HavenoAppConfig.seednode;
import static bisq.common.app.DevEnv.DEV_PRIVILEGE_PRIV_KEY;
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static haveno.apitest.config.ApiTestConfig.ARBITRATOR;
import static haveno.apitest.config.ApiTestConfig.MEDIATOR;
import static haveno.apitest.config.ApiTestConfig.REFUND_AGENT;
import static haveno.apitest.config.HavenoAppConfig.arbdaemon;
import static haveno.apitest.config.HavenoAppConfig.seednode;
import static haveno.common.app.DevEnv.DEV_PRIVILEGE_PRIV_KEY;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.fail;
@ -61,7 +61,7 @@ public class RegisterDisputeAgentsTest extends MethodTest {
public void testRegisterArbitratorShouldThrowException() {
Throwable exception = assertThrows(StatusRuntimeException.class, () ->
arbClient.registerDisputeAgent(ARBITRATOR, DEV_PRIVILEGE_PRIV_KEY));
assertEquals("UNIMPLEMENTED: arbitrators must be registered in a Bisq UI",
assertEquals("UNIMPLEMENTED: arbitrators must be registered in a Haveno UI",
exception.getMessage());
}

View File

@ -15,10 +15,12 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.method.offer;
import bisq.proto.grpc.OfferInfo;
package haveno.apitest.method.offer;
import haveno.proto.grpc.OfferInfo;
import haveno.apitest.method.MethodTest;
import haveno.cli.CliMain;
import haveno.cli.table.builder.TableBuilder;
import protobuf.PaymentAccount;
import java.math.BigDecimal;
@ -33,22 +35,16 @@ import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static bisq.apitest.config.ApiTestConfig.XMR;
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
import static bisq.apitest.config.HavenoAppConfig.arbdaemon;
import static bisq.apitest.config.HavenoAppConfig.bobdaemon;
import static bisq.apitest.config.HavenoAppConfig.seednode;
import static bisq.cli.table.builder.TableType.OFFER_TBL;
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static haveno.apitest.config.ApiTestConfig.XMR;
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
import static haveno.apitest.config.HavenoAppConfig.arbdaemon;
import static haveno.apitest.config.HavenoAppConfig.bobdaemon;
import static haveno.apitest.config.HavenoAppConfig.seednode;
import static haveno.cli.table.builder.TableType.OFFER_TBL;
import static java.lang.String.format;
import static java.lang.System.out;
import bisq.apitest.method.MethodTest;
import bisq.cli.CliMain;
import bisq.cli.table.builder.TableBuilder;
@Slf4j
public abstract class AbstractOfferTest extends MethodTest {

View File

@ -15,12 +15,10 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.method.offer;
import bisq.core.payment.PaymentAccount;
import bisq.proto.grpc.OfferInfo;
package haveno.apitest.method.offer;
import haveno.proto.grpc.OfferInfo;
import haveno.core.payment.PaymentAccount;
import java.util.List;
import java.util.function.Consumer;

View File

@ -15,9 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.method.offer;
import bisq.core.payment.PaymentAccount;
package haveno.apitest.method.offer;
import lombok.extern.slf4j.Slf4j;
@ -27,9 +25,9 @@ import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.config.ApiTestConfig.XMR;
import static bisq.apitest.config.ApiTestConfig.EUR;
import static bisq.apitest.config.ApiTestConfig.USD;
import static haveno.apitest.config.ApiTestConfig.EUR;
import static haveno.apitest.config.ApiTestConfig.USD;
import static haveno.apitest.config.ApiTestConfig.XMR;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
@ -37,6 +35,8 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
import static protobuf.OfferDirection.BUY;
import static protobuf.OfferDirection.SELL;
import haveno.core.payment.PaymentAccount;
@Disabled
@Slf4j
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)

View File

@ -15,12 +15,10 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.method.offer;
import bisq.core.payment.PaymentAccount;
import bisq.proto.grpc.OfferInfo;
package haveno.apitest.method.offer;
import haveno.proto.grpc.OfferInfo;
import haveno.core.payment.PaymentAccount;
import java.text.DecimalFormat;
import java.math.BigDecimal;
@ -33,11 +31,11 @@ import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.config.ApiTestConfig.BTC;
import static bisq.apitest.config.ApiTestConfig.USD;
import static bisq.common.util.MathUtils.roundDouble;
import static bisq.common.util.MathUtils.scaleDownByPowerOf10;
import static bisq.common.util.MathUtils.scaleUpByPowerOf10;
import static haveno.apitest.config.ApiTestConfig.BTC;
import static haveno.apitest.config.ApiTestConfig.USD;
import static haveno.common.util.MathUtils.roundDouble;
import static haveno.common.util.MathUtils.scaleDownByPowerOf10;
import static haveno.common.util.MathUtils.scaleUpByPowerOf10;
import static java.lang.Math.abs;
import static java.lang.String.format;
import static java.math.RoundingMode.HALF_UP;

View File

@ -15,9 +15,9 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.method.offer;
package haveno.apitest.method.offer;
import bisq.proto.grpc.OfferInfo;
import haveno.proto.grpc.OfferInfo;
import java.util.List;
@ -30,8 +30,8 @@ import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.config.ApiTestConfig.BTC;
import static bisq.apitest.config.ApiTestConfig.XMR;
import static haveno.apitest.config.ApiTestConfig.BTC;
import static haveno.apitest.config.ApiTestConfig.XMR;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;

View File

@ -15,9 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.method.offer;
import bisq.core.payment.PaymentAccount;
package haveno.apitest.method.offer;
import io.grpc.StatusRuntimeException;
@ -29,12 +27,14 @@ import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.config.ApiTestConfig.BTC;
import static haveno.apitest.config.ApiTestConfig.BTC;
import static java.lang.String.format;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static protobuf.OfferDirection.BUY;
import haveno.core.payment.PaymentAccount;
@Disabled
@Slf4j
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)

View File

@ -1,15 +1,15 @@
package bisq.apitest.method.payment;
import bisq.core.api.model.PaymentAccountForm;
import bisq.core.locale.FiatCurrency;
import bisq.core.locale.Res;
import bisq.core.locale.TradeCurrency;
import bisq.core.payment.PaymentAccount;
package haveno.apitest.method.payment;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.stream.JsonWriter;
import haveno.apitest.method.MethodTest;
import haveno.cli.GrpcClient;
import haveno.core.api.model.PaymentAccountForm;
import haveno.core.locale.FiatCurrency;
import haveno.core.locale.Res;
import haveno.core.locale.TradeCurrency;
import haveno.core.payment.PaymentAccount;
import java.nio.file.Paths;
import java.io.File;
@ -36,11 +36,6 @@ import static java.lang.System.getProperty;
import static java.nio.charset.StandardCharsets.UTF_8;
import static org.junit.jupiter.api.Assertions.*;
import bisq.apitest.method.MethodTest;
import bisq.cli.GrpcClient;
@Slf4j
public class AbstractPaymentAccountTest extends MethodTest {

View File

@ -15,48 +15,48 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.method.payment;
import bisq.core.locale.FiatCurrency;
import bisq.core.locale.TradeCurrency;
import bisq.core.payment.AdvancedCashAccount;
import bisq.core.payment.AliPayAccount;
import bisq.core.payment.AustraliaPayidAccount;
import bisq.core.payment.CapitualAccount;
import bisq.core.payment.CashDepositAccount;
import bisq.core.payment.ClearXchangeAccount;
import bisq.core.payment.F2FAccount;
import bisq.core.payment.FasterPaymentsAccount;
import bisq.core.payment.HalCashAccount;
import bisq.core.payment.InteracETransferAccount;
import bisq.core.payment.JapanBankAccount;
import bisq.core.payment.MoneyBeamAccount;
import bisq.core.payment.MoneyGramAccount;
import bisq.core.payment.NationalBankAccount;
import bisq.core.payment.PaxumAccount;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.PayseraAccount;
import bisq.core.payment.PerfectMoneyAccount;
import bisq.core.payment.PopmoneyAccount;
import bisq.core.payment.PromptPayAccount;
import bisq.core.payment.RevolutAccount;
import bisq.core.payment.SameBankAccount;
import bisq.core.payment.SepaAccount;
import bisq.core.payment.SepaInstantAccount;
import bisq.core.payment.SpecificBanksAccount;
import bisq.core.payment.SwiftAccount;
import bisq.core.payment.SwishAccount;
import bisq.core.payment.TransferwiseAccount;
import bisq.core.payment.USPostalMoneyOrderAccount;
import bisq.core.payment.UpholdAccount;
import bisq.core.payment.WeChatPayAccount;
import bisq.core.payment.WesternUnionAccount;
import bisq.core.payment.payload.BankAccountPayload;
import bisq.core.payment.payload.CashDepositAccountPayload;
import bisq.core.payment.payload.SameBankAccountPayload;
import bisq.core.payment.payload.SpecificBanksAccountPayload;
import bisq.core.payment.payload.SwiftAccountPayload;
package haveno.apitest.method.payment;
import haveno.cli.table.builder.TableBuilder;
import haveno.core.locale.FiatCurrency;
import haveno.core.locale.TradeCurrency;
import haveno.core.payment.AdvancedCashAccount;
import haveno.core.payment.AliPayAccount;
import haveno.core.payment.AustraliaPayidAccount;
import haveno.core.payment.CapitualAccount;
import haveno.core.payment.CashDepositAccount;
import haveno.core.payment.ClearXchangeAccount;
import haveno.core.payment.F2FAccount;
import haveno.core.payment.FasterPaymentsAccount;
import haveno.core.payment.HalCashAccount;
import haveno.core.payment.InteracETransferAccount;
import haveno.core.payment.JapanBankAccount;
import haveno.core.payment.MoneyBeamAccount;
import haveno.core.payment.MoneyGramAccount;
import haveno.core.payment.NationalBankAccount;
import haveno.core.payment.PaxumAccount;
import haveno.core.payment.PaymentAccount;
import haveno.core.payment.PayseraAccount;
import haveno.core.payment.PerfectMoneyAccount;
import haveno.core.payment.PopmoneyAccount;
import haveno.core.payment.PromptPayAccount;
import haveno.core.payment.RevolutAccount;
import haveno.core.payment.SameBankAccount;
import haveno.core.payment.SepaAccount;
import haveno.core.payment.SepaInstantAccount;
import haveno.core.payment.SpecificBanksAccount;
import haveno.core.payment.SwiftAccount;
import haveno.core.payment.SwishAccount;
import haveno.core.payment.TransferwiseAccount;
import haveno.core.payment.USPostalMoneyOrderAccount;
import haveno.core.payment.UpholdAccount;
import haveno.core.payment.WeChatPayAccount;
import haveno.core.payment.WesternUnionAccount;
import haveno.core.payment.payload.BankAccountPayload;
import haveno.core.payment.payload.CashDepositAccountPayload;
import haveno.core.payment.payload.SameBankAccountPayload;
import haveno.core.payment.payload.SpecificBanksAccountPayload;
import haveno.core.payment.payload.SwiftAccountPayload;
import io.grpc.StatusRuntimeException;
import java.io.File;
@ -76,24 +76,20 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static bisq.apitest.config.ApiTestConfig.EUR;
import static bisq.apitest.config.ApiTestConfig.USD;
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
import static bisq.cli.table.builder.TableType.PAYMENT_ACCOUNT_TBL;
import static bisq.core.locale.CurrencyUtil.getAllSortedFiatCurrencies;
import static bisq.core.locale.CurrencyUtil.getTradeCurrency;
import static bisq.core.payment.payload.PaymentMethod.*;
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static haveno.apitest.config.ApiTestConfig.EUR;
import static haveno.apitest.config.ApiTestConfig.USD;
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
import static haveno.cli.table.builder.TableType.PAYMENT_ACCOUNT_TBL;
import static haveno.core.locale.CurrencyUtil.getAllSortedFiatCurrencies;
import static haveno.core.locale.CurrencyUtil.getTradeCurrency;
import static haveno.core.payment.payload.PaymentMethod.*;
import static java.util.Comparator.comparing;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
import bisq.cli.table.builder.TableBuilder;
@SuppressWarnings({"OptionalGetWithoutIsPresent", "ConstantConditions"})
@Disabled
@Slf4j

View File

@ -1,4 +1,4 @@
package bisq.apitest.method.payment;
package haveno.apitest.method.payment;
import protobuf.PaymentMethod;
@ -15,14 +15,12 @@ import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import bisq.apitest.method.MethodTest;
import haveno.apitest.method.MethodTest;
@Disabled
@Slf4j

View File

@ -1,7 +1,10 @@
package bisq.apitest.method.trade;
import bisq.proto.grpc.TradeInfo;
package haveno.apitest.method.trade;
import haveno.proto.grpc.TradeInfo;
import haveno.apitest.method.offer.AbstractOfferTest;
import haveno.cli.CliMain;
import haveno.cli.GrpcClient;
import haveno.cli.table.builder.TableBuilder;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.function.Supplier;
@ -13,24 +16,17 @@ import lombok.Getter;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.TestInfo;
import static bisq.cli.table.builder.TableType.TRADE_DETAIL_TBL;
import static bisq.core.trade.Trade.Phase.DEPOSITS_UNLOCKED;
import static bisq.core.trade.Trade.Phase.PAYMENT_SENT;
import static bisq.core.trade.Trade.Phase.PAYMENT_RECEIVED;
import static bisq.core.trade.Trade.State.BUYER_SAW_ARRIVED_PAYMENT_SENT_MSG;
import static bisq.core.trade.Trade.State.DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN;
import static bisq.core.trade.Trade.State.SELLER_RECEIVED_PAYMENT_SENT_MSG;
import static haveno.cli.table.builder.TableType.TRADE_DETAIL_TBL;
import static haveno.core.trade.Trade.Phase.DEPOSITS_UNLOCKED;
import static haveno.core.trade.Trade.Phase.PAYMENT_RECEIVED;
import static haveno.core.trade.Trade.Phase.PAYMENT_SENT;
import static haveno.core.trade.Trade.State.BUYER_SAW_ARRIVED_PAYMENT_SENT_MSG;
import static haveno.core.trade.Trade.State.DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN;
import static haveno.core.trade.Trade.State.SELLER_RECEIVED_PAYMENT_SENT_MSG;
import static java.lang.String.format;
import static java.lang.System.out;
import static org.junit.jupiter.api.Assertions.*;
import bisq.apitest.method.offer.AbstractOfferTest;
import bisq.cli.CliMain;
import bisq.cli.GrpcClient;
import bisq.cli.table.builder.TableBuilder;
public class AbstractTradeTest extends AbstractOfferTest {
public static final ExpectedProtocolStatus EXPECTED_PROTOCOL_STATUS = new ExpectedProtocolStatus();

View File

@ -1,6 +1,6 @@
package bisq.apitest.method.trade;
package haveno.apitest.method.trade;
import bisq.core.trade.Trade;
import haveno.core.trade.Trade;
/**
* A test fixture encapsulating expected trade protocol status.

View File

@ -15,9 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.method.trade;
import bisq.core.payment.PaymentAccount;
package haveno.apitest.method.trade;
import io.grpc.StatusRuntimeException;
@ -30,14 +28,16 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.config.ApiTestConfig.USD;
import static bisq.core.trade.Trade.Phase.PAYMENT_RECEIVED;
import static bisq.core.trade.Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG;
import static haveno.apitest.config.ApiTestConfig.USD;
import static haveno.core.trade.Trade.Phase.PAYMENT_RECEIVED;
import static haveno.core.trade.Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
import static protobuf.OfferDirection.BUY;
import static protobuf.OpenOffer.State.AVAILABLE;
import haveno.core.payment.PaymentAccount;
@Disabled
@Slf4j
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)

View File

@ -32,10 +32,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.method.trade;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.NationalBankAccountPayload;
package haveno.apitest.method.trade;
import io.grpc.StatusRuntimeException;
@ -49,14 +46,17 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.config.ApiTestConfig.BTC;
import static bisq.core.trade.Trade.Phase.PAYMENT_RECEIVED;
import static bisq.core.trade.Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG;
import static haveno.apitest.config.ApiTestConfig.BTC;
import static haveno.core.trade.Trade.Phase.PAYMENT_RECEIVED;
import static haveno.core.trade.Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG;
import static org.junit.jupiter.api.Assertions.*;
import static protobuf.Offer.State.OFFER_FEE_RESERVED;
import static protobuf.OfferDirection.BUY;
import static protobuf.OpenOffer.State.AVAILABLE;
import haveno.core.payment.PaymentAccount;
import haveno.core.payment.payload.NationalBankAccountPayload;
/**
* Test case verifies trade can be made with national bank payment method,
* and json contracts exclude bank acct details until deposit tx is confirmed.

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.method.trade;
package haveno.apitest.method.trade;
import io.grpc.StatusRuntimeException;
@ -29,19 +29,17 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.config.ApiTestConfig.XMR;
import static bisq.cli.table.builder.TableType.OFFER_TBL;
import static bisq.core.trade.Trade.Phase.PAYMENT_RECEIVED;
import static bisq.core.trade.Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG;
import static haveno.apitest.config.ApiTestConfig.XMR;
import static haveno.cli.table.builder.TableType.OFFER_TBL;
import static haveno.core.trade.Trade.Phase.PAYMENT_RECEIVED;
import static haveno.core.trade.Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
import static protobuf.Offer.State.OFFER_FEE_RESERVED;
import static protobuf.OfferDirection.SELL;
import bisq.apitest.method.offer.AbstractOfferTest;
import bisq.cli.table.builder.TableBuilder;
import haveno.apitest.method.offer.AbstractOfferTest;
import haveno.cli.table.builder.TableBuilder;
@Disabled
@Slf4j
@ -121,8 +119,8 @@ public class TakeBuyXMROfferTest extends AbstractTradeTest {
sleep(2_000);
var trade = aliceClient.getTrade(tradeId);
// If we were trading BSQ, Alice would verify payment has been sent to her
// Bisq wallet, but we can do no such checks for XMR payments.
// All XMR transfers are done outside Bisq.
// Haveno wallet, but we can do no such checks for XMR payments.
// All XMR transfers are done outside Haveno.
log.debug("Alice verifies XMR payment was received from Bob, for trade {}", trade.getTradeId());
aliceClient.confirmPaymentReceived(trade.getTradeId());
sleep(3_000);

View File

@ -15,9 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.method.trade;
import bisq.core.payment.PaymentAccount;
package haveno.apitest.method.trade;
import io.grpc.StatusRuntimeException;
@ -30,18 +28,20 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.config.ApiTestConfig.BTC;
import static bisq.apitest.config.ApiTestConfig.USD;
import static bisq.core.trade.Trade.Phase.PAYMENT_RECEIVED;
import static bisq.core.trade.Trade.Phase.COMPLETED;
import static bisq.core.trade.Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG;
import static bisq.core.trade.Trade.State.TRADE_COMPLETED;
import static haveno.apitest.config.ApiTestConfig.BTC;
import static haveno.apitest.config.ApiTestConfig.USD;
import static haveno.core.trade.Trade.Phase.COMPLETED;
import static haveno.core.trade.Trade.Phase.PAYMENT_RECEIVED;
import static haveno.core.trade.Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG;
import static haveno.core.trade.Trade.State.TRADE_COMPLETED;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.Assertions.fail;
import static protobuf.Offer.State.OFFER_FEE_RESERVED;
import static protobuf.OfferDirection.SELL;
import haveno.core.payment.PaymentAccount;
@Disabled
@Slf4j
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.method.trade;
package haveno.apitest.method.trade;
import io.grpc.StatusRuntimeException;
@ -29,19 +29,17 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.config.ApiTestConfig.BTC;
import static bisq.apitest.config.ApiTestConfig.XMR;
import static bisq.cli.table.builder.TableType.OFFER_TBL;
import static bisq.core.trade.Trade.Phase.PAYMENT_RECEIVED;
import static bisq.core.trade.Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG;
import static haveno.apitest.config.ApiTestConfig.BTC;
import static haveno.apitest.config.ApiTestConfig.XMR;
import static haveno.cli.table.builder.TableType.OFFER_TBL;
import static haveno.core.trade.Trade.Phase.PAYMENT_RECEIVED;
import static haveno.core.trade.Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
import static protobuf.OfferDirection.BUY;
import bisq.apitest.method.offer.AbstractOfferTest;
import bisq.cli.table.builder.TableBuilder;
import haveno.apitest.method.offer.AbstractOfferTest;
import haveno.cli.table.builder.TableBuilder;
@Disabled
@Slf4j
@ -128,8 +126,8 @@ public class TakeSellXMROfferTest extends AbstractTradeTest {
var trade = bobClient.getTrade(tradeId);
sleep(2_000);
// If we were trading BTC, Bob would verify payment has been sent to his
// Bisq wallet, but we can do no such checks for XMR payments.
// All XMR transfers are done outside Bisq.
// Haveno wallet, but we can do no such checks for XMR payments.
// All XMR transfers are done outside Haveno.
log.debug("Bob verifies XMR payment was received from Alice, for trade {}", trade.getTradeId());
bobClient.confirmPaymentReceived(trade.getTradeId());
sleep(3_000);

View File

@ -1,7 +1,8 @@
package bisq.apitest.method.wallet;
import bisq.proto.grpc.BtcBalanceInfo;
package haveno.apitest.method.wallet;
import haveno.proto.grpc.BtcBalanceInfo;
import haveno.apitest.method.MethodTest;
import haveno.cli.table.builder.TableBuilder;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.AfterAll;
@ -12,24 +13,19 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
import static bisq.apitest.config.HavenoAppConfig.bobdaemon;
import static bisq.apitest.config.HavenoAppConfig.seednode;
import static bisq.apitest.method.wallet.WalletTestUtil.INITIAL_BTC_BALANCES;
import static bisq.apitest.method.wallet.WalletTestUtil.verifyBtcBalances;
import static bisq.cli.table.builder.TableType.ADDRESS_BALANCE_TBL;
import static bisq.cli.table.builder.TableType.BTC_BALANCE_TBL;
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
import static haveno.apitest.config.HavenoAppConfig.bobdaemon;
import static haveno.apitest.config.HavenoAppConfig.seednode;
import static haveno.apitest.method.wallet.WalletTestUtil.INITIAL_BTC_BALANCES;
import static haveno.apitest.method.wallet.WalletTestUtil.verifyBtcBalances;
import static haveno.cli.table.builder.TableType.ADDRESS_BALANCE_TBL;
import static haveno.cli.table.builder.TableType.BTC_BALANCE_TBL;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
import bisq.apitest.method.MethodTest;
import bisq.cli.table.builder.TableBuilder;
@Disabled
@Slf4j
@TestMethodOrder(OrderAnnotation.class)
@ -50,7 +46,7 @@ public class BtcWalletTest extends MethodTest {
@Test
@Order(1)
public void testInitialBtcBalances(final TestInfo testInfo) {
// Bob & Alice's regtest Bisq wallets were initialized with 10 BTC.
// Bob & Alice's regtest Haveno wallets were initialized with 10 BTC.
BtcBalanceInfo alicesBalances = aliceClient.getBtcBalances();
log.debug("{} Alice's BTC Balances:\n{}",
@ -84,8 +80,8 @@ public class BtcWalletTest extends MethodTest {
// New balance is 12.5 BTC
btcBalanceInfo = aliceClient.getBtcBalances();
bisq.core.api.model.BtcBalanceInfo alicesExpectedBalances =
bisq.core.api.model.BtcBalanceInfo.valueOf(1250000000,
haveno.core.api.model.BtcBalanceInfo alicesExpectedBalances =
haveno.core.api.model.BtcBalanceInfo.valueOf(1250000000,
0,
1250000000,
0);

View File

@ -1,4 +1,4 @@
package bisq.apitest.method.wallet;
package haveno.apitest.method.wallet;
import io.grpc.StatusRuntimeException;
@ -11,16 +11,14 @@ import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
import bisq.apitest.method.MethodTest;
import haveno.apitest.method.MethodTest;
@SuppressWarnings("ResultOfMethodCallIgnored")
@Disabled

View File

@ -1,6 +1,6 @@
package bisq.apitest.method.wallet;
package haveno.apitest.method.wallet;
import bisq.proto.grpc.BtcBalanceInfo;
import haveno.proto.grpc.BtcBalanceInfo;
import lombok.extern.slf4j.Slf4j;
@ -11,13 +11,13 @@ public class WalletTestUtil {
// All api tests depend on the DAO / regtest environment, and Bob & Alice's wallets
// are initialized with 10 BTC during the scaffolding setup.
public static final bisq.core.api.model.BtcBalanceInfo INITIAL_BTC_BALANCES =
bisq.core.api.model.BtcBalanceInfo.valueOf(1000000000,
public static final haveno.core.api.model.BtcBalanceInfo INITIAL_BTC_BALANCES =
haveno.core.api.model.BtcBalanceInfo.valueOf(1000000000,
0,
1000000000,
0);
public static void verifyBtcBalances(bisq.core.api.model.BtcBalanceInfo expected,
public static void verifyBtcBalances(haveno.core.api.model.BtcBalanceInfo expected,
BtcBalanceInfo actual) {
assertEquals(expected.getAvailableBalance(), actual.getAvailableBalance());
assertEquals(expected.getReservedBalance(), actual.getReservedBalance());

View File

@ -15,12 +15,11 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.scenario;
import bisq.core.payment.PaymentAccount;
import bisq.proto.grpc.OfferInfo;
package haveno.apitest.scenario;
import haveno.proto.grpc.OfferInfo;
import haveno.apitest.method.offer.AbstractOfferTest;
import haveno.core.payment.PaymentAccount;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.MethodOrderer;
@ -35,10 +34,6 @@ import static org.junit.jupiter.api.Assertions.fail;
import static protobuf.OfferDirection.BUY;
import static protobuf.OfferDirection.SELL;
import bisq.apitest.method.offer.AbstractOfferTest;
/**
* Used to verify trigger based, automatic offer deactivation works.
* Disabled by default.

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.scenario;
package haveno.apitest.scenario;
import lombok.extern.slf4j.Slf4j;
@ -28,11 +28,9 @@ import org.junit.jupiter.api.condition.EnabledIf;
import static java.lang.System.getenv;
import bisq.apitest.method.trade.AbstractTradeTest;
import bisq.apitest.method.trade.TakeBuyBTCOfferTest;
import bisq.apitest.method.trade.TakeSellBTCOfferTest;
import haveno.apitest.method.trade.AbstractTradeTest;
import haveno.apitest.method.trade.TakeBuyBTCOfferTest;
import haveno.apitest.method.trade.TakeSellBTCOfferTest;
@EnabledIf("envLongRunningTestEnabled")
@Slf4j

View File

@ -15,9 +15,15 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.scenario;
package haveno.apitest.scenario;
import haveno.apitest.method.offer.AbstractOfferTest;
import haveno.apitest.method.offer.CancelOfferTest;
import haveno.apitest.method.offer.CreateOfferUsingFixedPriceTest;
import haveno.apitest.method.offer.CreateOfferUsingMarketPriceMarginTest;
import haveno.apitest.method.offer.CreateXMROffersTest;
import haveno.apitest.method.offer.ValidateCreateOfferTest;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.BeforeAll;
@ -26,15 +32,6 @@ import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import bisq.apitest.method.offer.AbstractOfferTest;
import bisq.apitest.method.offer.CancelOfferTest;
import bisq.apitest.method.offer.CreateOfferUsingFixedPriceTest;
import bisq.apitest.method.offer.CreateOfferUsingMarketPriceMarginTest;
import bisq.apitest.method.offer.CreateXMROffersTest;
import bisq.apitest.method.offer.ValidateCreateOfferTest;
@Slf4j
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
public class OfferTest extends AbstractOfferTest {

View File

@ -1,4 +1,4 @@
package bisq.apitest.scenario;
package haveno.apitest.scenario;
import lombok.extern.slf4j.Slf4j;
@ -10,16 +10,14 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
import static bisq.apitest.config.HavenoAppConfig.seednode;
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
import static haveno.apitest.config.HavenoAppConfig.seednode;
import static org.junit.jupiter.api.Assertions.fail;
import bisq.apitest.method.payment.AbstractPaymentAccountTest;
import bisq.apitest.method.payment.CreatePaymentAccountTest;
import bisq.apitest.method.payment.GetPaymentMethodsTest;
import haveno.apitest.method.payment.AbstractPaymentAccountTest;
import haveno.apitest.method.payment.CreatePaymentAccountTest;
import haveno.apitest.method.payment.GetPaymentMethodsTest;
@Slf4j
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.scenario;
package haveno.apitest.scenario;
import lombok.extern.slf4j.Slf4j;
@ -28,23 +28,21 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import org.junit.jupiter.api.condition.EnabledIf;
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
import static bisq.apitest.config.HavenoAppConfig.arbdaemon;
import static bisq.apitest.config.HavenoAppConfig.bobdaemon;
import static bisq.apitest.config.HavenoAppConfig.seednode;
import static bisq.apitest.scenario.bot.shutdown.ManualShutdown.startShutdownTimer;
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
import static haveno.apitest.config.HavenoAppConfig.arbdaemon;
import static haveno.apitest.config.HavenoAppConfig.bobdaemon;
import static haveno.apitest.config.HavenoAppConfig.seednode;
import static haveno.apitest.scenario.bot.shutdown.ManualShutdown.startShutdownTimer;
import static org.junit.jupiter.api.Assertions.fail;
import bisq.apitest.config.ApiTestConfig;
import bisq.apitest.method.BitcoinCliHelper;
import bisq.apitest.scenario.bot.AbstractBotTest;
import bisq.apitest.scenario.bot.BotClient;
import bisq.apitest.scenario.bot.RobotBob;
import bisq.apitest.scenario.bot.script.BashScriptGenerator;
import bisq.apitest.scenario.bot.shutdown.ManualBotShutdownException;
import haveno.apitest.config.ApiTestConfig;
import haveno.apitest.method.BitcoinCliHelper;
import haveno.apitest.scenario.bot.AbstractBotTest;
import haveno.apitest.scenario.bot.BotClient;
import haveno.apitest.scenario.bot.RobotBob;
import haveno.apitest.scenario.bot.script.BashScriptGenerator;
import haveno.apitest.scenario.bot.shutdown.ManualBotShutdownException;
// The test case is enabled if AbstractBotTest#botScriptExists() returns true.
@EnabledIf("botScriptExists")

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.scenario;
package haveno.apitest.scenario;
import java.io.File;
import java.io.IOException;
@ -29,21 +29,19 @@ import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static bisq.apitest.config.ApiTestRateMeterInterceptorConfig.getTestRateMeterInterceptorConfig;
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
import static bisq.apitest.config.HavenoAppConfig.arbdaemon;
import static bisq.apitest.config.HavenoAppConfig.seednode;
import static bisq.common.file.FileUtil.deleteFileIfExists;
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static haveno.apitest.config.ApiTestRateMeterInterceptorConfig.getTestRateMeterInterceptorConfig;
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
import static haveno.apitest.config.HavenoAppConfig.arbdaemon;
import static haveno.apitest.config.HavenoAppConfig.seednode;
import static haveno.common.file.FileUtil.deleteFileIfExists;
import static org.junit.jupiter.api.Assertions.fail;
import bisq.apitest.method.CallRateMeteringInterceptorTest;
import bisq.apitest.method.GetMethodHelpTest;
import bisq.apitest.method.GetVersionTest;
import bisq.apitest.method.MethodTest;
import bisq.apitest.method.RegisterDisputeAgentsTest;
import haveno.apitest.method.CallRateMeteringInterceptorTest;
import haveno.apitest.method.GetMethodHelpTest;
import haveno.apitest.method.GetVersionTest;
import haveno.apitest.method.MethodTest;
import haveno.apitest.method.RegisterDisputeAgentsTest;
@Slf4j

View File

@ -15,8 +15,14 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.scenario;
package haveno.apitest.scenario;
import haveno.apitest.method.trade.AbstractTradeTest;
import haveno.apitest.method.trade.TakeBuyBTCOfferTest;
import haveno.apitest.method.trade.TakeBuyBTCOfferWithNationalBankAcctTest;
import haveno.apitest.method.trade.TakeBuyXMROfferTest;
import haveno.apitest.method.trade.TakeSellBTCOfferTest;
import haveno.apitest.method.trade.TakeSellXMROfferTest;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.BeforeEach;
@ -27,15 +33,6 @@ import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.TestMethodOrder;
import bisq.apitest.method.trade.AbstractTradeTest;
import bisq.apitest.method.trade.TakeBuyBTCOfferTest;
import bisq.apitest.method.trade.TakeBuyBTCOfferWithNationalBankAcctTest;
import bisq.apitest.method.trade.TakeBuyXMROfferTest;
import bisq.apitest.method.trade.TakeSellBTCOfferTest;
import bisq.apitest.method.trade.TakeSellXMROfferTest;
@Slf4j
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
public class TradeTest extends AbstractTradeTest {

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.scenario;
package haveno.apitest.scenario;
import lombok.extern.slf4j.Slf4j;
@ -27,17 +27,15 @@ import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInfo;
import org.junit.jupiter.api.TestMethodOrder;
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
import static bisq.apitest.config.HavenoAppConfig.arbdaemon;
import static bisq.apitest.config.HavenoAppConfig.bobdaemon;
import static bisq.apitest.config.HavenoAppConfig.seednode;
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
import static haveno.apitest.config.HavenoAppConfig.arbdaemon;
import static haveno.apitest.config.HavenoAppConfig.bobdaemon;
import static haveno.apitest.config.HavenoAppConfig.seednode;
import bisq.apitest.method.MethodTest;
import bisq.apitest.method.wallet.BtcWalletTest;
import bisq.apitest.method.wallet.WalletProtectionTest;
import haveno.apitest.method.MethodTest;
import haveno.apitest.method.wallet.BtcWalletTest;
import haveno.apitest.method.wallet.WalletProtectionTest;
@Slf4j
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)

View File

@ -15,14 +15,15 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.scenario.bot;
import bisq.core.locale.Country;
package haveno.apitest.scenario.bot;
import protobuf.PaymentAccount;
import com.google.gson.GsonBuilder;
import haveno.apitest.method.MethodTest;
import haveno.apitest.scenario.bot.script.BashScriptGenerator;
import haveno.apitest.scenario.bot.script.BotScript;
import haveno.core.locale.Country;
import java.nio.file.Paths;
import java.io.File;
@ -30,19 +31,13 @@ import java.io.IOException;
import lombok.extern.slf4j.Slf4j;
import static bisq.core.locale.CountryUtil.findCountryByCode;
import static bisq.core.payment.payload.PaymentMethod.CLEAR_X_CHANGE_ID;
import static bisq.core.payment.payload.PaymentMethod.getPaymentMethod;
import static haveno.core.locale.CountryUtil.findCountryByCode;
import static haveno.core.payment.payload.PaymentMethod.CLEAR_X_CHANGE_ID;
import static haveno.core.payment.payload.PaymentMethod.getPaymentMethod;
import static java.lang.String.format;
import static java.lang.System.getProperty;
import static java.nio.file.Files.readAllBytes;
import bisq.apitest.method.MethodTest;
import bisq.apitest.scenario.bot.script.BashScriptGenerator;
import bisq.apitest.scenario.bot.script.BotScript;
@Slf4j
public abstract class AbstractBotTest extends MethodTest {

View File

@ -1,23 +1,19 @@
package bisq.apitest.scenario.bot;
import bisq.core.locale.Country;
package haveno.apitest.scenario.bot;
import haveno.apitest.method.BitcoinCliHelper;
import haveno.apitest.scenario.bot.script.BashScriptGenerator;
import haveno.apitest.scenario.bot.script.BotScript;
import haveno.core.locale.Country;
import protobuf.PaymentAccount;
import lombok.extern.slf4j.Slf4j;
import static bisq.core.locale.CountryUtil.findCountryByCode;
import static bisq.core.payment.payload.PaymentMethod.CLEAR_X_CHANGE_ID;
import static bisq.core.payment.payload.PaymentMethod.getPaymentMethod;
import static haveno.core.locale.CountryUtil.findCountryByCode;
import static haveno.core.payment.payload.PaymentMethod.CLEAR_X_CHANGE_ID;
import static haveno.core.payment.payload.PaymentMethod.getPaymentMethod;
import static java.lang.String.format;
import static java.util.concurrent.TimeUnit.MINUTES;
import bisq.apitest.method.BitcoinCliHelper;
import bisq.apitest.scenario.bot.script.BashScriptGenerator;
import bisq.apitest.scenario.bot.script.BotScript;
@Slf4j
public
class Bot {

View File

@ -15,13 +15,14 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.scenario.bot;
import bisq.proto.grpc.BalancesInfo;
import bisq.proto.grpc.GetPaymentAccountsRequest;
import bisq.proto.grpc.OfferInfo;
import bisq.proto.grpc.TradeInfo;
package haveno.apitest.scenario.bot;
import haveno.proto.grpc.BalancesInfo;
import haveno.proto.grpc.GetPaymentAccountsRequest;
import haveno.proto.grpc.OfferInfo;
import haveno.proto.grpc.TradeInfo;
import haveno.cli.GrpcClient;
import haveno.core.api.model.PaymentAccountForm;
import protobuf.PaymentAccount;
import java.text.DecimalFormat;
@ -33,11 +34,6 @@ import lombok.extern.slf4j.Slf4j;
import static org.apache.commons.lang3.StringUtils.capitalize;
import bisq.cli.GrpcClient;
import bisq.core.api.model.PaymentAccountForm;
/**
* Convenience GrpcClient wrapper for bots using gRPC services.
*/

View File

@ -1,22 +1,20 @@
package bisq.apitest.scenario.bot;
import bisq.core.api.model.PaymentAccountForm;
import bisq.core.locale.Country;
package haveno.apitest.scenario.bot;
import protobuf.PaymentAccount;
import static haveno.core.payment.payload.PaymentMethod.CLEAR_X_CHANGE_ID;
import static haveno.core.payment.payload.PaymentMethod.F2F_ID;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import haveno.core.api.model.PaymentAccountForm;
import haveno.core.locale.Country;
import java.io.File;
import java.util.Map;
import lombok.extern.slf4j.Slf4j;
import static bisq.core.payment.payload.PaymentMethod.CLEAR_X_CHANGE_ID;
import static bisq.core.payment.payload.PaymentMethod.F2F_ID;
@Slf4j
public class BotPaymentAccountGenerator {

View File

@ -15,9 +15,9 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.scenario.bot;
package haveno.apitest.scenario.bot;
import bisq.common.HavenoException;
import haveno.common.HavenoException;
@SuppressWarnings("unused")
public class InvalidRandomOfferException extends HavenoException {

View File

@ -15,9 +15,9 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.scenario.bot;
package haveno.apitest.scenario.bot;
import bisq.common.HavenoException;
import haveno.common.HavenoException;
@SuppressWarnings("unused")
public class PaymentAccountNotFoundException extends HavenoException {

View File

@ -15,9 +15,9 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.scenario.bot;
package haveno.apitest.scenario.bot;
import bisq.proto.grpc.OfferInfo;
import haveno.proto.grpc.OfferInfo;
import protobuf.PaymentAccount;
@ -33,11 +33,11 @@ import java.util.function.Supplier;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import static bisq.apitest.method.offer.AbstractOfferTest.defaultBuyerSecurityDepositPct;
import static bisq.cli.CurrencyFormat.formatInternalFiatPrice;
import static bisq.cli.CurrencyFormat.formatSatoshis;
import static bisq.common.util.MathUtils.scaleDownByPowerOf10;
import static bisq.core.payment.payload.PaymentMethod.F2F_ID;
import static haveno.apitest.method.offer.AbstractOfferTest.defaultBuyerSecurityDepositPct;
import static haveno.cli.CurrencyFormat.formatInternalFiatPrice;
import static haveno.cli.CurrencyFormat.formatSatoshis;
import static haveno.common.util.MathUtils.scaleDownByPowerOf10;
import static haveno.core.payment.payload.PaymentMethod.F2F_ID;
import static java.lang.String.format;
import static java.math.RoundingMode.HALF_UP;

View File

@ -15,26 +15,24 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.scenario.bot;
package haveno.apitest.scenario.bot;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import static bisq.apitest.scenario.bot.protocol.ProtocolStep.DONE;
import static bisq.apitest.scenario.bot.shutdown.ManualShutdown.isShutdownCalled;
import static bisq.cli.table.builder.TableType.BTC_BALANCE_TBL;
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.DONE;
import static haveno.apitest.scenario.bot.shutdown.ManualShutdown.isShutdownCalled;
import static haveno.cli.table.builder.TableType.BTC_BALANCE_TBL;
import static java.util.concurrent.TimeUnit.SECONDS;
import bisq.apitest.method.BitcoinCliHelper;
import bisq.apitest.scenario.bot.protocol.BotProtocol;
import bisq.apitest.scenario.bot.protocol.MakerBotProtocol;
import bisq.apitest.scenario.bot.protocol.TakerBotProtocol;
import bisq.apitest.scenario.bot.script.BashScriptGenerator;
import bisq.apitest.scenario.bot.script.BotScript;
import bisq.apitest.scenario.bot.shutdown.ManualBotShutdownException;
import bisq.cli.table.builder.TableBuilder;
import haveno.apitest.method.BitcoinCliHelper;
import haveno.apitest.scenario.bot.protocol.BotProtocol;
import haveno.apitest.scenario.bot.protocol.MakerBotProtocol;
import haveno.apitest.scenario.bot.protocol.TakerBotProtocol;
import haveno.apitest.scenario.bot.script.BashScriptGenerator;
import haveno.apitest.scenario.bot.script.BotScript;
import haveno.apitest.scenario.bot.shutdown.ManualBotShutdownException;
import haveno.cli.table.builder.TableBuilder;
@Slf4j
public
@ -113,7 +111,7 @@ class RobotBob extends Bot {
log.info("When ready to shutdown the test {}, run '$ touch /tmp/bottest-shutdown'.",
harnessOrCase);
if (!isUsingTestHarness) {
log.warn("You will have to manually shutdown the bitcoind and Bisq nodes"
log.warn("You will have to manually shutdown the bitcoind and Haveno nodes"
+ " running outside of the test harness.");
}
try {

View File

@ -15,11 +15,15 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.scenario.bot.protocol;
package haveno.apitest.scenario.bot.protocol;
import bisq.proto.grpc.TradeInfo;
import haveno.proto.grpc.TradeInfo;
import haveno.apitest.method.BitcoinCliHelper;
import haveno.apitest.scenario.bot.BotClient;
import haveno.apitest.scenario.bot.script.BashScriptGenerator;
import haveno.apitest.scenario.bot.shutdown.ManualBotShutdownException;
import haveno.cli.table.builder.TableBuilder;
import protobuf.PaymentAccount;
import java.security.SecureRandom;
@ -37,22 +41,14 @@ import java.util.stream.Collectors;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
import static bisq.apitest.scenario.bot.protocol.ProtocolStep.*;
import static bisq.apitest.scenario.bot.shutdown.ManualShutdown.checkIfShutdownCalled;
import static bisq.cli.table.builder.TableType.TRADE_DETAIL_TBL;
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.*;
import static haveno.apitest.scenario.bot.shutdown.ManualShutdown.checkIfShutdownCalled;
import static haveno.cli.table.builder.TableType.TRADE_DETAIL_TBL;
import static java.lang.String.format;
import static java.lang.System.currentTimeMillis;
import static java.util.Arrays.stream;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import bisq.apitest.method.BitcoinCliHelper;
import bisq.apitest.scenario.bot.BotClient;
import bisq.apitest.scenario.bot.script.BashScriptGenerator;
import bisq.apitest.scenario.bot.shutdown.ManualBotShutdownException;
import bisq.cli.table.builder.TableBuilder;
@Slf4j
public abstract class BotProtocol {

View File

@ -1,8 +1,13 @@
package bisq.apitest.scenario.bot.protocol;
import bisq.proto.grpc.OfferInfo;
import bisq.proto.grpc.TradeInfo;
package haveno.apitest.scenario.bot.protocol;
import haveno.proto.grpc.OfferInfo;
import haveno.proto.grpc.TradeInfo;
import haveno.apitest.method.BitcoinCliHelper;
import haveno.apitest.scenario.bot.BotClient;
import haveno.apitest.scenario.bot.RandomOffer;
import haveno.apitest.scenario.bot.script.BashScriptGenerator;
import haveno.apitest.scenario.bot.shutdown.ManualBotShutdownException;
import haveno.cli.table.builder.TableBuilder;
import protobuf.PaymentAccount;
import java.io.File;
@ -13,20 +18,11 @@ import java.util.function.Supplier;
import lombok.extern.slf4j.Slf4j;
import static bisq.apitest.scenario.bot.protocol.ProtocolStep.DONE;
import static bisq.apitest.scenario.bot.protocol.ProtocolStep.WAIT_FOR_OFFER_TAKER;
import static bisq.apitest.scenario.bot.shutdown.ManualShutdown.checkIfShutdownCalled;
import static bisq.cli.table.builder.TableType.OFFER_TBL;
import static bisq.cli.table.builder.TableType.TRADE_DETAIL_TBL;
import bisq.apitest.method.BitcoinCliHelper;
import bisq.apitest.scenario.bot.BotClient;
import bisq.apitest.scenario.bot.RandomOffer;
import bisq.apitest.scenario.bot.script.BashScriptGenerator;
import bisq.apitest.scenario.bot.shutdown.ManualBotShutdownException;
import bisq.cli.table.builder.TableBuilder;
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.DONE;
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.WAIT_FOR_OFFER_TAKER;
import static haveno.apitest.scenario.bot.shutdown.ManualShutdown.checkIfShutdownCalled;
import static haveno.cli.table.builder.TableType.OFFER_TBL;
import static haveno.cli.table.builder.TableType.TRADE_DETAIL_TBL;
@Slf4j
public class MakerBotProtocol extends BotProtocol {

View File

@ -1,4 +1,4 @@
package bisq.apitest.scenario.bot.protocol;
package haveno.apitest.scenario.bot.protocol;
public enum ProtocolStep {
START,

View File

@ -1,8 +1,12 @@
package bisq.apitest.scenario.bot.protocol;
import bisq.proto.grpc.OfferInfo;
import bisq.proto.grpc.TradeInfo;
package haveno.apitest.scenario.bot.protocol;
import haveno.proto.grpc.OfferInfo;
import haveno.proto.grpc.TradeInfo;
import haveno.apitest.method.BitcoinCliHelper;
import haveno.apitest.scenario.bot.BotClient;
import haveno.apitest.scenario.bot.script.BashScriptGenerator;
import haveno.apitest.scenario.bot.shutdown.ManualBotShutdownException;
import haveno.cli.table.builder.TableBuilder;
import protobuf.PaymentAccount;
import java.io.File;
@ -13,20 +17,12 @@ import java.util.function.Supplier;
import lombok.extern.slf4j.Slf4j;
import static bisq.apitest.scenario.bot.protocol.ProtocolStep.DONE;
import static bisq.apitest.scenario.bot.protocol.ProtocolStep.FIND_OFFER;
import static bisq.apitest.scenario.bot.protocol.ProtocolStep.TAKE_OFFER;
import static bisq.apitest.scenario.bot.shutdown.ManualShutdown.checkIfShutdownCalled;
import static bisq.cli.table.builder.TableType.OFFER_TBL;
import static bisq.core.payment.payload.PaymentMethod.F2F_ID;
import bisq.apitest.method.BitcoinCliHelper;
import bisq.apitest.scenario.bot.BotClient;
import bisq.apitest.scenario.bot.script.BashScriptGenerator;
import bisq.apitest.scenario.bot.shutdown.ManualBotShutdownException;
import bisq.cli.table.builder.TableBuilder;
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.DONE;
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.FIND_OFFER;
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.TAKE_OFFER;
import static haveno.apitest.scenario.bot.shutdown.ManualShutdown.checkIfShutdownCalled;
import static haveno.cli.table.builder.TableType.OFFER_TBL;
import static haveno.core.payment.payload.PaymentMethod.F2F_ID;
@Slf4j
public class TakerBotProtocol extends BotProtocol {

View File

@ -15,15 +15,13 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.scenario.bot.script;
package haveno.apitest.scenario.bot.script;
import bisq.common.file.FileUtil;
import bisq.proto.grpc.OfferInfo;
import bisq.proto.grpc.TradeInfo;
import haveno.proto.grpc.OfferInfo;
import haveno.proto.grpc.TradeInfo;
import com.google.common.io.Files;
import haveno.common.file.FileUtil;
import java.nio.file.Paths;
import java.io.File;
@ -60,7 +58,7 @@ public class BashScriptGenerator {
this.apiPort = apiPort;
this.paymentAccountId = paymentAccountId;
this.printCliScripts = printCliScripts;
this.cliBase = format("./bisq-cli --password=%s --port=%d", apiPassword, apiPort);
this.cliBase = format("./haveno-cli --password=%s --port=%d", apiPassword, apiPort);
}
public File createMakeMarginPricedOfferScript(String direction,

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.scenario.bot.script;
package haveno.apitest.scenario.bot.script;
import lombok.Getter;
import lombok.Setter;

View File

@ -15,12 +15,10 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.scenario.bot.script;
import bisq.core.util.JsonUtil;
import bisq.common.file.JsonFileManager;
package haveno.apitest.scenario.bot.script;
import haveno.common.file.JsonFileManager;
import haveno.core.util.JsonUtil;
import joptsimple.BuiltinHelpFormatter;
import joptsimple.OptionParser;
import joptsimple.OptionSet;

View File

@ -15,9 +15,9 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.apitest.scenario.bot.shutdown;
package haveno.apitest.scenario.bot.shutdown;
import bisq.common.HavenoException;
import haveno.common.HavenoException;
@SuppressWarnings("unused")
public class ManualBotShutdownException extends HavenoException {

View File

@ -1,6 +1,4 @@
package bisq.apitest.scenario.bot.shutdown;
import bisq.common.UserThread;
package haveno.apitest.scenario.bot.shutdown;
import java.io.File;
import java.io.IOException;
@ -9,9 +7,11 @@ import java.util.concurrent.atomic.AtomicBoolean;
import lombok.extern.slf4j.Slf4j;
import static bisq.common.file.FileUtil.deleteFileIfExists;
import static haveno.common.file.FileUtil.deleteFileIfExists;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import haveno.common.UserThread;
@Slf4j
public class ManualShutdown {
@ -24,7 +24,7 @@ public class ManualShutdown {
*
* Running '$ touch /tmp/bottest-shutdown' could be used to trigger a scaffold teardown.
*
* This is much easier than manually shutdown down bisq apps & bitcoind.
* This is much easier than manually shutdown down haveno apps & bitcoind.
*/
public static void startShutdownTimer() {
deleteStaleShutdownFile();

View File

@ -4,7 +4,7 @@
The :daemon & :cli jars contain their own logback.xml config files, which causes chatty logback startup.
To avoid chatty logback msgs during its configuration, pass logback.configurationFile as a system property:
-Dlogback.configurationFile=apitest/build/resources/main/logback.xml
The gradle build file takes care of adding this system property to the bisq-apitest script.
The gradle build file takes care of adding this system property to the haveno-apitest script.
-->
<appender name="CONSOLE_APPENDER" class="ch.qos.logback.core.ConsoleAppender">
<encoder>

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.asset;
package haveno.asset;
import static org.apache.commons.lang3.Validate.notBlank;
import static org.apache.commons.lang3.Validate.notNull;

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.asset;
package haveno.asset;
/**
* Value object representing the result of validating an {@link Asset} address. Various

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.asset;
package haveno.asset;
/**
* An {@link Asset} address validation function.

View File

@ -1,4 +1,4 @@
package bisq.asset;
package haveno.asset;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;

View File

@ -15,17 +15,17 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.asset;
package haveno.asset;
/**
* Interface representing a given ("crypto") asset in its most abstract form, having a
* {@link #getName() name}, eg "Bitcoin", a {@link #getTickerSymbol() ticker symbol},
* eg "BTC", and an address validation function. Together, these properties represent
* the minimum information and functionality required to register and trade an asset on
* the Bisq network.
* the Haveno network.
* <p>
* Implementations typically extend either the {@link Coin} or {@link Token} base
* classes, and must be registered in the {@code META-INF/services/bisq.asset.Asset} file
* classes, and must be registered in the {@code META-INF/services/haveno.asset.Asset} file
* in order to be available in the {@link AssetRegistry} at runtime.
*
* @author Chris Beams

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.asset;
package haveno.asset;
import java.util.ArrayList;
import java.util.List;
@ -24,7 +24,7 @@ import java.util.stream.Stream;
/**
* Provides {@link Stream}-based access to {@link Asset} implementations registered in
* the {@code META-INF/services/bisq.asset.Asset} provider-configuration file.
* the {@code META-INF/services/haveno.asset.Asset} provider-configuration file.
*
* @author Chris Beams
* @since 0.7.0

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.asset;
package haveno.asset;
import org.bitcoinj.core.AddressFormatException;
import org.bitcoinj.core.LegacyAddress;

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.asset;
package haveno.asset;
import org.bitcoinj.core.Address;
import org.bitcoinj.core.AddressFormatException;

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.asset;
package haveno.asset;
/**
* Validates a Bitcoin Cash address.

View File

@ -15,11 +15,11 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.asset;
package haveno.asset;
/**
* Abstract base class for {@link Asset}s with their own dedicated blockchain, such as
* {@link bisq.asset.coins.Bitcoin}, {@link bisq.asset.coins.Ether}, and {@link bisq.asset.coins.Monero}.
* {@link haveno.asset.coins.Bitcoin}, {@link haveno.asset.coins.Ether}, and {@link haveno.asset.coins.Monero}.
* <p>
* In addition to the usual {@code Asset} properties, a {@code Coin} maintains information
* about which {@link Network} it may be used on. By default, coins are constructed with

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.asset;
package haveno.asset;
/**
* {@link AddressValidator} for Base58-encoded Cryptonote addresses.

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.asset;
package haveno.asset;
import org.bitcoinj.core.Utils;

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.asset;
package haveno.asset;
/**
* Abstract base class for Ethereum-based {@link Token}s that implement the

View File

@ -15,13 +15,13 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.asset;
package haveno.asset;
/**
* Validates an Ethereum address using the regular expression on record in the
* <a href="https://github.com/ethereum/web3.js/blob/bd6a890/lib/utils/utils.js#L405">
* ethereum/web3.js</a> project. Note that this implementation is widely used, not just
* for actual {@link bisq.asset.coins.Ether} address validation, but also for
* for actual {@link haveno.asset.coins.Ether} address validation, but also for
* {@link Erc20Token} implementations and other Ethereum-based {@link Asset}
* implementations.
*

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.asset;
package haveno.asset;
/**
* We only support the grinbox format as it is currently the only tool which offers a validation options of sender.

View File

@ -1,4 +1,4 @@
package bisq.asset;
package haveno.asset;
import java.util.ResourceBundle;

View File

@ -1,4 +1,4 @@
package bisq.asset;
package haveno.asset;
public class LiquidBitcoinAddressValidator extends RegexAddressValidator {
static private final String REGEX = "^([a-km-zA-HJ-NP-Z1-9]{26,35}|[a-km-zA-HJ-NP-Z1-9]{80}|[a-z]{2,5}1[ac-hj-np-z02-9]{8,87}|[A-Z]{2,5}1[AC-HJ-NP-Z02-9]{8,87})$";

View File

@ -15,7 +15,7 @@
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
*/
package bisq.asset;
package haveno.asset;
import org.bitcoinj.core.BitcoinSerializer;
import org.bitcoinj.core.Block;

Some files were not shown because too many files have changed in this diff Show More