mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-12-22 03:29:28 +00:00
rename all packages and other names from bisq to haveno
This commit is contained in:
parent
ab0b9e3b77
commit
1a1fb130c0
1775 changed files with 14575 additions and 16767 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -3,7 +3,7 @@ bin/
|
||||||
*/log
|
*/log
|
||||||
*/out
|
*/out
|
||||||
.idea
|
.idea
|
||||||
!.idea/copyright/bisq_Affero_GPLv3.xml
|
!.idea/copyright/haveno_Affero_GPLv3.xml
|
||||||
!.idea/copyright/profiles_settings.xml
|
!.idea/copyright/profiles_settings.xml
|
||||||
!.idea/codeStyleSettings.xml
|
!.idea/codeStyleSettings.xml
|
||||||
*.iml
|
*.iml
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import sys, os, json
|
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:
|
if len(sys.argv) < 2:
|
||||||
print("usage: editf2faccountform.py country_code")
|
print("usage: editf2faccountform.py country_code")
|
||||||
|
|
|
@ -8,14 +8,14 @@
|
||||||
#
|
#
|
||||||
# - Linux or OSX with bash, Java 11-15 (JDK language compatibility 11), and bitcoin-core (v0.19 - v22).
|
# - 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`
|
# Build command: `./gradlew clean build :apitest:installDaoSetup`
|
||||||
#
|
#
|
||||||
# - All supporting nodes must be run locally, in dev/dao/regtest mode:
|
# - All supporting nodes must be run locally, in dev/dao/regtest mode:
|
||||||
# bitcoind, seednode, arbdaemon, alicedaemon, bobdaemon
|
# bitcoind, seednode, arbdaemon, alicedaemon, bobdaemon
|
||||||
#
|
#
|
||||||
# These should be run using the apitest harness. From the root project dir, run:
|
# 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.
|
# - Only regtest btc can be bought or sold with the test payment account.
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
#!/usr/bin/env bats
|
#!/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:
|
# Prerequisites:
|
||||||
#
|
#
|
||||||
# - bats-core 1.2.0+ must be installed (brew install bats-core on macOS)
|
# - bats-core 1.2.0+ must be installed (brew install bats-core on macOS)
|
||||||
# see https://github.com/bats-core/bats-core
|
# 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
|
# is empty or otherwise contains an unencrypted wallet with a 0 BTC balance
|
||||||
#
|
#
|
||||||
# Usage:
|
# Usage:
|
||||||
|
@ -17,28 +17,28 @@
|
||||||
# bats apitest/scripts/mainnet-test.sh
|
# bats apitest/scripts/mainnet-test.sh
|
||||||
|
|
||||||
@test "test unsupported method error" {
|
@test "test unsupported method error" {
|
||||||
run ./bisq-cli --password=xyz bogus
|
run ./haveno-cli --password=xyz bogus
|
||||||
[ "$status" -eq 1 ]
|
[ "$status" -eq 1 ]
|
||||||
echo "actual output: $output" >&2 # printed only on test failure
|
echo "actual output: $output" >&2 # printed only on test failure
|
||||||
[ "$output" = "Error: 'bogus' is not a supported method" ]
|
[ "$output" = "Error: 'bogus' is not a supported method" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test unrecognized option error" {
|
@test "test unrecognized option error" {
|
||||||
run ./bisq-cli --bogus getversion
|
run ./haveno-cli --bogus getversion
|
||||||
[ "$status" -eq 1 ]
|
[ "$status" -eq 1 ]
|
||||||
echo "actual output: $output" >&2
|
echo "actual output: $output" >&2
|
||||||
[ "$output" = "Error: missing required 'password' option" ]
|
[ "$output" = "Error: missing required 'password' option" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test missing required password option error" {
|
@test "test missing required password option error" {
|
||||||
run ./bisq-cli getversion
|
run ./haveno-cli getversion
|
||||||
[ "$status" -eq 1 ]
|
[ "$status" -eq 1 ]
|
||||||
echo "actual output: $output" >&2
|
echo "actual output: $output" >&2
|
||||||
[ "$output" = "Error: missing required 'password' option" ]
|
[ "$output" = "Error: missing required 'password' option" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test incorrect password error" {
|
@test "test incorrect password error" {
|
||||||
run ./bisq-cli --password=bogus getversion
|
run ./haveno-cli --password=bogus getversion
|
||||||
[ "$status" -eq 1 ]
|
[ "$status" -eq 1 ]
|
||||||
echo "actual output: $output" >&2
|
echo "actual output: $output" >&2
|
||||||
[ "$output" = "Error: incorrect 'password' rpc header value" ]
|
[ "$output" = "Error: incorrect 'password' rpc header value" ]
|
||||||
|
@ -46,7 +46,7 @@
|
||||||
|
|
||||||
@test "test getversion call with quoted password" {
|
@test "test getversion call with quoted password" {
|
||||||
load 'version-parser'
|
load 'version-parser'
|
||||||
run ./bisq-cli --password="xyz" getversion
|
run ./haveno-cli --password="xyz" getversion
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
echo "actual output: $output" >&2
|
echo "actual output: $output" >&2
|
||||||
[ "$output" = "$CURRENT_VERSION" ]
|
[ "$output" = "$CURRENT_VERSION" ]
|
||||||
|
@ -56,14 +56,14 @@
|
||||||
# Wait 1 second before calling getversion again.
|
# Wait 1 second before calling getversion again.
|
||||||
sleep 1
|
sleep 1
|
||||||
load 'version-parser'
|
load 'version-parser'
|
||||||
run ./bisq-cli --password=xyz getversion
|
run ./haveno-cli --password=xyz getversion
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
echo "actual output: $output" >&2
|
echo "actual output: $output" >&2
|
||||||
[ "$output" = "$CURRENT_VERSION" ]
|
[ "$output" = "$CURRENT_VERSION" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test setwalletpassword \"a b c\"" {
|
@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 ]
|
[ "$status" -eq 0 ]
|
||||||
echo "actual output: $output" >&2
|
echo "actual output: $output" >&2
|
||||||
[ "$output" = "wallet encrypted" ]
|
[ "$output" = "wallet encrypted" ]
|
||||||
|
@ -71,14 +71,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test unlockwallet without password & timeout args" {
|
@test "test unlockwallet without password & timeout args" {
|
||||||
run ./bisq-cli --password=xyz unlockwallet
|
run ./haveno-cli --password=xyz unlockwallet
|
||||||
[ "$status" -eq 1 ]
|
[ "$status" -eq 1 ]
|
||||||
echo "actual output: $output" >&2
|
echo "actual output: $output" >&2
|
||||||
[ "$output" = "Error: no password specified" ]
|
[ "$output" = "Error: no password specified" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test unlockwallet without timeout arg" {
|
@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 ]
|
[ "$status" -eq 1 ]
|
||||||
echo "actual output: $output" >&2
|
echo "actual output: $output" >&2
|
||||||
[ "$output" = "Error: no unlock timeout specified" ]
|
[ "$output" = "Error: no unlock timeout specified" ]
|
||||||
|
@ -86,34 +86,34 @@
|
||||||
|
|
||||||
|
|
||||||
@test "test unlockwallet \"a b c\" 8" {
|
@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 ]
|
[ "$status" -eq 0 ]
|
||||||
echo "actual output: $output" >&2
|
echo "actual output: $output" >&2
|
||||||
[ "$output" = "wallet unlocked" ]
|
[ "$output" = "wallet unlocked" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test getbalance while wallet unlocked for 8s" {
|
@test "test getbalance while wallet unlocked for 8s" {
|
||||||
run ./bisq-cli --password=xyz getbalance
|
run ./haveno-cli --password=xyz getbalance
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
sleep 8
|
sleep 8
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test unlockwallet \"a b c\" 6" {
|
@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 ]
|
[ "$status" -eq 0 ]
|
||||||
echo "actual output: $output" >&2
|
echo "actual output: $output" >&2
|
||||||
[ "$output" = "wallet unlocked" ]
|
[ "$output" = "wallet unlocked" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test lockwallet before unlockwallet timeout=6s expires" {
|
@test "test lockwallet before unlockwallet timeout=6s expires" {
|
||||||
run ./bisq-cli --password=xyz lockwallet
|
run ./haveno-cli --password=xyz lockwallet
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
echo "actual output: $output" >&2
|
echo "actual output: $output" >&2
|
||||||
[ "$output" = "wallet locked" ]
|
[ "$output" = "wallet locked" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test setwalletpassword incorrect old pwd error" {
|
@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 ]
|
[ "$status" -eq 1 ]
|
||||||
echo "actual output: $output" >&2
|
echo "actual output: $output" >&2
|
||||||
[ "$output" = "Error: incorrect old password" ]
|
[ "$output" = "Error: incorrect old password" ]
|
||||||
|
@ -122,7 +122,7 @@
|
||||||
@test "test setwalletpassword oldpwd newpwd" {
|
@test "test setwalletpassword oldpwd newpwd" {
|
||||||
# Wait 5 seconds before calling setwalletpassword again.
|
# Wait 5 seconds before calling setwalletpassword again.
|
||||||
sleep 5
|
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 ]
|
[ "$status" -eq 0 ]
|
||||||
echo "actual output: $output" >&2
|
echo "actual output: $output" >&2
|
||||||
[ "$output" = "wallet encrypted with new password" ]
|
[ "$output" = "wallet encrypted with new password" ]
|
||||||
|
@ -130,14 +130,14 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test getbalance wallet locked error" {
|
@test "test getbalance wallet locked error" {
|
||||||
run ./bisq-cli --password=xyz getbalance
|
run ./haveno-cli --password=xyz getbalance
|
||||||
[ "$status" -eq 1 ]
|
[ "$status" -eq 1 ]
|
||||||
echo "actual output: $output" >&2
|
echo "actual output: $output" >&2
|
||||||
[ "$output" = "Error: wallet is locked" ]
|
[ "$output" = "Error: wallet is locked" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test removewalletpassword" {
|
@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 ]
|
[ "$status" -eq 0 ]
|
||||||
echo "actual output: $output" >&2
|
echo "actual output: $output" >&2
|
||||||
[ "$output" = "wallet decrypted" ]
|
[ "$output" = "wallet decrypted" ]
|
||||||
|
@ -145,17 +145,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test getbalance when wallet available & unlocked with 0 btc balance" {
|
@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 ]
|
[ "$status" -eq 0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test getfundingaddresses" {
|
@test "test getfundingaddresses" {
|
||||||
run ./bisq-cli --password=xyz getfundingaddresses
|
run ./haveno-cli --password=xyz getfundingaddresses
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test getaddressbalance missing address argument" {
|
@test "test getaddressbalance missing address argument" {
|
||||||
run ./bisq-cli --password=xyz getaddressbalance
|
run ./haveno-cli --password=xyz getaddressbalance
|
||||||
[ "$status" -eq 1 ]
|
[ "$status" -eq 1 ]
|
||||||
echo "actual output: $output" >&2
|
echo "actual output: $output" >&2
|
||||||
[ "$output" = "Error: no address specified" ]
|
[ "$output" = "Error: no address specified" ]
|
||||||
|
@ -164,24 +164,24 @@
|
||||||
@test "test getaddressbalance bogus address argument" {
|
@test "test getaddressbalance bogus address argument" {
|
||||||
# Wait 1 second before calling getaddressbalance again.
|
# Wait 1 second before calling getaddressbalance again.
|
||||||
sleep 1
|
sleep 1
|
||||||
run ./bisq-cli --password=xyz getaddressbalance --address=bogus
|
run ./haveno-cli --password=xyz getaddressbalance --address=bogus
|
||||||
[ "$status" -eq 1 ]
|
[ "$status" -eq 1 ]
|
||||||
echo "actual output: $output" >&2
|
echo "actual output: $output" >&2
|
||||||
[ "$output" = "Error: address bogus not found in wallet" ]
|
[ "$output" = "Error: address bogus not found in wallet" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test getpaymentmethods" {
|
@test "test getpaymentmethods" {
|
||||||
run ./bisq-cli --password=xyz getpaymentmethods
|
run ./haveno-cli --password=xyz getpaymentmethods
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test getpaymentaccts" {
|
@test "test getpaymentaccts" {
|
||||||
run ./bisq-cli --password=xyz getpaymentaccts
|
run ./haveno-cli --password=xyz getpaymentaccts
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test getoffers missing direction argument" {
|
@test "test getoffers missing direction argument" {
|
||||||
run ./bisq-cli --password=xyz getoffers
|
run ./haveno-cli --password=xyz getoffers
|
||||||
[ "$status" -eq 1 ]
|
[ "$status" -eq 1 ]
|
||||||
echo "actual output: $output" >&2
|
echo "actual output: $output" >&2
|
||||||
[ "$output" = "Error: no direction (buy|sell) specified" ]
|
[ "$output" = "Error: no direction (buy|sell) specified" ]
|
||||||
|
@ -190,42 +190,42 @@
|
||||||
@test "test getoffers sell eur check return status" {
|
@test "test getoffers sell eur check return status" {
|
||||||
# Wait 1 second before calling getoffers again.
|
# Wait 1 second before calling getoffers again.
|
||||||
sleep 1
|
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 ]
|
[ "$status" -eq 0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test getoffers buy eur check return status" {
|
@test "test getoffers buy eur check return status" {
|
||||||
# Wait 1 second before calling getoffers again.
|
# Wait 1 second before calling getoffers again.
|
||||||
sleep 1
|
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 ]
|
[ "$status" -eq 0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test getoffers sell gbp check return status" {
|
@test "test getoffers sell gbp check return status" {
|
||||||
# Wait 1 second before calling getoffers again.
|
# Wait 1 second before calling getoffers again.
|
||||||
sleep 1
|
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 ]
|
[ "$status" -eq 0 ]
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test help displayed on stderr if no options or arguments" {
|
@test "test help displayed on stderr if no options or arguments" {
|
||||||
run ./bisq-cli
|
run ./haveno-cli
|
||||||
[ "$status" -eq 1 ]
|
[ "$status" -eq 1 ]
|
||||||
[ "${lines[0]}" = "Bisq RPC Client" ]
|
[ "${lines[0]}" = "Haveno RPC Client" ]
|
||||||
[ "${lines[1]}" = "Usage: bisq-cli [options] <method> [params]" ]
|
[ "${lines[1]}" = "Usage: haveno-cli [options] <method> [params]" ]
|
||||||
# TODO add asserts after help text is modified for new endpoints
|
# TODO add asserts after help text is modified for new endpoints
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test --help option" {
|
@test "test --help option" {
|
||||||
run ./bisq-cli --help
|
run ./haveno-cli --help
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ "${lines[0]}" = "Bisq RPC Client" ]
|
[ "${lines[0]}" = "Haveno RPC Client" ]
|
||||||
[ "${lines[1]}" = "Usage: bisq-cli [options] <method> [params]" ]
|
[ "${lines[1]}" = "Usage: haveno-cli [options] <method> [params]" ]
|
||||||
# TODO add asserts after help text is modified for new endpoints
|
# TODO add asserts after help text is modified for new endpoints
|
||||||
}
|
}
|
||||||
|
|
||||||
@test "test takeoffer method --help" {
|
@test "test takeoffer method --help" {
|
||||||
run ./bisq-cli --password=xyz takeoffer --help
|
run ./haveno-cli --password=xyz takeoffer --help
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
[ "${lines[0]}" = "takeoffer" ]
|
[ "${lines[0]}" = "takeoffer" ]
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,14 +12,14 @@
|
||||||
#
|
#
|
||||||
# - Linux or OSX with bash, Java 11-15 (JDK language compatibility 11), and bitcoin-core (v0.19 - v22).
|
# - 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`
|
# Build command: `./gradlew clean build :apitest:installDaoSetup`
|
||||||
#
|
#
|
||||||
# - All supporting nodes must be run locally, in dev/dao/regtest mode:
|
# - All supporting nodes must be run locally, in dev/dao/regtest mode:
|
||||||
# bitcoind, seednode, arbdaemon, alicedaemon, bobdaemon
|
# bitcoind, seednode, arbdaemon, alicedaemon, bobdaemon
|
||||||
#
|
#
|
||||||
# These should be run using the apitest harness. From the root project dir, run:
|
# 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.
|
# - Only regtest btc can be bought or sold with the test payment account.
|
||||||
#
|
#
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# This file must be sourced by the main driver.
|
# 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 ARBITRATOR_PORT=9997
|
||||||
export ALICE_PORT=9998
|
export ALICE_PORT=9998
|
||||||
export BOB_PORT=9999
|
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 "Bob & Alice daemons, and bitcoin-core's bitcoin-cli must be in the system PATH."
|
||||||
echo ""
|
echo ""
|
||||||
echo "From the project's root dir, start all supporting nodes from a terminal:"
|
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;
|
exit 1;
|
||||||
}
|
}
|
||||||
printdate "Checking $APP_HOME for some expected directories and files."
|
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."
|
printdate "Error: Subproject apitest not found, maybe because you are not running the script from the project root dir."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
if [ -f "$APP_HOME/bisq-cli" ]; then
|
if [ -f "$APP_HOME/haveno-cli" ]; then
|
||||||
printdate "The bisq-cli script exists.";
|
printdate "The haveno-cli script exists.";
|
||||||
else
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
printdate "Checking to see local bitcoind is running, and bitcoin-cli is in PATH."
|
printdate "Checking to see local bitcoind is running, and bitcoin-cli is in PATH."
|
||||||
checkbitcoindrunning
|
checkbitcoindrunning
|
||||||
checkbitcoincliinpath
|
checkbitcoincliinpath
|
||||||
printdate "Checking to see bisq servers are running."
|
printdate "Checking to see haveno servers are running."
|
||||||
checkseednoderunning
|
checkseednoderunning
|
||||||
checkarbnoderunning
|
checkarbnoderunning
|
||||||
checkalicenoderunning
|
checkalicenoderunning
|
||||||
|
@ -205,7 +205,7 @@ checkbitcoincliinpath() {
|
||||||
|
|
||||||
checkseednoderunning() {
|
checkseednoderunning() {
|
||||||
if [[ "$LINUX" == "TRUE" ]]; then
|
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."
|
printdate "The seed node is running on host."
|
||||||
else
|
else
|
||||||
printdate "Error: seed node is not running on host, exiting."
|
printdate "Error: seed node is not running on host, exiting."
|
||||||
|
@ -226,14 +226,14 @@ checkseednoderunning() {
|
||||||
|
|
||||||
checkarbnoderunning() {
|
checkarbnoderunning() {
|
||||||
if [[ "$LINUX" == "TRUE" ]]; then
|
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."
|
printdate "The arbitration node is running on host."
|
||||||
else
|
else
|
||||||
printdate "Error: arbitration node is not running on host, exiting."
|
printdate "Error: arbitration node is not running on host, exiting."
|
||||||
apitestusage
|
apitestusage
|
||||||
fi
|
fi
|
||||||
elif [[ "$DARWIN" == "TRUE" ]]; then
|
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."
|
printdate "The arbitration node is running on host."
|
||||||
else
|
else
|
||||||
printdate "Error: arbitration node is not running on host, exiting."
|
printdate "Error: arbitration node is not running on host, exiting."
|
||||||
|
@ -247,14 +247,14 @@ checkarbnoderunning() {
|
||||||
|
|
||||||
checkalicenoderunning() {
|
checkalicenoderunning() {
|
||||||
if [[ "$LINUX" == "TRUE" ]]; then
|
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."
|
printdate "Alice's node is running on host."
|
||||||
else
|
else
|
||||||
printdate "Error: Alice's node is not running on host, exiting."
|
printdate "Error: Alice's node is not running on host, exiting."
|
||||||
apitestusage
|
apitestusage
|
||||||
fi
|
fi
|
||||||
elif [[ "$DARWIN" == "TRUE" ]]; then
|
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."
|
printdate "Alice's node node is running on host."
|
||||||
else
|
else
|
||||||
printdate "Error: Alice's node is not running on host, exiting."
|
printdate "Error: Alice's node is not running on host, exiting."
|
||||||
|
@ -268,14 +268,14 @@ checkalicenoderunning() {
|
||||||
|
|
||||||
checkbobnoderunning() {
|
checkbobnoderunning() {
|
||||||
if [[ "$LINUX" == "TRUE" ]]; then
|
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."
|
printdate "Bob's node is running on host."
|
||||||
else
|
else
|
||||||
printdate "Error: Bob's node is not running on host, exiting."
|
printdate "Error: Bob's node is not running on host, exiting."
|
||||||
apitestusage
|
apitestusage
|
||||||
fi
|
fi
|
||||||
elif [[ "$DARWIN" == "TRUE" ]]; then
|
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."
|
printdate "Bob's node node is running on host."
|
||||||
else
|
else
|
||||||
printdate "Error: Bob's node is not running on host, exiting."
|
printdate "Error: Bob's node is not running on host, exiting."
|
||||||
|
|
|
@ -535,7 +535,7 @@ executetrade() {
|
||||||
printbreak
|
printbreak
|
||||||
|
|
||||||
# Complete the trade on both sides
|
# 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"
|
CMD="$CLI_BASE --port=$BOB_PORT closetrade --trade-id=$OFFER_ID"
|
||||||
printdate "BOB CLI: $CMD"
|
printdate "BOB CLI: $CMD"
|
||||||
KEEP_FUNDS_MSG=$($CMD)
|
KEEP_FUNDS_MSG=$($CMD)
|
||||||
|
@ -545,7 +545,7 @@ executetrade() {
|
||||||
sleeptraced 3
|
sleeptraced 3
|
||||||
printbreak
|
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"
|
CMD="$CLI_BASE --port=$ALICE_PORT closetrade --trade-id=$OFFER_ID"
|
||||||
printdate "ALICE CLI: $CMD"
|
printdate "ALICE CLI: $CMD"
|
||||||
KEEP_FUNDS_MSG=$($CMD)
|
KEEP_FUNDS_MSG=$($CMD)
|
||||||
|
|
|
@ -9,14 +9,14 @@
|
||||||
#
|
#
|
||||||
# - Linux or OSX with bash, Java 11-15 (JDK language compatibility 11), and bitcoin-core (v0.19 - v22).
|
# - 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`
|
# Build command: `./gradlew clean build :apitest:installDaoSetup`
|
||||||
#
|
#
|
||||||
# - All supporting nodes must be run locally, in dev/dao/regtest mode:
|
# - All supporting nodes must be run locally, in dev/dao/regtest mode:
|
||||||
# bitcoind, seednode, arbdaemon, alicedaemon, bobdaemon
|
# bitcoind, seednode, arbdaemon, alicedaemon, bobdaemon
|
||||||
#
|
#
|
||||||
# These should be run using the apitest harness. From the root project dir, run:
|
# 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.
|
# - Only regtest btc can be bought or sold with the test payment account.
|
||||||
#
|
#
|
||||||
|
|
|
@ -6,14 +6,14 @@
|
||||||
#
|
#
|
||||||
# - Linux or OSX with bash, Java 11-15 (JDK language compatibility 11), and bitcoin-core (v0.19 - v22).
|
# - 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`
|
# Build command: `./gradlew clean build :apitest:installDaoSetup`
|
||||||
#
|
#
|
||||||
# - All supporting nodes must be run locally, in dev/dao/regtest mode:
|
# - All supporting nodes must be run locally, in dev/dao/regtest mode:
|
||||||
# bitcoind, seednode, arbdaemon, alicedaemon, bobdaemon
|
# bitcoind, seednode, arbdaemon, alicedaemon, bobdaemon
|
||||||
#
|
#
|
||||||
# These should be run using the apitest harness. From the root project dir, run:
|
# 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:
|
# Usage:
|
||||||
#
|
#
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
|
|
||||||
# Bats helper script for parsing current version from Version.java.
|
# 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')
|
||||||
|
|
|
@ -15,23 +15,21 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest;
|
package haveno.apitest;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import static bisq.apitest.Scaffold.EXIT_FAILURE;
|
import static haveno.apitest.Scaffold.EXIT_FAILURE;
|
||||||
import static bisq.apitest.Scaffold.EXIT_SUCCESS;
|
import static haveno.apitest.Scaffold.EXIT_SUCCESS;
|
||||||
import static bisq.apitest.config.ApiTestRateMeterInterceptorConfig.appendCallRateMeteringConfigPathOpt;
|
import static haveno.apitest.config.ApiTestRateMeterInterceptorConfig.appendCallRateMeteringConfigPathOpt;
|
||||||
import static bisq.apitest.config.ApiTestRateMeterInterceptorConfig.getTestRateMeterInterceptorConfig;
|
import static haveno.apitest.config.ApiTestRateMeterInterceptorConfig.getTestRateMeterInterceptorConfig;
|
||||||
import static bisq.apitest.config.ApiTestRateMeterInterceptorConfig.hasCallRateMeteringConfigPathOpt;
|
import static haveno.apitest.config.ApiTestRateMeterInterceptorConfig.hasCallRateMeteringConfigPathOpt;
|
||||||
import static java.lang.System.err;
|
import static java.lang.System.err;
|
||||||
import static java.lang.System.exit;
|
import static java.lang.System.exit;
|
||||||
|
|
||||||
|
import haveno.apitest.config.ApiTestConfig;
|
||||||
|
|
||||||
import bisq.apitest.config.ApiTestConfig;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ApiTestMain is a placeholder for the gradle build file, which requires a valid
|
* 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 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:
|
* 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.
|
* 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) {
|
} catch (Throwable ex) {
|
||||||
err.println("Fault: An unexpected error occurred. " +
|
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);
|
ex.printStackTrace(err);
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
|
@ -15,11 +15,17 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest;
|
package haveno.apitest;
|
||||||
|
|
||||||
import bisq.common.config.HavenoHelpFormatter;
|
|
||||||
import bisq.common.util.Utilities;
|
|
||||||
|
|
||||||
|
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.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
@ -41,11 +47,11 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
||||||
import static bisq.apitest.config.ApiTestConfig.MEDIATOR;
|
import static haveno.apitest.config.ApiTestConfig.MEDIATOR;
|
||||||
import static bisq.apitest.config.ApiTestConfig.REFUND_AGENT;
|
import static haveno.apitest.config.ApiTestConfig.REFUND_AGENT;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.*;
|
import static haveno.apitest.config.HavenoAppConfig.*;
|
||||||
import static bisq.common.app.DevEnv.DEV_PRIVILEGE_PRIV_KEY;
|
import static haveno.common.app.DevEnv.DEV_PRIVILEGE_PRIV_KEY;
|
||||||
import static java.lang.String.format;
|
import static java.lang.String.format;
|
||||||
import static java.lang.System.exit;
|
import static java.lang.System.exit;
|
||||||
import static java.lang.System.out;
|
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.MILLISECONDS;
|
||||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
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
|
@Slf4j
|
||||||
public class Scaffold {
|
public class Scaffold {
|
||||||
|
|
||||||
|
@ -130,8 +126,8 @@ public class Scaffold {
|
||||||
if (config.helpRequested) {
|
if (config.helpRequested) {
|
||||||
config.printHelp(out,
|
config.printHelp(out,
|
||||||
new HavenoHelpFormatter(
|
new HavenoHelpFormatter(
|
||||||
"Bisq ApiTest",
|
"Haveno ApiTest",
|
||||||
"bisq-apitest",
|
"haveno-apitest",
|
||||||
"0.1.0"));
|
"0.1.0"));
|
||||||
exit(EXIT_SUCCESS);
|
exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
@ -249,7 +245,7 @@ public class Scaffold {
|
||||||
Runtime.getRuntime().addShutdownHook(new Thread(this::tearDown));
|
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,
|
private void startBackgroundProcesses(ExecutorService executor,
|
||||||
CountDownLatch countdownLatch)
|
CountDownLatch countdownLatch)
|
||||||
throws InterruptedException, IOException {
|
throws InterruptedException, IOException {
|
||||||
|
@ -261,7 +257,7 @@ public class Scaffold {
|
||||||
bitcoinDaemon.verifyBitcoinPathsExist(true);
|
bitcoinDaemon.verifyBitcoinPathsExist(true);
|
||||||
bitcoindTask = new SetupTask(bitcoinDaemon, countdownLatch);
|
bitcoindTask = new SetupTask(bitcoinDaemon, countdownLatch);
|
||||||
bitcoindTaskFuture = executor.submit(bitcoindTask);
|
bitcoindTaskFuture = executor.submit(bitcoindTask);
|
||||||
MILLISECONDS.sleep(config.bisqAppInitTime);
|
MILLISECONDS.sleep(config.havenoAppInitTime);
|
||||||
|
|
||||||
LinuxProcess bitcoindProcess = bitcoindTask.getLinuxProcess();
|
LinuxProcess bitcoindProcess = bitcoindTask.getLinuxProcess();
|
||||||
if (bitcoindProcess.hasStartupExceptions()) {
|
if (bitcoindProcess.hasStartupExceptions()) {
|
||||||
|
@ -272,28 +268,28 @@ public class Scaffold {
|
||||||
bitcoinDaemon.verifyBitcoindRunning();
|
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()))
|
if (config.hasSupportingApp(seednode.name()))
|
||||||
startBisqApp(seednode, executor, countdownLatch);
|
startHavenoApp(seednode, executor, countdownLatch);
|
||||||
|
|
||||||
if (config.hasSupportingApp(arbdaemon.name()))
|
if (config.hasSupportingApp(arbdaemon.name()))
|
||||||
startBisqApp(arbdaemon, executor, countdownLatch);
|
startHavenoApp(arbdaemon, executor, countdownLatch);
|
||||||
else if (config.hasSupportingApp(arbdesktop.name()))
|
else if (config.hasSupportingApp(arbdesktop.name()))
|
||||||
startBisqApp(arbdesktop, executor, countdownLatch);
|
startHavenoApp(arbdesktop, executor, countdownLatch);
|
||||||
|
|
||||||
if (config.hasSupportingApp(alicedaemon.name()))
|
if (config.hasSupportingApp(alicedaemon.name()))
|
||||||
startBisqApp(alicedaemon, executor, countdownLatch);
|
startHavenoApp(alicedaemon, executor, countdownLatch);
|
||||||
else if (config.hasSupportingApp(alicedesktop.name()))
|
else if (config.hasSupportingApp(alicedesktop.name()))
|
||||||
startBisqApp(alicedesktop, executor, countdownLatch);
|
startHavenoApp(alicedesktop, executor, countdownLatch);
|
||||||
|
|
||||||
if (config.hasSupportingApp(bobdaemon.name()))
|
if (config.hasSupportingApp(bobdaemon.name()))
|
||||||
startBisqApp(bobdaemon, executor, countdownLatch);
|
startHavenoApp(bobdaemon, executor, countdownLatch);
|
||||||
else if (config.hasSupportingApp(bobdesktop.name()))
|
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,
|
ExecutorService executor,
|
||||||
CountDownLatch countdownLatch)
|
CountDownLatch countdownLatch)
|
||||||
throws IOException, InterruptedException {
|
throws IOException, InterruptedException {
|
||||||
|
@ -322,8 +318,8 @@ public class Scaffold {
|
||||||
default:
|
default:
|
||||||
throw new IllegalStateException("Unknown HavenoAppConfig " + HavenoAppConfig.name());
|
throw new IllegalStateException("Unknown HavenoAppConfig " + HavenoAppConfig.name());
|
||||||
}
|
}
|
||||||
log.info("Giving {} ms for {} to initialize ...", config.bisqAppInitTime, HavenoAppConfig.appName);
|
log.info("Giving {} ms for {} to initialize ...", config.havenoAppInitTime, HavenoAppConfig.appName);
|
||||||
MILLISECONDS.sleep(config.bisqAppInitTime);
|
MILLISECONDS.sleep(config.havenoAppInitTime);
|
||||||
if (HavenoProcess.hasStartupExceptions()) {
|
if (HavenoProcess.hasStartupExceptions()) {
|
||||||
HavenoProcess.logExceptions(HavenoProcess.getStartupExceptions(), log);
|
HavenoProcess.logExceptions(HavenoProcess.getStartupExceptions(), log);
|
||||||
throw new IllegalStateException(HavenoProcess.getStartupExceptions().get(0));
|
throw new IllegalStateException(HavenoProcess.getStartupExceptions().get(0));
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest;
|
package haveno.apitest;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
|
|
||||||
|
@ -28,9 +28,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import static java.lang.String.format;
|
import static java.lang.String.format;
|
||||||
import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||||
|
|
||||||
|
import haveno.apitest.linux.LinuxProcess;
|
||||||
|
|
||||||
import bisq.apitest.linux.LinuxProcess;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class SetupTask implements Callable<SetupTask.Status> {
|
public class SetupTask implements Callable<SetupTask.Status> {
|
|
@ -15,16 +15,13 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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 java.io.IOException;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import bisq.apitest.linux.BashCommand;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
class SmokeTestBashCommand {
|
class SmokeTestBashCommand {
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest;
|
package haveno.apitest;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@ -23,10 +23,8 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import static java.lang.String.format;
|
import static java.lang.String.format;
|
||||||
|
|
||||||
|
import haveno.apitest.config.ApiTestConfig;
|
||||||
|
import haveno.apitest.linux.BitcoinCli;
|
||||||
import bisq.apitest.config.ApiTestConfig;
|
|
||||||
import bisq.apitest.linux.BitcoinCli;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
class SmokeTestBitcoind {
|
class SmokeTestBitcoind {
|
|
@ -15,9 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.config;
|
package haveno.apitest.config;
|
||||||
|
|
||||||
import bisq.common.config.CompositeOptionSet;
|
|
||||||
|
|
||||||
import joptsimple.AbstractOptionSpec;
|
import joptsimple.AbstractOptionSpec;
|
||||||
import joptsimple.ArgumentAcceptingOptionSpec;
|
import joptsimple.ArgumentAcceptingOptionSpec;
|
||||||
|
@ -51,6 +49,8 @@ import static java.util.Arrays.asList;
|
||||||
import static java.util.Arrays.stream;
|
import static java.util.Arrays.stream;
|
||||||
import static joptsimple.internal.Strings.EMPTY;
|
import static joptsimple.internal.Strings.EMPTY;
|
||||||
|
|
||||||
|
import haveno.common.config.CompositeOptionSet;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ApiTestConfig {
|
public class ApiTestConfig {
|
||||||
|
|
||||||
|
@ -76,12 +76,12 @@ public class ApiTestConfig {
|
||||||
static final String ROOT_APP_DATA_DIR = "rootAppDataDir";
|
static final String ROOT_APP_DATA_DIR = "rootAppDataDir";
|
||||||
static final String API_PASSWORD = "apiPassword";
|
static final String API_PASSWORD = "apiPassword";
|
||||||
static final String RUN_SUBPROJECT_JARS = "runSubprojectJars";
|
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 SKIP_TESTS = "skipTests";
|
||||||
static final String SHUTDOWN_AFTER_TESTS = "shutdownAfterTests";
|
static final String SHUTDOWN_AFTER_TESTS = "shutdownAfterTests";
|
||||||
static final String SUPPORTING_APPS = "supportingApps";
|
static final String SUPPORTING_APPS = "supportingApps";
|
||||||
static final String CALL_RATE_METERING_CONFIG_PATH = "callRateMeteringConfigPath";
|
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";
|
static final String REGISTER_DISPUTE_AGENTS = "registerDisputeAgents";
|
||||||
|
|
||||||
// Default values for certain options
|
// 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.
|
// Daemon instances can use same gRPC password, but each needs a different apiPort.
|
||||||
public final String apiPassword;
|
public final String apiPassword;
|
||||||
public final boolean runSubprojectJars;
|
public final boolean runSubprojectJars;
|
||||||
public final long bisqAppInitTime;
|
public final long havenoAppInitTime;
|
||||||
public final boolean skipTests;
|
public final boolean skipTests;
|
||||||
public final boolean shutdownAfterTests;
|
public final boolean shutdownAfterTests;
|
||||||
public final List<String> supportingApps;
|
public final List<String> supportingApps;
|
||||||
public final String callRateMeteringConfigPath;
|
public final String callRateMeteringConfigPath;
|
||||||
public final boolean enableBisqDebugging;
|
public final boolean enableHavenoDebugging;
|
||||||
public final boolean registerDisputeAgents;
|
public final boolean registerDisputeAgents;
|
||||||
|
|
||||||
// Immutable system configurations set in the constructor.
|
// Immutable system configurations set in the constructor.
|
||||||
|
@ -132,7 +132,7 @@ public class ApiTestConfig {
|
||||||
this.userDir = getProperty("user.dir");
|
this.userDir = getProperty("user.dir");
|
||||||
// If running a @Test, the current working directory is the :apitest subproject
|
// If running a @Test, the current working directory is the :apitest subproject
|
||||||
// folder. If running ApiTestMain, the current working directory is the
|
// 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.isRunningTest = Paths.get(userDir).getFileName().toString().equals("apitest");
|
||||||
this.rootProjectDir = isRunningTest
|
this.rootProjectDir = isRunningTest
|
||||||
? Paths.get(userDir).getParent().toFile().getAbsolutePath()
|
? Paths.get(userDir).getParent().toFile().getAbsolutePath()
|
||||||
|
@ -213,9 +213,9 @@ public class ApiTestConfig {
|
||||||
.ofType(Boolean.class)
|
.ofType(Boolean.class)
|
||||||
.defaultsTo(false);
|
.defaultsTo(false);
|
||||||
|
|
||||||
ArgumentAcceptingOptionSpec<Long> bisqAppInitTimeOpt =
|
ArgumentAcceptingOptionSpec<Long> havenoAppInitTimeOpt =
|
||||||
parser.accepts(BISQ_APP_INIT_TIME,
|
parser.accepts(HAVENO_APP_INIT_TIME,
|
||||||
"Amount of time (ms) to wait on a Bisq instance's initialization")
|
"Amount of time (ms) to wait on a Haveno instance's initialization")
|
||||||
.withRequiredArg()
|
.withRequiredArg()
|
||||||
.ofType(Long.class)
|
.ofType(Long.class)
|
||||||
.defaultsTo(5000L);
|
.defaultsTo(5000L);
|
||||||
|
@ -247,9 +247,9 @@ public class ApiTestConfig {
|
||||||
.withRequiredArg()
|
.withRequiredArg()
|
||||||
.defaultsTo(EMPTY);
|
.defaultsTo(EMPTY);
|
||||||
|
|
||||||
ArgumentAcceptingOptionSpec<Boolean> enableBisqDebuggingOpt =
|
ArgumentAcceptingOptionSpec<Boolean> enableHavenoDebuggingOpt =
|
||||||
parser.accepts(ENABLE_BISQ_DEBUGGING,
|
parser.accepts(ENABLE_HAVENO_DEBUGGING,
|
||||||
"Start Bisq apps with remote debug options")
|
"Start Haveno apps with remote debug options")
|
||||||
.withRequiredArg()
|
.withRequiredArg()
|
||||||
.ofType(Boolean.class)
|
.ofType(Boolean.class)
|
||||||
.defaultsTo(false);
|
.defaultsTo(false);
|
||||||
|
@ -311,12 +311,12 @@ public class ApiTestConfig {
|
||||||
this.bitcoinRpcPassword = options.valueOf(bitcoinRpcPasswordOpt);
|
this.bitcoinRpcPassword = options.valueOf(bitcoinRpcPasswordOpt);
|
||||||
this.apiPassword = options.valueOf(apiPasswordOpt);
|
this.apiPassword = options.valueOf(apiPasswordOpt);
|
||||||
this.runSubprojectJars = options.valueOf(runSubprojectJarsOpt);
|
this.runSubprojectJars = options.valueOf(runSubprojectJarsOpt);
|
||||||
this.bisqAppInitTime = options.valueOf(bisqAppInitTimeOpt);
|
this.havenoAppInitTime = options.valueOf(havenoAppInitTimeOpt);
|
||||||
this.skipTests = options.valueOf(skipTestsOpt);
|
this.skipTests = options.valueOf(skipTestsOpt);
|
||||||
this.shutdownAfterTests = options.valueOf(shutdownAfterTestsOpt);
|
this.shutdownAfterTests = options.valueOf(shutdownAfterTestsOpt);
|
||||||
this.supportingApps = asList(options.valueOf(supportingAppsOpt).split(","));
|
this.supportingApps = asList(options.valueOf(supportingAppsOpt).split(","));
|
||||||
this.callRateMeteringConfigPath = options.valueOf(callRateMeteringConfigPathOpt);
|
this.callRateMeteringConfigPath = options.valueOf(callRateMeteringConfigPathOpt);
|
||||||
this.enableBisqDebugging = options.valueOf(enableBisqDebuggingOpt);
|
this.enableHavenoDebugging = options.valueOf(enableHavenoDebuggingOpt);
|
||||||
this.registerDisputeAgents = options.valueOf(registerDisputeAgentsOpt);
|
this.registerDisputeAgents = options.valueOf(registerDisputeAgentsOpt);
|
||||||
|
|
||||||
// Assign values to special-case static fields.
|
// Assign values to special-case static fields.
|
|
@ -1,19 +1,17 @@
|
||||||
package bisq.apitest.config;
|
package haveno.apitest.config;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import static bisq.apitest.config.ApiTestConfig.CALL_RATE_METERING_CONFIG_PATH;
|
import static haveno.proto.grpc.DisputeAgentsGrpc.getRegisterDisputeAgentMethod;
|
||||||
import static bisq.proto.grpc.DisputeAgentsGrpc.getRegisterDisputeAgentMethod;
|
import static haveno.proto.grpc.GetVersionGrpc.getGetVersionMethod;
|
||||||
import static bisq.proto.grpc.GetVersionGrpc.getGetVersionMethod;
|
import static haveno.apitest.config.ApiTestConfig.CALL_RATE_METERING_CONFIG_PATH;
|
||||||
import static java.lang.System.arraycopy;
|
import static java.lang.System.arraycopy;
|
||||||
import static java.util.Arrays.stream;
|
import static java.util.Arrays.stream;
|
||||||
import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||||
|
|
||||||
|
import haveno.daemon.grpc.GrpcVersionService;
|
||||||
|
import haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig;
|
||||||
import bisq.daemon.grpc.GrpcVersionService;
|
|
||||||
import bisq.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig;
|
|
||||||
|
|
||||||
public class ApiTestRateMeterInterceptorConfig {
|
public class ApiTestRateMeterInterceptorConfig {
|
||||||
|
|
|
@ -15,72 +15,68 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.config;
|
package haveno.apitest.config;
|
||||||
|
|
||||||
import bisq.seednode.SeedNodeMain;
|
import haveno.daemon.app.HavenoDaemonMain;
|
||||||
|
import haveno.desktop.app.HavenoAppMain;
|
||||||
import bisq.desktop.app.HavenoAppMain;
|
import haveno.seednode.SeedNodeMain;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import bisq.daemon.app.HavenoDaemonMain;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
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>
|
@see <a href="https://github.com/bisq-network/bisq/blob/master/docs/dev-setup.md">dev-setup.md</a>
|
||||||
*/
|
*/
|
||||||
public enum HavenoAppConfig {
|
public enum HavenoAppConfig {
|
||||||
|
|
||||||
seednode("bisq-XMR_STAGENET_Seed_2002",
|
seednode("haveno-XMR_STAGENET_Seed_2002",
|
||||||
"bisq-seednode",
|
"haveno-seednode",
|
||||||
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
||||||
SeedNodeMain.class.getName(),
|
SeedNodeMain.class.getName(),
|
||||||
2002,
|
2002,
|
||||||
5120,
|
5120,
|
||||||
-1,
|
-1,
|
||||||
49996),
|
49996),
|
||||||
arbdaemon("bisq-XMR_STAGENET_Arb",
|
arbdaemon("haveno-XMR_STAGENET_Arb",
|
||||||
"bisq-daemon",
|
"haveno-daemon",
|
||||||
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
||||||
HavenoDaemonMain.class.getName(),
|
HavenoDaemonMain.class.getName(),
|
||||||
4444,
|
4444,
|
||||||
5121,
|
5121,
|
||||||
9997,
|
9997,
|
||||||
49997),
|
49997),
|
||||||
arbdesktop("bisq-XMR_STAGENET_Arb",
|
arbdesktop("haveno-XMR_STAGENET_Arb",
|
||||||
"bisq-desktop",
|
"haveno-desktop",
|
||||||
"-XX:MaxRAM=3g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
"-XX:MaxRAM=3g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
||||||
HavenoAppMain.class.getName(),
|
HavenoAppMain.class.getName(),
|
||||||
4444,
|
4444,
|
||||||
5121,
|
5121,
|
||||||
-1,
|
-1,
|
||||||
49997),
|
49997),
|
||||||
alicedaemon("bisq-XMR_STAGENET_Alice",
|
alicedaemon("haveno-XMR_STAGENET_Alice",
|
||||||
"bisq-daemon",
|
"haveno-daemon",
|
||||||
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
||||||
HavenoDaemonMain.class.getName(),
|
HavenoDaemonMain.class.getName(),
|
||||||
7777,
|
7777,
|
||||||
5122,
|
5122,
|
||||||
9998,
|
9998,
|
||||||
49998),
|
49998),
|
||||||
alicedesktop("bisq-XMR_STAGENET_Alice",
|
alicedesktop("haveno-XMR_STAGENET_Alice",
|
||||||
"bisq-desktop",
|
"haveno-desktop",
|
||||||
"-XX:MaxRAM=4g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
"-XX:MaxRAM=4g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
||||||
HavenoAppMain.class.getName(),
|
HavenoAppMain.class.getName(),
|
||||||
7777,
|
7777,
|
||||||
5122,
|
5122,
|
||||||
-1,
|
-1,
|
||||||
49998),
|
49998),
|
||||||
bobdaemon("bisq-XMR_STAGENET_Bob",
|
bobdaemon("haveno-XMR_STAGENET_Bob",
|
||||||
"bisq-daemon",
|
"haveno-daemon",
|
||||||
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
"-XX:MaxRAM=2g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
||||||
HavenoDaemonMain.class.getName(),
|
HavenoDaemonMain.class.getName(),
|
||||||
8888,
|
8888,
|
||||||
5123,
|
5123,
|
||||||
9999,
|
9999,
|
||||||
49999),
|
49999),
|
||||||
bobdesktop("bisq-XMR_STAGENET_Bob",
|
bobdesktop("haveno-XMR_STAGENET_Bob",
|
||||||
"bisq-desktop",
|
"haveno-desktop",
|
||||||
"-XX:MaxRAM=4g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
"-XX:MaxRAM=4g -Dlogback.configurationFile=apitest/build/resources/main/logback.xml",
|
||||||
HavenoAppMain.class.getName(),
|
HavenoAppMain.class.getName(),
|
||||||
8888,
|
8888,
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.linux;
|
package haveno.apitest.linux;
|
||||||
|
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
|
@ -27,13 +27,11 @@ import java.util.List;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
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.lang.String.format;
|
||||||
import static joptsimple.internal.Strings.EMPTY;
|
import static joptsimple.internal.Strings.EMPTY;
|
||||||
|
|
||||||
|
import haveno.apitest.config.ApiTestConfig;
|
||||||
|
|
||||||
import bisq.apitest.config.ApiTestConfig;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
abstract class AbstractLinuxProcess implements LinuxProcess {
|
abstract class AbstractLinuxProcess implements LinuxProcess {
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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.IOException;
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
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;
|
import static java.lang.management.ManagementFactory.getRuntimeMXBean;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
|
@ -15,16 +15,13 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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 java.io.IOException;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import bisq.apitest.config.ApiTestConfig;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class BitcoinCli extends AbstractLinuxProcess implements LinuxProcess {
|
public class BitcoinCli extends AbstractLinuxProcess implements LinuxProcess {
|
||||||
|
|
|
@ -15,20 +15,18 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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.IOException;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
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.lang.String.format;
|
||||||
import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||||
import static joptsimple.internal.Strings.EMPTY;
|
import static joptsimple.internal.Strings.EMPTY;
|
||||||
|
|
||||||
|
import haveno.apitest.config.ApiTestConfig;
|
||||||
|
|
||||||
import bisq.apitest.config.ApiTestConfig;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class BitcoinDaemon extends AbstractLinuxProcess implements LinuxProcess {
|
public class BitcoinDaemon extends AbstractLinuxProcess implements LinuxProcess {
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.linux;
|
package haveno.apitest.linux;
|
||||||
|
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
|
@ -27,18 +27,16 @@ import java.util.List;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
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.lang.String.format;
|
||||||
import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||||
|
|
||||||
|
import haveno.apitest.config.ApiTestConfig;
|
||||||
|
import haveno.apitest.config.HavenoAppConfig;
|
||||||
import bisq.apitest.config.ApiTestConfig;
|
import haveno.daemon.app.HavenoDaemonMain;
|
||||||
import bisq.apitest.config.HavenoAppConfig;
|
|
||||||
import bisq.daemon.app.HavenoDaemonMain;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Runs a regtest/dao Bisq application instance in the background.
|
* Runs a regtest/dao Haveno application instance in the background.
|
||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class HavenoProcess extends AbstractLinuxProcess implements LinuxProcess {
|
public class HavenoProcess extends AbstractLinuxProcess implements LinuxProcess {
|
||||||
|
@ -50,7 +48,7 @@ public class HavenoProcess extends AbstractLinuxProcess implements LinuxProcess
|
||||||
private final String seedNodes;
|
private final String seedNodes;
|
||||||
private final boolean useLocalhostForP2P;
|
private final boolean useLocalhostForP2P;
|
||||||
public final boolean useDevPrivilegeKeys;
|
public final boolean useDevPrivilegeKeys;
|
||||||
private final String findBisqPidScript;
|
private final String findHavenoPidScript;
|
||||||
private final String debugOpts;
|
private final String debugOpts;
|
||||||
|
|
||||||
public HavenoProcess(HavenoAppConfig havenoAppConfig, ApiTestConfig config) {
|
public HavenoProcess(HavenoAppConfig havenoAppConfig, ApiTestConfig config) {
|
||||||
|
@ -62,9 +60,9 @@ public class HavenoProcess extends AbstractLinuxProcess implements LinuxProcess
|
||||||
this.seedNodes = "localhost:2002";
|
this.seedNodes = "localhost:2002";
|
||||||
this.useLocalhostForP2P = true;
|
this.useLocalhostForP2P = true;
|
||||||
this.useDevPrivilegeKeys = true;
|
this.useDevPrivilegeKeys = true;
|
||||||
this.findBisqPidScript = (config.isRunningTest ? "." : "./apitest")
|
this.findHavenoPidScript = (config.isRunningTest ? "." : "./apitest")
|
||||||
+ "/scripts/get-bisq-pid.sh";
|
+ "/scripts/get-haveno-pid.sh";
|
||||||
this.debugOpts = config.enableBisqDebugging
|
this.debugOpts = config.enableHavenoDebugging
|
||||||
? " -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:" + havenoAppConfig.remoteDebugPort
|
? " -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)
|
if (config.runSubprojectJars)
|
||||||
runJar(); // run subproject/build/lib/*.jar (not full build)
|
runJar(); // run subproject/build/lib/*.jar (not full build)
|
||||||
else
|
else
|
||||||
runStartupScript(); // run bisq-* script for end to end test (default)
|
runStartupScript(); // run haveno-* script for end to end test (default)
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
startupExceptions.add(t);
|
startupExceptions.add(t);
|
||||||
}
|
}
|
||||||
|
@ -120,7 +118,7 @@ public class HavenoProcess extends AbstractLinuxProcess implements LinuxProcess
|
||||||
}
|
}
|
||||||
|
|
||||||
public void verifyAppNotRunning() throws IOException, InterruptedException {
|
public void verifyAppNotRunning() throws IOException, InterruptedException {
|
||||||
long pid = findBisqAppPid();
|
long pid = findHavenoAppPid();
|
||||||
if (pid >= 0)
|
if (pid >= 0)
|
||||||
throw new IllegalStateException(format("%s %s already running with pid %d",
|
throw new IllegalStateException(format("%s %s already running with pid %d",
|
||||||
havenoAppConfig.mainClassName, havenoAppConfig.appName, pid));
|
havenoAppConfig.mainClassName, havenoAppConfig.appName, pid));
|
||||||
|
@ -134,8 +132,8 @@ public class HavenoProcess extends AbstractLinuxProcess implements LinuxProcess
|
||||||
case alicedesktop:
|
case alicedesktop:
|
||||||
case bobdaemon:
|
case bobdaemon:
|
||||||
case bobdesktop:
|
case bobdesktop:
|
||||||
File bisqDataDir = new File(config.rootAppDataDir, havenoAppConfig.appName);
|
File havenoDataDir = new File(config.rootAppDataDir, havenoAppConfig.appName);
|
||||||
if (!bisqDataDir.exists())
|
if (!havenoDataDir.exists())
|
||||||
throw new IllegalStateException(format("Application dataDir %s/%s not found",
|
throw new IllegalStateException(format("Application dataDir %s/%s not found",
|
||||||
config.rootAppDataDir, havenoAppConfig.appName));
|
config.rootAppDataDir, havenoAppConfig.appName));
|
||||||
break;
|
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).
|
// 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. Bisq jars are loaded
|
// It runs a java cmd, and does not depend on a full build. Haveno jars are loaded
|
||||||
// from the :subproject/build/libs directories.
|
// from the :subproject/build/libs directories.
|
||||||
private void runJar() throws IOException, InterruptedException {
|
private void runJar() throws IOException, InterruptedException {
|
||||||
String java = getJavaExecutable().getAbsolutePath();
|
String java = getJavaExecutable().getAbsolutePath();
|
||||||
String classpath = System.getProperty("java.class.path");
|
String classpath = System.getProperty("java.class.path");
|
||||||
String bisqCmd = getJavaOptsSpec()
|
String havenoCmd = getJavaOptsSpec()
|
||||||
+ " " + java + " -cp " + classpath
|
+ " " + java + " -cp " + classpath
|
||||||
+ " " + havenoAppConfig.mainClassName
|
+ " " + havenoAppConfig.mainClassName
|
||||||
+ " " + String.join(" ", getOptsList())
|
+ " " + String.join(" ", getOptsList())
|
||||||
+ " &"; // run in background without nohup
|
+ " &"; // run in background without nohup
|
||||||
runBashCommand(bisqCmd);
|
runBashCommand(havenoCmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is the default way of running a Bisq app (--runSubprojectJars=false).
|
// This is the default way of running a Haveno app (--runSubprojectJars=false).
|
||||||
// It runs a bisq-* startup script, and depends on a full build. Bisq jars
|
// It runs a haveno-* startup script, and depends on a full build. Haveno jars
|
||||||
// are loaded from the root project's lib directory.
|
// are loaded from the root project's lib directory.
|
||||||
private void runStartupScript() throws IOException, InterruptedException {
|
private void runStartupScript() throws IOException, InterruptedException {
|
||||||
String startupScriptPath = config.rootProjectDir
|
String startupScriptPath = config.rootProjectDir
|
||||||
+ "/" + havenoAppConfig.startupScript;
|
+ "/" + havenoAppConfig.startupScript;
|
||||||
String bisqCmd = getJavaOptsSpec()
|
String havenoCmd = getJavaOptsSpec()
|
||||||
+ " " + startupScriptPath
|
+ " " + startupScriptPath
|
||||||
+ " " + String.join(" ", getOptsList())
|
+ " " + String.join(" ", getOptsList())
|
||||||
+ " &"; // run in background without nohup
|
+ " &"; // 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
|
String cmdDescription = config.runSubprojectJars
|
||||||
? "java -> " + havenoAppConfig.mainClassName + " -> " + havenoAppConfig.appName
|
? "java -> " + havenoAppConfig.mainClassName + " -> " + havenoAppConfig.appName
|
||||||
: havenoAppConfig.startupScript + " -> " + havenoAppConfig.appName;
|
: havenoAppConfig.startupScript + " -> " + havenoAppConfig.appName;
|
||||||
BashCommand bashCommand = new BashCommand(bisqCmd);
|
BashCommand bashCommand = new BashCommand(havenoCmd);
|
||||||
log.info("Starting {} ...\n$ {}", cmdDescription, bashCommand.getCommand());
|
log.info("Starting {} ...\n$ {}", cmdDescription, bashCommand.getCommand());
|
||||||
bashCommand.runInBackground();
|
bashCommand.runInBackground();
|
||||||
|
|
||||||
if (bashCommand.getExitStatus() != 0)
|
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,
|
havenoAppConfig.appName,
|
||||||
bashCommand.getError()));
|
bashCommand.getError()));
|
||||||
|
|
||||||
// Sometimes it takes a little extra time to find the linux process id.
|
// 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.
|
// Wait up to two seconds before giving up and throwing an Exception.
|
||||||
for (int i = 0; i < 4; i++) {
|
for (int i = 0; i < 4; i++) {
|
||||||
pid = findBisqAppPid();
|
pid = findHavenoAppPid();
|
||||||
if (pid != -1)
|
if (pid != -1)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -197,12 +195,12 @@ public class HavenoProcess extends AbstractLinuxProcess implements LinuxProcess
|
||||||
throw new IllegalStateException(format("Error finding pid for %s", this.name));
|
throw new IllegalStateException(format("Error finding pid for %s", this.name));
|
||||||
|
|
||||||
log.info("{} running with pid {}", cmdDescription, pid);
|
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.
|
// 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();
|
String psCmdOutput = new BashCommand(findPidCmd).run().getOutput();
|
||||||
return (psCmdOutput == null || psCmdOutput.isEmpty()) ? -1 : Long.parseLong(psCmdOutput);
|
return (psCmdOutput == null || psCmdOutput.isEmpty()) ? -1 : Long.parseLong(psCmdOutput);
|
||||||
}
|
}
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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.IOException;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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.BufferedReader;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
# Regtest ports start with 512*
|
# 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
|
# SeedNode listens on port 5120
|
||||||
echo $1 | nc -w 1 127.0.0.1 5120
|
echo $1 | nc -w 1 127.0.0.1 5120
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
The :daemon & :cli jars contain their own logback.xml config files, which causes chatty logback startup.
|
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:
|
To avoid chatty logback msgs during its configuration, pass logback.configurationFile as a system property:
|
||||||
-Dlogback.configurationFile=apitest/build/resources/main/logback.xml
|
-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">
|
<appender name="CONSOLE_APPENDER" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
<encoder>
|
<encoder>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest;
|
package haveno.apitest;
|
||||||
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
|
|
||||||
|
@ -30,32 +30,31 @@ import javax.annotation.Nullable;
|
||||||
|
|
||||||
import org.junit.jupiter.api.TestInfo;
|
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 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.net.InetAddress.getLoopbackAddress;
|
||||||
import static java.util.Arrays.stream;
|
import static java.util.Arrays.stream;
|
||||||
|
|
||||||
|
import haveno.apitest.Scaffold;
|
||||||
|
import haveno.apitest.config.ApiTestConfig;
|
||||||
import bisq.apitest.config.ApiTestConfig;
|
import haveno.apitest.method.BitcoinCliHelper;
|
||||||
import bisq.apitest.method.BitcoinCliHelper;
|
import haveno.cli.GrpcClient;
|
||||||
import bisq.cli.GrpcClient;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base class for all test types: 'method', 'scenario' and 'e2e'.
|
* Base class for all test types: 'method', 'scenario' and 'e2e'.
|
||||||
* <p>
|
* <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
|
* 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
|
* 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>
|
* <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>.
|
* and <a href="https://github.com/bisq-network/bisq/blob/master/docs/dao-setup.md">dao-setup.md</a>.
|
||||||
* <p>
|
* <p>
|
||||||
* Those documents contain information about the configurations used by this test harness:
|
* 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
|
* transaction id, initial BTC balances for Bob & Alice accounts, and Bob and
|
||||||
* Alice's default payment accounts.
|
* Alice's default payment accounts.
|
||||||
* <p>
|
* <p>
|
||||||
|
@ -88,7 +87,7 @@ public class ApiTestCase {
|
||||||
String[] params = new String[]{
|
String[] params = new String[]{
|
||||||
"--supportingApps", stream(supportingApps).map(Enum::name).collect(Collectors.joining(",")),
|
"--supportingApps", stream(supportingApps).map(Enum::name).collect(Collectors.joining(",")),
|
||||||
"--callRateMeteringConfigPath", getTestRateMeterInterceptorConfig().getAbsolutePath(),
|
"--callRateMeteringConfigPath", getTestRateMeterInterceptorConfig().getAbsolutePath(),
|
||||||
"--enableBisqDebugging", "false"
|
"--enableHavenoDebugging", "false"
|
||||||
};
|
};
|
||||||
setUpScaffold(params);
|
setUpScaffold(params);
|
||||||
}
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package bisq.apitest;
|
package haveno.apitest;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
|
@ -15,17 +15,15 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.method;
|
package haveno.apitest.method;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import static java.lang.String.format;
|
import static java.lang.String.format;
|
||||||
import static org.junit.jupiter.api.Assertions.fail;
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
|
|
||||||
|
import haveno.apitest.config.ApiTestConfig;
|
||||||
|
import haveno.apitest.linux.BitcoinCli;
|
||||||
import bisq.apitest.config.ApiTestConfig;
|
|
||||||
import bisq.apitest.linux.BitcoinCli;
|
|
||||||
|
|
||||||
public final class BitcoinCliHelper {
|
public final class BitcoinCliHelper {
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.method;
|
package haveno.apitest.method;
|
||||||
|
|
||||||
import io.grpc.StatusRuntimeException;
|
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.Test;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
|
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.method;
|
package haveno.apitest.method;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
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.Test;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
|
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
|
||||||
import static bisq.cli.Method.createoffer;
|
import static haveno.cli.Method.createoffer;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||||
import static org.junit.jupiter.api.Assertions.fail;
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
|
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.method;
|
package haveno.apitest.method;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
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.Test;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
|
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
|
||||||
import static bisq.common.app.Version.VERSION;
|
import static haveno.common.app.Version.VERSION;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.fail;
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
|
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
|
|
@ -15,17 +15,18 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.method;
|
package haveno.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;
|
|
||||||
|
|
||||||
|
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.Status;
|
||||||
import io.grpc.StatusRuntimeException;
|
import io.grpc.StatusRuntimeException;
|
||||||
|
|
||||||
|
@ -43,22 +44,15 @@ import org.slf4j.Logger;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
import javax.annotation.Nullable;
|
||||||
|
|
||||||
import static bisq.apitest.config.ApiTestConfig.BTC;
|
import static haveno.apitest.config.ApiTestConfig.BTC;
|
||||||
import static bisq.apitest.config.ApiTestRateMeterInterceptorConfig.getTestRateMeterInterceptorConfig;
|
import static haveno.apitest.config.ApiTestRateMeterInterceptorConfig.getTestRateMeterInterceptorConfig;
|
||||||
import static bisq.cli.table.builder.TableType.BTC_BALANCE_TBL;
|
import static haveno.cli.table.builder.TableType.BTC_BALANCE_TBL;
|
||||||
import static bisq.core.btc.wallet.Restrictions.getDefaultBuyerSecurityDepositAsPercent;
|
import static haveno.core.btc.wallet.Restrictions.getDefaultBuyerSecurityDepositAsPercent;
|
||||||
import static java.lang.String.format;
|
import static java.lang.String.format;
|
||||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
import static java.util.Arrays.stream;
|
import static java.util.Arrays.stream;
|
||||||
import static org.junit.jupiter.api.Assertions.fail;
|
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 {
|
public class MethodTest extends ApiTestCase {
|
||||||
|
|
||||||
protected static final CoreProtoResolver CORE_PROTO_RESOLVER = new CoreProtoResolver();
|
protected static final CoreProtoResolver CORE_PROTO_RESOLVER = new CoreProtoResolver();
|
||||||
|
@ -74,7 +68,7 @@ public class MethodTest extends ApiTestCase {
|
||||||
setUpScaffold(new String[]{
|
setUpScaffold(new String[]{
|
||||||
"--supportingApps", toNameList.apply(supportingApps),
|
"--supportingApps", toNameList.apply(supportingApps),
|
||||||
"--callRateMeteringConfigPath", callRateMeteringConfigFile.getAbsolutePath(),
|
"--callRateMeteringConfigPath", callRateMeteringConfigFile.getAbsolutePath(),
|
||||||
"--enableBisqDebugging", startSupportingAppsInDebugMode ? "true" : "false"
|
"--enableHavenoDebugging", startSupportingAppsInDebugMode ? "true" : "false"
|
||||||
});
|
});
|
||||||
doPostStartup(generateBtcBlock);
|
doPostStartup(generateBtcBlock);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
@ -91,7 +85,7 @@ public class MethodTest extends ApiTestCase {
|
||||||
setUpScaffold(new String[]{
|
setUpScaffold(new String[]{
|
||||||
"--supportingApps", toNameList.apply(supportingApps),
|
"--supportingApps", toNameList.apply(supportingApps),
|
||||||
"--callRateMeteringConfigPath", callRateMeteringConfigFile.getAbsolutePath(),
|
"--callRateMeteringConfigPath", callRateMeteringConfigFile.getAbsolutePath(),
|
||||||
"--enableBisqDebugging", startSupportingAppsInDebugMode ? "true" : "false"
|
"--enableHavenoDebugging", startSupportingAppsInDebugMode ? "true" : "false"
|
||||||
});
|
});
|
||||||
doPostStartup(generateBtcBlock);
|
doPostStartup(generateBtcBlock);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
@ -108,7 +102,7 @@ public class MethodTest extends ApiTestCase {
|
||||||
|
|
||||||
protected final File getPaymentAccountForm(GrpcClient grpcClient, String paymentMethodId) {
|
protected final File getPaymentAccountForm(GrpcClient grpcClient, String paymentMethodId) {
|
||||||
// We take seemingly unnecessary steps to get a File object, but the point is to
|
// 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).
|
// for an empty json form (file).
|
||||||
String jsonString = grpcClient.getPaymentAcctFormAsJson(paymentMethodId);
|
String jsonString = grpcClient.getPaymentAcctFormAsJson(paymentMethodId);
|
||||||
// Write the json string to a file here in the test case.
|
// 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 countryCode) {
|
||||||
String f2fAccountJsonString = "{\n" +
|
String f2fAccountJsonString = "{\n" +
|
||||||
" \"_COMMENTS_\": \"This is a dummy account.\",\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 holderName,
|
||||||
String nationalAccountId,
|
String nationalAccountId,
|
||||||
String holderTaxId) {
|
String holderTaxId) {
|
||||||
|
@ -159,12 +153,12 @@ public class MethodTest extends ApiTestCase {
|
||||||
return nationalBankAccount;
|
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
|
// 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.
|
// sub-type.
|
||||||
var paymentAccount = grpcClient.createPaymentAccount(jsonString);
|
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 = () -> {
|
public static final Supplier<Double> defaultBuyerSecurityDepositPct = () -> {
|
||||||
|
@ -214,7 +208,7 @@ public class MethodTest extends ApiTestCase {
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
protected static String getNodeExceptionMessages() {
|
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 grep = "grep Exception " + nodeLogsSpec;
|
||||||
var bashCommand = new BashCommand(grep);
|
var bashCommand = new BashCommand(grep);
|
||||||
try {
|
try {
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.method;
|
package haveno.apitest.method;
|
||||||
|
|
||||||
import io.grpc.StatusRuntimeException;
|
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.Test;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
||||||
import static bisq.apitest.config.ApiTestConfig.ARBITRATOR;
|
import static haveno.apitest.config.ApiTestConfig.ARBITRATOR;
|
||||||
import static bisq.apitest.config.ApiTestConfig.MEDIATOR;
|
import static haveno.apitest.config.ApiTestConfig.MEDIATOR;
|
||||||
import static bisq.apitest.config.ApiTestConfig.REFUND_AGENT;
|
import static haveno.apitest.config.ApiTestConfig.REFUND_AGENT;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.arbdaemon;
|
import static haveno.apitest.config.HavenoAppConfig.arbdaemon;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.seednode;
|
import static haveno.apitest.config.HavenoAppConfig.seednode;
|
||||||
import static bisq.common.app.DevEnv.DEV_PRIVILEGE_PRIV_KEY;
|
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.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
import static org.junit.jupiter.api.Assertions.fail;
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
|
@ -61,7 +61,7 @@ public class RegisterDisputeAgentsTest extends MethodTest {
|
||||||
public void testRegisterArbitratorShouldThrowException() {
|
public void testRegisterArbitratorShouldThrowException() {
|
||||||
Throwable exception = assertThrows(StatusRuntimeException.class, () ->
|
Throwable exception = assertThrows(StatusRuntimeException.class, () ->
|
||||||
arbClient.registerDisputeAgent(ARBITRATOR, DEV_PRIVILEGE_PRIV_KEY));
|
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());
|
exception.getMessage());
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,10 +15,12 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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 haveno.apitest.method.MethodTest;
|
||||||
|
import haveno.cli.CliMain;
|
||||||
|
import haveno.cli.table.builder.TableBuilder;
|
||||||
import protobuf.PaymentAccount;
|
import protobuf.PaymentAccount;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
@ -33,22 +35,16 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
import org.junit.jupiter.api.AfterAll;
|
import org.junit.jupiter.api.AfterAll;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
|
|
||||||
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
||||||
import static bisq.apitest.config.ApiTestConfig.XMR;
|
import static haveno.apitest.config.ApiTestConfig.XMR;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
|
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.arbdaemon;
|
import static haveno.apitest.config.HavenoAppConfig.arbdaemon;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.bobdaemon;
|
import static haveno.apitest.config.HavenoAppConfig.bobdaemon;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.seednode;
|
import static haveno.apitest.config.HavenoAppConfig.seednode;
|
||||||
import static bisq.cli.table.builder.TableType.OFFER_TBL;
|
import static haveno.cli.table.builder.TableType.OFFER_TBL;
|
||||||
import static java.lang.String.format;
|
import static java.lang.String.format;
|
||||||
import static java.lang.System.out;
|
import static java.lang.System.out;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import bisq.apitest.method.MethodTest;
|
|
||||||
import bisq.cli.CliMain;
|
|
||||||
import bisq.cli.table.builder.TableBuilder;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public abstract class AbstractOfferTest extends MethodTest {
|
public abstract class AbstractOfferTest extends MethodTest {
|
||||||
|
|
|
@ -15,12 +15,10 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.method.offer;
|
package haveno.apitest.method.offer;
|
||||||
|
|
||||||
import bisq.core.payment.PaymentAccount;
|
|
||||||
|
|
||||||
import bisq.proto.grpc.OfferInfo;
|
|
||||||
|
|
||||||
|
import haveno.proto.grpc.OfferInfo;
|
||||||
|
import haveno.core.payment.PaymentAccount;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
|
@ -15,9 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.method.offer;
|
package haveno.apitest.method.offer;
|
||||||
|
|
||||||
import bisq.core.payment.PaymentAccount;
|
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
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.Test;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
import static bisq.apitest.config.ApiTestConfig.XMR;
|
import static haveno.apitest.config.ApiTestConfig.EUR;
|
||||||
import static bisq.apitest.config.ApiTestConfig.EUR;
|
import static haveno.apitest.config.ApiTestConfig.USD;
|
||||||
import static bisq.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.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
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.BUY;
|
||||||
import static protobuf.OfferDirection.SELL;
|
import static protobuf.OfferDirection.SELL;
|
||||||
|
|
||||||
|
import haveno.core.payment.PaymentAccount;
|
||||||
|
|
||||||
@Disabled
|
@Disabled
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
|
@ -15,12 +15,10 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.method.offer;
|
package haveno.apitest.method.offer;
|
||||||
|
|
||||||
import bisq.core.payment.PaymentAccount;
|
|
||||||
|
|
||||||
import bisq.proto.grpc.OfferInfo;
|
|
||||||
|
|
||||||
|
import haveno.proto.grpc.OfferInfo;
|
||||||
|
import haveno.core.payment.PaymentAccount;
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
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.Test;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
import static bisq.apitest.config.ApiTestConfig.BTC;
|
import static haveno.apitest.config.ApiTestConfig.BTC;
|
||||||
import static bisq.apitest.config.ApiTestConfig.USD;
|
import static haveno.apitest.config.ApiTestConfig.USD;
|
||||||
import static bisq.common.util.MathUtils.roundDouble;
|
import static haveno.common.util.MathUtils.roundDouble;
|
||||||
import static bisq.common.util.MathUtils.scaleDownByPowerOf10;
|
import static haveno.common.util.MathUtils.scaleDownByPowerOf10;
|
||||||
import static bisq.common.util.MathUtils.scaleUpByPowerOf10;
|
import static haveno.common.util.MathUtils.scaleUpByPowerOf10;
|
||||||
import static java.lang.Math.abs;
|
import static java.lang.Math.abs;
|
||||||
import static java.lang.String.format;
|
import static java.lang.String.format;
|
||||||
import static java.math.RoundingMode.HALF_UP;
|
import static java.math.RoundingMode.HALF_UP;
|
|
@ -15,9 +15,9 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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;
|
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.Test;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
import static bisq.apitest.config.ApiTestConfig.BTC;
|
import static haveno.apitest.config.ApiTestConfig.BTC;
|
||||||
import static bisq.apitest.config.ApiTestConfig.XMR;
|
import static haveno.apitest.config.ApiTestConfig.XMR;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
|
@ -15,9 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.method.offer;
|
package haveno.apitest.method.offer;
|
||||||
|
|
||||||
import bisq.core.payment.PaymentAccount;
|
|
||||||
|
|
||||||
import io.grpc.StatusRuntimeException;
|
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.Test;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
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 java.lang.String.format;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
import static protobuf.OfferDirection.BUY;
|
import static protobuf.OfferDirection.BUY;
|
||||||
|
|
||||||
|
import haveno.core.payment.PaymentAccount;
|
||||||
|
|
||||||
@Disabled
|
@Disabled
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
|
@ -1,15 +1,15 @@
|
||||||
package bisq.apitest.method.payment;
|
package haveno.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;
|
|
||||||
|
|
||||||
import com.google.gson.Gson;
|
import com.google.gson.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
import com.google.gson.stream.JsonWriter;
|
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.nio.file.Paths;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -36,11 +36,6 @@ import static java.lang.System.getProperty;
|
||||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import bisq.apitest.method.MethodTest;
|
|
||||||
import bisq.cli.GrpcClient;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class AbstractPaymentAccountTest extends MethodTest {
|
public class AbstractPaymentAccountTest extends MethodTest {
|
||||||
|
|
|
@ -15,48 +15,48 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.method.payment;
|
package haveno.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;
|
|
||||||
|
|
||||||
|
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 io.grpc.StatusRuntimeException;
|
||||||
|
|
||||||
import java.io.File;
|
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.TestInfo;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
||||||
import static bisq.apitest.config.ApiTestConfig.EUR;
|
import static haveno.apitest.config.ApiTestConfig.EUR;
|
||||||
import static bisq.apitest.config.ApiTestConfig.USD;
|
import static haveno.apitest.config.ApiTestConfig.USD;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
|
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
|
||||||
import static bisq.cli.table.builder.TableType.PAYMENT_ACCOUNT_TBL;
|
import static haveno.cli.table.builder.TableType.PAYMENT_ACCOUNT_TBL;
|
||||||
import static bisq.core.locale.CurrencyUtil.getAllSortedFiatCurrencies;
|
import static haveno.core.locale.CurrencyUtil.getAllSortedFiatCurrencies;
|
||||||
import static bisq.core.locale.CurrencyUtil.getTradeCurrency;
|
import static haveno.core.locale.CurrencyUtil.getTradeCurrency;
|
||||||
import static bisq.core.payment.payload.PaymentMethod.*;
|
import static haveno.core.payment.payload.PaymentMethod.*;
|
||||||
import static java.util.Comparator.comparing;
|
import static java.util.Comparator.comparing;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
import static org.junit.jupiter.api.Assertions.fail;
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
|
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import bisq.cli.table.builder.TableBuilder;
|
|
||||||
|
|
||||||
@SuppressWarnings({"OptionalGetWithoutIsPresent", "ConstantConditions"})
|
@SuppressWarnings({"OptionalGetWithoutIsPresent", "ConstantConditions"})
|
||||||
@Disabled
|
@Disabled
|
||||||
@Slf4j
|
@Slf4j
|
|
@ -1,4 +1,4 @@
|
||||||
package bisq.apitest.method.payment;
|
package haveno.apitest.method.payment;
|
||||||
|
|
||||||
import protobuf.PaymentMethod;
|
import protobuf.PaymentMethod;
|
||||||
|
|
||||||
|
@ -15,14 +15,12 @@ import org.junit.jupiter.api.Order;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
|
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
import static org.junit.jupiter.api.Assertions.fail;
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
|
|
||||||
|
import haveno.apitest.method.MethodTest;
|
||||||
|
|
||||||
import bisq.apitest.method.MethodTest;
|
|
||||||
|
|
||||||
@Disabled
|
@Disabled
|
||||||
@Slf4j
|
@Slf4j
|
|
@ -1,7 +1,10 @@
|
||||||
package bisq.apitest.method.trade;
|
package haveno.apitest.method.trade;
|
||||||
|
|
||||||
import bisq.proto.grpc.TradeInfo;
|
|
||||||
|
|
||||||
|
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.Function;
|
||||||
import java.util.function.Predicate;
|
import java.util.function.Predicate;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
@ -13,24 +16,17 @@ import lombok.Getter;
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.TestInfo;
|
import org.junit.jupiter.api.TestInfo;
|
||||||
|
|
||||||
import static bisq.cli.table.builder.TableType.TRADE_DETAIL_TBL;
|
import static haveno.cli.table.builder.TableType.TRADE_DETAIL_TBL;
|
||||||
import static bisq.core.trade.Trade.Phase.DEPOSITS_UNLOCKED;
|
import static haveno.core.trade.Trade.Phase.DEPOSITS_UNLOCKED;
|
||||||
import static bisq.core.trade.Trade.Phase.PAYMENT_SENT;
|
import static haveno.core.trade.Trade.Phase.PAYMENT_RECEIVED;
|
||||||
import static bisq.core.trade.Trade.Phase.PAYMENT_RECEIVED;
|
import static haveno.core.trade.Trade.Phase.PAYMENT_SENT;
|
||||||
import static bisq.core.trade.Trade.State.BUYER_SAW_ARRIVED_PAYMENT_SENT_MSG;
|
import static haveno.core.trade.Trade.State.BUYER_SAW_ARRIVED_PAYMENT_SENT_MSG;
|
||||||
import static bisq.core.trade.Trade.State.DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN;
|
import static haveno.core.trade.Trade.State.DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN;
|
||||||
import static bisq.core.trade.Trade.State.SELLER_RECEIVED_PAYMENT_SENT_MSG;
|
import static haveno.core.trade.Trade.State.SELLER_RECEIVED_PAYMENT_SENT_MSG;
|
||||||
import static java.lang.String.format;
|
import static java.lang.String.format;
|
||||||
import static java.lang.System.out;
|
import static java.lang.System.out;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
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 class AbstractTradeTest extends AbstractOfferTest {
|
||||||
|
|
||||||
public static final ExpectedProtocolStatus EXPECTED_PROTOCOL_STATUS = new ExpectedProtocolStatus();
|
public static final ExpectedProtocolStatus EXPECTED_PROTOCOL_STATUS = new ExpectedProtocolStatus();
|
|
@ -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.
|
* A test fixture encapsulating expected trade protocol status.
|
|
@ -15,9 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.method.trade;
|
package haveno.apitest.method.trade;
|
||||||
|
|
||||||
import bisq.core.payment.PaymentAccount;
|
|
||||||
|
|
||||||
import io.grpc.StatusRuntimeException;
|
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.TestInfo;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
import static bisq.apitest.config.ApiTestConfig.USD;
|
import static haveno.apitest.config.ApiTestConfig.USD;
|
||||||
import static bisq.core.trade.Trade.Phase.PAYMENT_RECEIVED;
|
import static haveno.core.trade.Trade.Phase.PAYMENT_RECEIVED;
|
||||||
import static bisq.core.trade.Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG;
|
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.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.fail;
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
import static protobuf.OfferDirection.BUY;
|
import static protobuf.OfferDirection.BUY;
|
||||||
import static protobuf.OpenOffer.State.AVAILABLE;
|
import static protobuf.OpenOffer.State.AVAILABLE;
|
||||||
|
|
||||||
|
import haveno.core.payment.PaymentAccount;
|
||||||
|
|
||||||
@Disabled
|
@Disabled
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
|
@ -32,10 +32,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.method.trade;
|
package haveno.apitest.method.trade;
|
||||||
|
|
||||||
import bisq.core.payment.PaymentAccount;
|
|
||||||
import bisq.core.payment.payload.NationalBankAccountPayload;
|
|
||||||
|
|
||||||
import io.grpc.StatusRuntimeException;
|
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.TestInfo;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
import static bisq.apitest.config.ApiTestConfig.BTC;
|
import static haveno.apitest.config.ApiTestConfig.BTC;
|
||||||
import static bisq.core.trade.Trade.Phase.PAYMENT_RECEIVED;
|
import static haveno.core.trade.Trade.Phase.PAYMENT_RECEIVED;
|
||||||
import static bisq.core.trade.Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG;
|
import static haveno.core.trade.Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG;
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
import static org.junit.jupiter.api.Assertions.*;
|
||||||
import static protobuf.Offer.State.OFFER_FEE_RESERVED;
|
import static protobuf.Offer.State.OFFER_FEE_RESERVED;
|
||||||
import static protobuf.OfferDirection.BUY;
|
import static protobuf.OfferDirection.BUY;
|
||||||
import static protobuf.OpenOffer.State.AVAILABLE;
|
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,
|
* Test case verifies trade can be made with national bank payment method,
|
||||||
* and json contracts exclude bank acct details until deposit tx is confirmed.
|
* and json contracts exclude bank acct details until deposit tx is confirmed.
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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;
|
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.TestInfo;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
import static bisq.apitest.config.ApiTestConfig.XMR;
|
import static haveno.apitest.config.ApiTestConfig.XMR;
|
||||||
import static bisq.cli.table.builder.TableType.OFFER_TBL;
|
import static haveno.cli.table.builder.TableType.OFFER_TBL;
|
||||||
import static bisq.core.trade.Trade.Phase.PAYMENT_RECEIVED;
|
import static haveno.core.trade.Trade.Phase.PAYMENT_RECEIVED;
|
||||||
import static bisq.core.trade.Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG;
|
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.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.fail;
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
import static protobuf.Offer.State.OFFER_FEE_RESERVED;
|
import static protobuf.Offer.State.OFFER_FEE_RESERVED;
|
||||||
import static protobuf.OfferDirection.SELL;
|
import static protobuf.OfferDirection.SELL;
|
||||||
|
|
||||||
|
import haveno.apitest.method.offer.AbstractOfferTest;
|
||||||
|
import haveno.cli.table.builder.TableBuilder;
|
||||||
import bisq.apitest.method.offer.AbstractOfferTest;
|
|
||||||
import bisq.cli.table.builder.TableBuilder;
|
|
||||||
|
|
||||||
@Disabled
|
@Disabled
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@ -121,8 +119,8 @@ public class TakeBuyXMROfferTest extends AbstractTradeTest {
|
||||||
sleep(2_000);
|
sleep(2_000);
|
||||||
var trade = aliceClient.getTrade(tradeId);
|
var trade = aliceClient.getTrade(tradeId);
|
||||||
// If we were trading BSQ, Alice would verify payment has been sent to her
|
// 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.
|
// Haveno wallet, but we can do no such checks for XMR payments.
|
||||||
// All XMR transfers are done outside Bisq.
|
// All XMR transfers are done outside Haveno.
|
||||||
log.debug("Alice verifies XMR payment was received from Bob, for trade {}", trade.getTradeId());
|
log.debug("Alice verifies XMR payment was received from Bob, for trade {}", trade.getTradeId());
|
||||||
aliceClient.confirmPaymentReceived(trade.getTradeId());
|
aliceClient.confirmPaymentReceived(trade.getTradeId());
|
||||||
sleep(3_000);
|
sleep(3_000);
|
|
@ -15,9 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.method.trade;
|
package haveno.apitest.method.trade;
|
||||||
|
|
||||||
import bisq.core.payment.PaymentAccount;
|
|
||||||
|
|
||||||
import io.grpc.StatusRuntimeException;
|
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.TestInfo;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
import static bisq.apitest.config.ApiTestConfig.BTC;
|
import static haveno.apitest.config.ApiTestConfig.BTC;
|
||||||
import static bisq.apitest.config.ApiTestConfig.USD;
|
import static haveno.apitest.config.ApiTestConfig.USD;
|
||||||
import static bisq.core.trade.Trade.Phase.PAYMENT_RECEIVED;
|
import static haveno.core.trade.Trade.Phase.COMPLETED;
|
||||||
import static bisq.core.trade.Trade.Phase.COMPLETED;
|
import static haveno.core.trade.Trade.Phase.PAYMENT_RECEIVED;
|
||||||
import static bisq.core.trade.Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG;
|
import static haveno.core.trade.Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG;
|
||||||
import static bisq.core.trade.Trade.State.TRADE_COMPLETED;
|
import static haveno.core.trade.Trade.State.TRADE_COMPLETED;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
import static org.junit.jupiter.api.Assertions.fail;
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
import static protobuf.Offer.State.OFFER_FEE_RESERVED;
|
import static protobuf.Offer.State.OFFER_FEE_RESERVED;
|
||||||
import static protobuf.OfferDirection.SELL;
|
import static protobuf.OfferDirection.SELL;
|
||||||
|
|
||||||
|
import haveno.core.payment.PaymentAccount;
|
||||||
|
|
||||||
@Disabled
|
@Disabled
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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;
|
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.TestInfo;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
import static bisq.apitest.config.ApiTestConfig.BTC;
|
import static haveno.apitest.config.ApiTestConfig.BTC;
|
||||||
import static bisq.apitest.config.ApiTestConfig.XMR;
|
import static haveno.apitest.config.ApiTestConfig.XMR;
|
||||||
import static bisq.cli.table.builder.TableType.OFFER_TBL;
|
import static haveno.cli.table.builder.TableType.OFFER_TBL;
|
||||||
import static bisq.core.trade.Trade.Phase.PAYMENT_RECEIVED;
|
import static haveno.core.trade.Trade.Phase.PAYMENT_RECEIVED;
|
||||||
import static bisq.core.trade.Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG;
|
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.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.fail;
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
import static protobuf.OfferDirection.BUY;
|
import static protobuf.OfferDirection.BUY;
|
||||||
|
|
||||||
|
import haveno.apitest.method.offer.AbstractOfferTest;
|
||||||
|
import haveno.cli.table.builder.TableBuilder;
|
||||||
import bisq.apitest.method.offer.AbstractOfferTest;
|
|
||||||
import bisq.cli.table.builder.TableBuilder;
|
|
||||||
|
|
||||||
@Disabled
|
@Disabled
|
||||||
@Slf4j
|
@Slf4j
|
||||||
|
@ -128,8 +126,8 @@ public class TakeSellXMROfferTest extends AbstractTradeTest {
|
||||||
var trade = bobClient.getTrade(tradeId);
|
var trade = bobClient.getTrade(tradeId);
|
||||||
sleep(2_000);
|
sleep(2_000);
|
||||||
// If we were trading BTC, Bob would verify payment has been sent to his
|
// 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.
|
// Haveno wallet, but we can do no such checks for XMR payments.
|
||||||
// All XMR transfers are done outside Bisq.
|
// All XMR transfers are done outside Haveno.
|
||||||
log.debug("Bob verifies XMR payment was received from Alice, for trade {}", trade.getTradeId());
|
log.debug("Bob verifies XMR payment was received from Alice, for trade {}", trade.getTradeId());
|
||||||
bobClient.confirmPaymentReceived(trade.getTradeId());
|
bobClient.confirmPaymentReceived(trade.getTradeId());
|
||||||
sleep(3_000);
|
sleep(3_000);
|
|
@ -1,7 +1,8 @@
|
||||||
package bisq.apitest.method.wallet;
|
package haveno.apitest.method.wallet;
|
||||||
|
|
||||||
import bisq.proto.grpc.BtcBalanceInfo;
|
|
||||||
|
|
||||||
|
import haveno.proto.grpc.BtcBalanceInfo;
|
||||||
|
import haveno.apitest.method.MethodTest;
|
||||||
|
import haveno.cli.table.builder.TableBuilder;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import org.junit.jupiter.api.AfterAll;
|
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.TestInfo;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
|
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.bobdaemon;
|
import static haveno.apitest.config.HavenoAppConfig.bobdaemon;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.seednode;
|
import static haveno.apitest.config.HavenoAppConfig.seednode;
|
||||||
import static bisq.apitest.method.wallet.WalletTestUtil.INITIAL_BTC_BALANCES;
|
import static haveno.apitest.method.wallet.WalletTestUtil.INITIAL_BTC_BALANCES;
|
||||||
import static bisq.apitest.method.wallet.WalletTestUtil.verifyBtcBalances;
|
import static haveno.apitest.method.wallet.WalletTestUtil.verifyBtcBalances;
|
||||||
import static bisq.cli.table.builder.TableType.ADDRESS_BALANCE_TBL;
|
import static haveno.cli.table.builder.TableType.ADDRESS_BALANCE_TBL;
|
||||||
import static bisq.cli.table.builder.TableType.BTC_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.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
|
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import bisq.apitest.method.MethodTest;
|
|
||||||
import bisq.cli.table.builder.TableBuilder;
|
|
||||||
|
|
||||||
@Disabled
|
@Disabled
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@TestMethodOrder(OrderAnnotation.class)
|
@TestMethodOrder(OrderAnnotation.class)
|
||||||
|
@ -50,7 +46,7 @@ public class BtcWalletTest extends MethodTest {
|
||||||
@Test
|
@Test
|
||||||
@Order(1)
|
@Order(1)
|
||||||
public void testInitialBtcBalances(final TestInfo testInfo) {
|
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();
|
BtcBalanceInfo alicesBalances = aliceClient.getBtcBalances();
|
||||||
log.debug("{} Alice's BTC Balances:\n{}",
|
log.debug("{} Alice's BTC Balances:\n{}",
|
||||||
|
@ -84,8 +80,8 @@ public class BtcWalletTest extends MethodTest {
|
||||||
|
|
||||||
// New balance is 12.5 BTC
|
// New balance is 12.5 BTC
|
||||||
btcBalanceInfo = aliceClient.getBtcBalances();
|
btcBalanceInfo = aliceClient.getBtcBalances();
|
||||||
bisq.core.api.model.BtcBalanceInfo alicesExpectedBalances =
|
haveno.core.api.model.BtcBalanceInfo alicesExpectedBalances =
|
||||||
bisq.core.api.model.BtcBalanceInfo.valueOf(1250000000,
|
haveno.core.api.model.BtcBalanceInfo.valueOf(1250000000,
|
||||||
0,
|
0,
|
||||||
1250000000,
|
1250000000,
|
||||||
0);
|
0);
|
|
@ -1,4 +1,4 @@
|
||||||
package bisq.apitest.method.wallet;
|
package haveno.apitest.method.wallet;
|
||||||
|
|
||||||
import io.grpc.StatusRuntimeException;
|
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.Test;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
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 java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||||
import static org.junit.jupiter.api.Assertions.fail;
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
|
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
|
||||||
|
|
||||||
|
import haveno.apitest.method.MethodTest;
|
||||||
|
|
||||||
import bisq.apitest.method.MethodTest;
|
|
||||||
|
|
||||||
@SuppressWarnings("ResultOfMethodCallIgnored")
|
@SuppressWarnings("ResultOfMethodCallIgnored")
|
||||||
@Disabled
|
@Disabled
|
|
@ -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;
|
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
|
// All api tests depend on the DAO / regtest environment, and Bob & Alice's wallets
|
||||||
// are initialized with 10 BTC during the scaffolding setup.
|
// are initialized with 10 BTC during the scaffolding setup.
|
||||||
public static final bisq.core.api.model.BtcBalanceInfo INITIAL_BTC_BALANCES =
|
public static final haveno.core.api.model.BtcBalanceInfo INITIAL_BTC_BALANCES =
|
||||||
bisq.core.api.model.BtcBalanceInfo.valueOf(1000000000,
|
haveno.core.api.model.BtcBalanceInfo.valueOf(1000000000,
|
||||||
0,
|
0,
|
||||||
1000000000,
|
1000000000,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
public static void verifyBtcBalances(bisq.core.api.model.BtcBalanceInfo expected,
|
public static void verifyBtcBalances(haveno.core.api.model.BtcBalanceInfo expected,
|
||||||
BtcBalanceInfo actual) {
|
BtcBalanceInfo actual) {
|
||||||
assertEquals(expected.getAvailableBalance(), actual.getAvailableBalance());
|
assertEquals(expected.getAvailableBalance(), actual.getAvailableBalance());
|
||||||
assertEquals(expected.getReservedBalance(), actual.getReservedBalance());
|
assertEquals(expected.getReservedBalance(), actual.getReservedBalance());
|
|
@ -15,12 +15,11 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.scenario;
|
package haveno.apitest.scenario;
|
||||||
|
|
||||||
import bisq.core.payment.PaymentAccount;
|
|
||||||
|
|
||||||
import bisq.proto.grpc.OfferInfo;
|
|
||||||
|
|
||||||
|
import haveno.proto.grpc.OfferInfo;
|
||||||
|
import haveno.apitest.method.offer.AbstractOfferTest;
|
||||||
|
import haveno.core.payment.PaymentAccount;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import org.junit.jupiter.api.MethodOrderer;
|
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.BUY;
|
||||||
import static protobuf.OfferDirection.SELL;
|
import static protobuf.OfferDirection.SELL;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
import bisq.apitest.method.offer.AbstractOfferTest;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Used to verify trigger based, automatic offer deactivation works.
|
* Used to verify trigger based, automatic offer deactivation works.
|
||||||
* Disabled by default.
|
* Disabled by default.
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.scenario;
|
package haveno.apitest.scenario;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
|
@ -28,11 +28,9 @@ import org.junit.jupiter.api.condition.EnabledIf;
|
||||||
|
|
||||||
import static java.lang.System.getenv;
|
import static java.lang.System.getenv;
|
||||||
|
|
||||||
|
import haveno.apitest.method.trade.AbstractTradeTest;
|
||||||
|
import haveno.apitest.method.trade.TakeBuyBTCOfferTest;
|
||||||
import bisq.apitest.method.trade.AbstractTradeTest;
|
import haveno.apitest.method.trade.TakeSellBTCOfferTest;
|
||||||
import bisq.apitest.method.trade.TakeBuyBTCOfferTest;
|
|
||||||
import bisq.apitest.method.trade.TakeSellBTCOfferTest;
|
|
||||||
|
|
||||||
@EnabledIf("envLongRunningTestEnabled")
|
@EnabledIf("envLongRunningTestEnabled")
|
||||||
@Slf4j
|
@Slf4j
|
|
@ -15,9 +15,15 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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 lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
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.Test;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
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
|
@Slf4j
|
||||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||||
public class OfferTest extends AbstractOfferTest {
|
public class OfferTest extends AbstractOfferTest {
|
|
@ -1,4 +1,4 @@
|
||||||
package bisq.apitest.scenario;
|
package haveno.apitest.scenario;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
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.TestInfo;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
|
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.seednode;
|
import static haveno.apitest.config.HavenoAppConfig.seednode;
|
||||||
import static org.junit.jupiter.api.Assertions.fail;
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
|
|
||||||
|
import haveno.apitest.method.payment.AbstractPaymentAccountTest;
|
||||||
|
import haveno.apitest.method.payment.CreatePaymentAccountTest;
|
||||||
import bisq.apitest.method.payment.AbstractPaymentAccountTest;
|
import haveno.apitest.method.payment.GetPaymentMethodsTest;
|
||||||
import bisq.apitest.method.payment.CreatePaymentAccountTest;
|
|
||||||
import bisq.apitest.method.payment.GetPaymentMethodsTest;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.scenario;
|
package haveno.apitest.scenario;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
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.TestMethodOrder;
|
||||||
import org.junit.jupiter.api.condition.EnabledIf;
|
import org.junit.jupiter.api.condition.EnabledIf;
|
||||||
|
|
||||||
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
|
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.arbdaemon;
|
import static haveno.apitest.config.HavenoAppConfig.arbdaemon;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.bobdaemon;
|
import static haveno.apitest.config.HavenoAppConfig.bobdaemon;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.seednode;
|
import static haveno.apitest.config.HavenoAppConfig.seednode;
|
||||||
import static bisq.apitest.scenario.bot.shutdown.ManualShutdown.startShutdownTimer;
|
import static haveno.apitest.scenario.bot.shutdown.ManualShutdown.startShutdownTimer;
|
||||||
import static org.junit.jupiter.api.Assertions.fail;
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
|
|
||||||
|
import haveno.apitest.config.ApiTestConfig;
|
||||||
|
import haveno.apitest.method.BitcoinCliHelper;
|
||||||
import bisq.apitest.config.ApiTestConfig;
|
import haveno.apitest.scenario.bot.AbstractBotTest;
|
||||||
import bisq.apitest.method.BitcoinCliHelper;
|
import haveno.apitest.scenario.bot.BotClient;
|
||||||
import bisq.apitest.scenario.bot.AbstractBotTest;
|
import haveno.apitest.scenario.bot.RobotBob;
|
||||||
import bisq.apitest.scenario.bot.BotClient;
|
import haveno.apitest.scenario.bot.script.BashScriptGenerator;
|
||||||
import bisq.apitest.scenario.bot.RobotBob;
|
import haveno.apitest.scenario.bot.shutdown.ManualBotShutdownException;
|
||||||
import bisq.apitest.scenario.bot.script.BashScriptGenerator;
|
|
||||||
import bisq.apitest.scenario.bot.shutdown.ManualBotShutdownException;
|
|
||||||
|
|
||||||
// The test case is enabled if AbstractBotTest#botScriptExists() returns true.
|
// The test case is enabled if AbstractBotTest#botScriptExists() returns true.
|
||||||
@EnabledIf("botScriptExists")
|
@EnabledIf("botScriptExists")
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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.File;
|
||||||
import java.io.IOException;
|
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.Test;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
||||||
import static bisq.apitest.config.ApiTestRateMeterInterceptorConfig.getTestRateMeterInterceptorConfig;
|
import static haveno.apitest.config.ApiTestRateMeterInterceptorConfig.getTestRateMeterInterceptorConfig;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
|
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.arbdaemon;
|
import static haveno.apitest.config.HavenoAppConfig.arbdaemon;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.seednode;
|
import static haveno.apitest.config.HavenoAppConfig.seednode;
|
||||||
import static bisq.common.file.FileUtil.deleteFileIfExists;
|
import static haveno.common.file.FileUtil.deleteFileIfExists;
|
||||||
import static org.junit.jupiter.api.Assertions.fail;
|
import static org.junit.jupiter.api.Assertions.fail;
|
||||||
|
|
||||||
|
import haveno.apitest.method.CallRateMeteringInterceptorTest;
|
||||||
|
import haveno.apitest.method.GetMethodHelpTest;
|
||||||
import bisq.apitest.method.CallRateMeteringInterceptorTest;
|
import haveno.apitest.method.GetVersionTest;
|
||||||
import bisq.apitest.method.GetMethodHelpTest;
|
import haveno.apitest.method.MethodTest;
|
||||||
import bisq.apitest.method.GetVersionTest;
|
import haveno.apitest.method.RegisterDisputeAgentsTest;
|
||||||
import bisq.apitest.method.MethodTest;
|
|
||||||
import bisq.apitest.method.RegisterDisputeAgentsTest;
|
|
||||||
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
|
@ -15,8 +15,14 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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 lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import org.junit.jupiter.api.BeforeEach;
|
import org.junit.jupiter.api.BeforeEach;
|
||||||
|
@ -27,15 +33,6 @@ import org.junit.jupiter.api.TestInfo;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
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
|
@Slf4j
|
||||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||||
public class TradeTest extends AbstractTradeTest {
|
public class TradeTest extends AbstractTradeTest {
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.scenario;
|
package haveno.apitest.scenario;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
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.TestInfo;
|
||||||
import org.junit.jupiter.api.TestMethodOrder;
|
import org.junit.jupiter.api.TestMethodOrder;
|
||||||
|
|
||||||
import static bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.alicedaemon;
|
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.arbdaemon;
|
import static haveno.apitest.config.HavenoAppConfig.arbdaemon;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.bobdaemon;
|
import static haveno.apitest.config.HavenoAppConfig.bobdaemon;
|
||||||
import static bisq.apitest.config.HavenoAppConfig.seednode;
|
import static haveno.apitest.config.HavenoAppConfig.seednode;
|
||||||
|
|
||||||
|
import haveno.apitest.method.MethodTest;
|
||||||
|
import haveno.apitest.method.wallet.BtcWalletTest;
|
||||||
import bisq.apitest.method.MethodTest;
|
import haveno.apitest.method.wallet.WalletProtectionTest;
|
||||||
import bisq.apitest.method.wallet.BtcWalletTest;
|
|
||||||
import bisq.apitest.method.wallet.WalletProtectionTest;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
|
@ -15,14 +15,15 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.apitest.scenario.bot;
|
package haveno.apitest.scenario.bot;
|
||||||
|
|
||||||
import bisq.core.locale.Country;
|
|
||||||
|
|
||||||
import protobuf.PaymentAccount;
|
import protobuf.PaymentAccount;
|
||||||
|
|
||||||
import com.google.gson.GsonBuilder;
|
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.nio.file.Paths;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -30,19 +31,13 @@ import java.io.IOException;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import static bisq.core.locale.CountryUtil.findCountryByCode;
|
import static haveno.core.locale.CountryUtil.findCountryByCode;
|
||||||
import static bisq.core.payment.payload.PaymentMethod.CLEAR_X_CHANGE_ID;
|
import static haveno.core.payment.payload.PaymentMethod.CLEAR_X_CHANGE_ID;
|
||||||
import static bisq.core.payment.payload.PaymentMethod.getPaymentMethod;
|
import static haveno.core.payment.payload.PaymentMethod.getPaymentMethod;
|
||||||
import static java.lang.String.format;
|
import static java.lang.String.format;
|
||||||
import static java.lang.System.getProperty;
|
import static java.lang.System.getProperty;
|
||||||
import static java.nio.file.Files.readAllBytes;
|
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
|
@Slf4j
|
||||||
public abstract class AbstractBotTest extends MethodTest {
|
public abstract class AbstractBotTest extends MethodTest {
|
||||||
|
|
|
@ -1,23 +1,19 @@
|
||||||
package bisq.apitest.scenario.bot;
|
package haveno.apitest.scenario.bot;
|
||||||
|
|
||||||
import bisq.core.locale.Country;
|
|
||||||
|
|
||||||
|
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 protobuf.PaymentAccount;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import static bisq.core.locale.CountryUtil.findCountryByCode;
|
import static haveno.core.locale.CountryUtil.findCountryByCode;
|
||||||
import static bisq.core.payment.payload.PaymentMethod.CLEAR_X_CHANGE_ID;
|
import static haveno.core.payment.payload.PaymentMethod.CLEAR_X_CHANGE_ID;
|
||||||
import static bisq.core.payment.payload.PaymentMethod.getPaymentMethod;
|
import static haveno.core.payment.payload.PaymentMethod.getPaymentMethod;
|
||||||
import static java.lang.String.format;
|
import static java.lang.String.format;
|
||||||
import static java.util.concurrent.TimeUnit.MINUTES;
|
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
|
@Slf4j
|
||||||
public
|
public
|
||||||
class Bot {
|
class Bot {
|
|
@ -15,13 +15,14 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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.BalancesInfo;
|
|
||||||
import bisq.proto.grpc.GetPaymentAccountsRequest;
|
|
||||||
import bisq.proto.grpc.OfferInfo;
|
|
||||||
import bisq.proto.grpc.TradeInfo;
|
|
||||||
|
|
||||||
|
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 protobuf.PaymentAccount;
|
||||||
|
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
|
@ -33,11 +34,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import static org.apache.commons.lang3.StringUtils.capitalize;
|
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.
|
* Convenience GrpcClient wrapper for bots using gRPC services.
|
||||||
*/
|
*/
|
|
@ -1,22 +1,20 @@
|
||||||
package bisq.apitest.scenario.bot;
|
package haveno.apitest.scenario.bot;
|
||||||
|
|
||||||
import bisq.core.api.model.PaymentAccountForm;
|
|
||||||
import bisq.core.locale.Country;
|
|
||||||
|
|
||||||
import protobuf.PaymentAccount;
|
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.Gson;
|
||||||
import com.google.gson.GsonBuilder;
|
import com.google.gson.GsonBuilder;
|
||||||
|
import haveno.core.api.model.PaymentAccountForm;
|
||||||
|
import haveno.core.locale.Country;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
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
|
@Slf4j
|
||||||
public class BotPaymentAccountGenerator {
|
public class BotPaymentAccountGenerator {
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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")
|
@SuppressWarnings("unused")
|
||||||
public class InvalidRandomOfferException extends HavenoException {
|
public class InvalidRandomOfferException extends HavenoException {
|
|
@ -15,9 +15,9 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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")
|
@SuppressWarnings("unused")
|
||||||
public class PaymentAccountNotFoundException extends HavenoException {
|
public class PaymentAccountNotFoundException extends HavenoException {
|
|
@ -15,9 +15,9 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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;
|
import protobuf.PaymentAccount;
|
||||||
|
|
||||||
|
@ -33,11 +33,11 @@ import java.util.function.Supplier;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import static bisq.apitest.method.offer.AbstractOfferTest.defaultBuyerSecurityDepositPct;
|
import static haveno.apitest.method.offer.AbstractOfferTest.defaultBuyerSecurityDepositPct;
|
||||||
import static bisq.cli.CurrencyFormat.formatInternalFiatPrice;
|
import static haveno.cli.CurrencyFormat.formatInternalFiatPrice;
|
||||||
import static bisq.cli.CurrencyFormat.formatSatoshis;
|
import static haveno.cli.CurrencyFormat.formatSatoshis;
|
||||||
import static bisq.common.util.MathUtils.scaleDownByPowerOf10;
|
import static haveno.common.util.MathUtils.scaleDownByPowerOf10;
|
||||||
import static bisq.core.payment.payload.PaymentMethod.F2F_ID;
|
import static haveno.core.payment.payload.PaymentMethod.F2F_ID;
|
||||||
import static java.lang.String.format;
|
import static java.lang.String.format;
|
||||||
import static java.math.RoundingMode.HALF_UP;
|
import static java.math.RoundingMode.HALF_UP;
|
||||||
|
|
|
@ -15,26 +15,24 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import static bisq.apitest.scenario.bot.protocol.ProtocolStep.DONE;
|
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.DONE;
|
||||||
import static bisq.apitest.scenario.bot.shutdown.ManualShutdown.isShutdownCalled;
|
import static haveno.apitest.scenario.bot.shutdown.ManualShutdown.isShutdownCalled;
|
||||||
import static bisq.cli.table.builder.TableType.BTC_BALANCE_TBL;
|
import static haveno.cli.table.builder.TableType.BTC_BALANCE_TBL;
|
||||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||||
|
|
||||||
|
import haveno.apitest.method.BitcoinCliHelper;
|
||||||
|
import haveno.apitest.scenario.bot.protocol.BotProtocol;
|
||||||
import bisq.apitest.method.BitcoinCliHelper;
|
import haveno.apitest.scenario.bot.protocol.MakerBotProtocol;
|
||||||
import bisq.apitest.scenario.bot.protocol.BotProtocol;
|
import haveno.apitest.scenario.bot.protocol.TakerBotProtocol;
|
||||||
import bisq.apitest.scenario.bot.protocol.MakerBotProtocol;
|
import haveno.apitest.scenario.bot.script.BashScriptGenerator;
|
||||||
import bisq.apitest.scenario.bot.protocol.TakerBotProtocol;
|
import haveno.apitest.scenario.bot.script.BotScript;
|
||||||
import bisq.apitest.scenario.bot.script.BashScriptGenerator;
|
import haveno.apitest.scenario.bot.shutdown.ManualBotShutdownException;
|
||||||
import bisq.apitest.scenario.bot.script.BotScript;
|
import haveno.cli.table.builder.TableBuilder;
|
||||||
import bisq.apitest.scenario.bot.shutdown.ManualBotShutdownException;
|
|
||||||
import bisq.cli.table.builder.TableBuilder;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public
|
public
|
||||||
|
@ -113,7 +111,7 @@ class RobotBob extends Bot {
|
||||||
log.info("When ready to shutdown the test {}, run '$ touch /tmp/bottest-shutdown'.",
|
log.info("When ready to shutdown the test {}, run '$ touch /tmp/bottest-shutdown'.",
|
||||||
harnessOrCase);
|
harnessOrCase);
|
||||||
if (!isUsingTestHarness) {
|
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.");
|
+ " running outside of the test harness.");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
|
@ -15,11 +15,15 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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 protobuf.PaymentAccount;
|
||||||
|
|
||||||
import java.security.SecureRandom;
|
import java.security.SecureRandom;
|
||||||
|
@ -37,22 +41,14 @@ import java.util.stream.Collectors;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import static bisq.apitest.scenario.bot.protocol.ProtocolStep.*;
|
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.*;
|
||||||
import static bisq.apitest.scenario.bot.shutdown.ManualShutdown.checkIfShutdownCalled;
|
import static haveno.apitest.scenario.bot.shutdown.ManualShutdown.checkIfShutdownCalled;
|
||||||
import static bisq.cli.table.builder.TableType.TRADE_DETAIL_TBL;
|
import static haveno.cli.table.builder.TableType.TRADE_DETAIL_TBL;
|
||||||
import static java.lang.String.format;
|
import static java.lang.String.format;
|
||||||
import static java.lang.System.currentTimeMillis;
|
import static java.lang.System.currentTimeMillis;
|
||||||
import static java.util.Arrays.stream;
|
import static java.util.Arrays.stream;
|
||||||
import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
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
|
@Slf4j
|
||||||
public abstract class BotProtocol {
|
public abstract class BotProtocol {
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
package bisq.apitest.scenario.bot.protocol;
|
package haveno.apitest.scenario.bot.protocol;
|
||||||
|
|
||||||
import bisq.proto.grpc.OfferInfo;
|
|
||||||
import bisq.proto.grpc.TradeInfo;
|
|
||||||
|
|
||||||
|
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 protobuf.PaymentAccount;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -13,20 +18,11 @@ import java.util.function.Supplier;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import static bisq.apitest.scenario.bot.protocol.ProtocolStep.DONE;
|
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.DONE;
|
||||||
import static bisq.apitest.scenario.bot.protocol.ProtocolStep.WAIT_FOR_OFFER_TAKER;
|
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.WAIT_FOR_OFFER_TAKER;
|
||||||
import static bisq.apitest.scenario.bot.shutdown.ManualShutdown.checkIfShutdownCalled;
|
import static haveno.apitest.scenario.bot.shutdown.ManualShutdown.checkIfShutdownCalled;
|
||||||
import static bisq.cli.table.builder.TableType.OFFER_TBL;
|
import static haveno.cli.table.builder.TableType.OFFER_TBL;
|
||||||
import static bisq.cli.table.builder.TableType.TRADE_DETAIL_TBL;
|
import static haveno.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;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class MakerBotProtocol extends BotProtocol {
|
public class MakerBotProtocol extends BotProtocol {
|
|
@ -1,4 +1,4 @@
|
||||||
package bisq.apitest.scenario.bot.protocol;
|
package haveno.apitest.scenario.bot.protocol;
|
||||||
|
|
||||||
public enum ProtocolStep {
|
public enum ProtocolStep {
|
||||||
START,
|
START,
|
|
@ -1,8 +1,12 @@
|
||||||
package bisq.apitest.scenario.bot.protocol;
|
package haveno.apitest.scenario.bot.protocol;
|
||||||
|
|
||||||
import bisq.proto.grpc.OfferInfo;
|
|
||||||
import bisq.proto.grpc.TradeInfo;
|
|
||||||
|
|
||||||
|
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 protobuf.PaymentAccount;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -13,20 +17,12 @@ import java.util.function.Supplier;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
|
||||||
import static bisq.apitest.scenario.bot.protocol.ProtocolStep.DONE;
|
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.DONE;
|
||||||
import static bisq.apitest.scenario.bot.protocol.ProtocolStep.FIND_OFFER;
|
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.FIND_OFFER;
|
||||||
import static bisq.apitest.scenario.bot.protocol.ProtocolStep.TAKE_OFFER;
|
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.TAKE_OFFER;
|
||||||
import static bisq.apitest.scenario.bot.shutdown.ManualShutdown.checkIfShutdownCalled;
|
import static haveno.apitest.scenario.bot.shutdown.ManualShutdown.checkIfShutdownCalled;
|
||||||
import static bisq.cli.table.builder.TableType.OFFER_TBL;
|
import static haveno.cli.table.builder.TableType.OFFER_TBL;
|
||||||
import static bisq.core.payment.payload.PaymentMethod.F2F_ID;
|
import static haveno.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;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class TakerBotProtocol extends BotProtocol {
|
public class TakerBotProtocol extends BotProtocol {
|
|
@ -15,15 +15,13 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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 haveno.proto.grpc.OfferInfo;
|
||||||
|
import haveno.proto.grpc.TradeInfo;
|
||||||
import bisq.proto.grpc.OfferInfo;
|
|
||||||
import bisq.proto.grpc.TradeInfo;
|
|
||||||
|
|
||||||
import com.google.common.io.Files;
|
import com.google.common.io.Files;
|
||||||
|
import haveno.common.file.FileUtil;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -60,7 +58,7 @@ public class BashScriptGenerator {
|
||||||
this.apiPort = apiPort;
|
this.apiPort = apiPort;
|
||||||
this.paymentAccountId = paymentAccountId;
|
this.paymentAccountId = paymentAccountId;
|
||||||
this.printCliScripts = printCliScripts;
|
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,
|
public File createMakeMarginPricedOfferScript(String direction,
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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.Getter;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
|
@ -15,12 +15,10 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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.core.util.JsonUtil;
|
|
||||||
|
|
||||||
import bisq.common.file.JsonFileManager;
|
|
||||||
|
|
||||||
|
import haveno.common.file.JsonFileManager;
|
||||||
|
import haveno.core.util.JsonUtil;
|
||||||
import joptsimple.BuiltinHelpFormatter;
|
import joptsimple.BuiltinHelpFormatter;
|
||||||
import joptsimple.OptionParser;
|
import joptsimple.OptionParser;
|
||||||
import joptsimple.OptionSet;
|
import joptsimple.OptionSet;
|
|
@ -15,9 +15,9 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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")
|
@SuppressWarnings("unused")
|
||||||
public class ManualBotShutdownException extends HavenoException {
|
public class ManualBotShutdownException extends HavenoException {
|
|
@ -1,6 +1,4 @@
|
||||||
package bisq.apitest.scenario.bot.shutdown;
|
package haveno.apitest.scenario.bot.shutdown;
|
||||||
|
|
||||||
import bisq.common.UserThread;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -9,9 +7,11 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
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 static java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||||
|
|
||||||
|
import haveno.common.UserThread;
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ManualShutdown {
|
public class ManualShutdown {
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ public class ManualShutdown {
|
||||||
*
|
*
|
||||||
* Running '$ touch /tmp/bottest-shutdown' could be used to trigger a scaffold teardown.
|
* 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() {
|
public static void startShutdownTimer() {
|
||||||
deleteStaleShutdownFile();
|
deleteStaleShutdownFile();
|
|
@ -4,7 +4,7 @@
|
||||||
The :daemon & :cli jars contain their own logback.xml config files, which causes chatty logback startup.
|
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:
|
To avoid chatty logback msgs during its configuration, pass logback.configurationFile as a system property:
|
||||||
-Dlogback.configurationFile=apitest/build/resources/main/logback.xml
|
-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">
|
<appender name="CONSOLE_APPENDER" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
<encoder>
|
<encoder>
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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.notBlank;
|
||||||
import static org.apache.commons.lang3.Validate.notNull;
|
import static org.apache.commons.lang3.Validate.notNull;
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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
|
* Value object representing the result of validating an {@link Asset} address. Various
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.asset;
|
package haveno.asset;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An {@link Asset} address validation function.
|
* An {@link Asset} address validation function.
|
|
@ -1,4 +1,4 @@
|
||||||
package bisq.asset;
|
package haveno.asset;
|
||||||
|
|
||||||
import java.lang.annotation.ElementType;
|
import java.lang.annotation.ElementType;
|
||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
|
@ -15,17 +15,17 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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
|
* Interface representing a given ("crypto") asset in its most abstract form, having a
|
||||||
* {@link #getName() name}, eg "Bitcoin", a {@link #getTickerSymbol() ticker symbol},
|
* {@link #getName() name}, eg "Bitcoin", a {@link #getTickerSymbol() ticker symbol},
|
||||||
* eg "BTC", and an address validation function. Together, these properties represent
|
* 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 minimum information and functionality required to register and trade an asset on
|
||||||
* the Bisq network.
|
* the Haveno network.
|
||||||
* <p>
|
* <p>
|
||||||
* Implementations typically extend either the {@link Coin} or {@link Token} base
|
* 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.
|
* in order to be available in the {@link AssetRegistry} at runtime.
|
||||||
*
|
*
|
||||||
* @author Chris Beams
|
* @author Chris Beams
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.asset;
|
package haveno.asset;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -24,7 +24,7 @@ import java.util.stream.Stream;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides {@link Stream}-based access to {@link Asset} implementations registered in
|
* 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
|
* @author Chris Beams
|
||||||
* @since 0.7.0
|
* @since 0.7.0
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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.AddressFormatException;
|
||||||
import org.bitcoinj.core.LegacyAddress;
|
import org.bitcoinj.core.LegacyAddress;
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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.Address;
|
||||||
import org.bitcoinj.core.AddressFormatException;
|
import org.bitcoinj.core.AddressFormatException;
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.asset;
|
package haveno.asset;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validates a Bitcoin Cash address.
|
* Validates a Bitcoin Cash address.
|
|
@ -15,11 +15,11 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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
|
* 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>
|
* <p>
|
||||||
* In addition to the usual {@code Asset} properties, a {@code Coin} maintains information
|
* 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
|
* about which {@link Network} it may be used on. By default, coins are constructed with
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.asset;
|
package haveno.asset;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link AddressValidator} for Base58-encoded Cryptonote addresses.
|
* {@link AddressValidator} for Base58-encoded Cryptonote addresses.
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package bisq.asset;
|
package haveno.asset;
|
||||||
|
|
||||||
import org.bitcoinj.core.Utils;
|
import org.bitcoinj.core.Utils;
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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
|
* Abstract base class for Ethereum-based {@link Token}s that implement the
|
|
@ -15,13 +15,13 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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
|
* 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">
|
* <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
|
* 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}
|
* {@link Erc20Token} implementations and other Ethereum-based {@link Asset}
|
||||||
* implementations.
|
* implementations.
|
||||||
*
|
*
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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.
|
* We only support the grinbox format as it is currently the only tool which offers a validation options of sender.
|
|
@ -1,4 +1,4 @@
|
||||||
package bisq.asset;
|
package haveno.asset;
|
||||||
|
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package bisq.asset;
|
package haveno.asset;
|
||||||
|
|
||||||
public class LiquidBitcoinAddressValidator extends RegexAddressValidator {
|
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})$";
|
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})$";
|
|
@ -15,7 +15,7 @@
|
||||||
* along with Haveno. If not, see <http://www.gnu.org/licenses/>.
|
* 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.BitcoinSerializer;
|
||||||
import org.bitcoinj.core.Block;
|
import org.bitcoinj.core.Block;
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue