test: make joinmarket work with regtest
This commit is contained in:
parent
a10aa21c69
commit
d5ce1c43a8
|
@ -169,8 +169,8 @@ let
|
||||||
use_ssl = false
|
use_ssl = false
|
||||||
|
|
||||||
[BLOCKCHAIN]
|
[BLOCKCHAIN]
|
||||||
blockchain_source = bitcoin-rpc
|
blockchain_source = ${bitcoind.makeNetworkName "bitcoin-rpc" "regtest"}
|
||||||
network = ${bitcoind.network}
|
network = ${bitcoind.makeNetworkName "mainnet" "testnet"}
|
||||||
rpc_host = ${nbLib.address bitcoind.rpc.address}
|
rpc_host = ${nbLib.address bitcoind.rpc.address}
|
||||||
rpc_port = ${toString bitcoind.rpc.port}
|
rpc_port = ${toString bitcoind.rpc.port}
|
||||||
rpc_user = ${bitcoind.rpc.users.privileged.name}
|
rpc_user = ${bitcoind.rpc.users.privileged.name}
|
||||||
|
@ -282,15 +282,16 @@ in {
|
||||||
echo "rpc_password = $(cat ${secretsDir}/bitcoin-rpcpassword-privileged)"
|
echo "rpc_password = $(cat ${secretsDir}/bitcoin-rpcpassword-privileged)"
|
||||||
} > '${cfg.dataDir}/joinmarket.cfg'
|
} > '${cfg.dataDir}/joinmarket.cfg'
|
||||||
'';
|
'';
|
||||||
# Generating wallets (jmclient/wallet.py) is only supported for mainnet or testnet
|
postStart = ''
|
||||||
postStart = mkIf (bitcoind.network == "mainnet") ''
|
|
||||||
walletname=wallet.jmdat
|
walletname=wallet.jmdat
|
||||||
wallet=${cfg.dataDir}/wallets/$walletname
|
wallet=${cfg.dataDir}/wallets/$walletname
|
||||||
if [[ ! -f $wallet ]]; then
|
if [[ ! -f $wallet ]]; then
|
||||||
${optionalString (cfg.rpcWalletFile != null) ''
|
${optionalString (cfg.rpcWalletFile != null) ''
|
||||||
echo "Create watch-only wallet ${cfg.rpcWalletFile}"
|
echo "Create watch-only wallet ${cfg.rpcWalletFile}"
|
||||||
if ! output=$(${bitcoind.cli}/bin/bitcoin-cli -named createwallet \
|
if ! output=$(${bitcoind.cli}/bin/bitcoin-cli -named createwallet \
|
||||||
wallet_name="${cfg.rpcWalletFile}" disable_private_keys=true 2>&1); then
|
wallet_name="${cfg.rpcWalletFile}" \
|
||||||
|
${optionalString (!bitcoind.regtest) "disable_private_keys=true"} 2>&1
|
||||||
|
); then
|
||||||
# Ignore error if bitcoind wallet already exists
|
# Ignore error if bitcoind wallet already exists
|
||||||
if [[ $output != *"already exists"* ]]; then
|
if [[ $output != *"already exists"* ]]; then
|
||||||
echo "$output"
|
echo "$output"
|
||||||
|
|
|
@ -248,9 +248,6 @@ let
|
||||||
services.lightning-pool.extraConfig = ''
|
services.lightning-pool.extraConfig = ''
|
||||||
auctionserver=localhost
|
auctionserver=localhost
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Needs wallet support which is unavailable for regtest
|
|
||||||
services.joinmarket.yieldgenerator.enable = mkForce false;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
## Examples / debug helper
|
## Examples / debug helper
|
||||||
|
|
|
@ -218,9 +218,12 @@ def _():
|
||||||
|
|
||||||
@test("joinmarket-yieldgenerator")
|
@test("joinmarket-yieldgenerator")
|
||||||
def _():
|
def _():
|
||||||
machine.wait_until_succeeds(
|
if "regtest" in enabled_tests:
|
||||||
log_has_string("joinmarket-yieldgenerator", "Critical error updating blockheight.")
|
expected_log_msg = "You do not have the minimum required amount of coins to be a maker"
|
||||||
)
|
else:
|
||||||
|
expected_log_msg = "Critical error updating blockheight."
|
||||||
|
|
||||||
|
machine.wait_until_succeeds(log_has_string("joinmarket-yieldgenerator", expected_log_msg))
|
||||||
|
|
||||||
@test("joinmarket-ob-watcher")
|
@test("joinmarket-ob-watcher")
|
||||||
def _():
|
def _():
|
||||||
|
|
Loading…
Reference in New Issue
Block a user