mirror of
https://github.com/basicswap/basicswap.git
synced 2026-04-09 10:57:23 +02:00
Merge pull request #442 from tecnovert/set_wallet_name
refactor: where possible use "bsx_wallet" name for new installs
This commit is contained in:
@@ -2892,9 +2892,15 @@ def main():
|
|||||||
coin_id = getCoinIdFromName(coin_name)
|
coin_id = getCoinIdFromName(coin_name)
|
||||||
coin_params = chainparams[coin_id]
|
coin_params = chainparams[coin_id]
|
||||||
if coin_settings.get("core_type_group", "") == "xmr":
|
if coin_settings.get("core_type_group", "") == "xmr":
|
||||||
default_name = "swap_wallet"
|
default_name: str = "swap_wallet"
|
||||||
|
use_name: str = default_name
|
||||||
else:
|
else:
|
||||||
default_name = "wallet.dat"
|
default_name: str = "wallet.dat"
|
||||||
|
use_name: str = (
|
||||||
|
"wallet.dat"
|
||||||
|
if coin_id in (Coins.NAV, Coins.FIRO, Coins.DCR)
|
||||||
|
else "bsx_wallet"
|
||||||
|
)
|
||||||
|
|
||||||
if coin_name == "litecoin":
|
if coin_name == "litecoin":
|
||||||
set_name: str = getWalletName(
|
set_name: str = getWalletName(
|
||||||
@@ -2903,7 +2909,7 @@ def main():
|
|||||||
if set_name != "mweb":
|
if set_name != "mweb":
|
||||||
coin_settings["mweb_wallet_name"] = set_name
|
coin_settings["mweb_wallet_name"] = set_name
|
||||||
|
|
||||||
set_name: str = getWalletName(coin_params, default_name)
|
set_name: str = getWalletName(coin_params, use_name)
|
||||||
if set_name != default_name:
|
if set_name != default_name:
|
||||||
coin_settings["wallet_name"] = set_name
|
coin_settings["wallet_name"] = set_name
|
||||||
|
|
||||||
|
|||||||
@@ -95,7 +95,7 @@ def prepareDataDir(
|
|||||||
fp.write("fallbackfee=0.01\n")
|
fp.write("fallbackfee=0.01\n")
|
||||||
fp.write("acceptnonstdtxn=0\n")
|
fp.write("acceptnonstdtxn=0\n")
|
||||||
fp.write("txindex=1\n")
|
fp.write("txindex=1\n")
|
||||||
fp.write("wallet=wallet.dat\n")
|
fp.write("wallet=bsx_wallet\n")
|
||||||
|
|
||||||
fp.write("findpeers=0\n")
|
fp.write("findpeers=0\n")
|
||||||
|
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ def prepareOtherDir(datadir, nodeId, conf_file="dash.conf"):
|
|||||||
fp.write("acceptnonstdtxn=0\n")
|
fp.write("acceptnonstdtxn=0\n")
|
||||||
|
|
||||||
if conf_file == "bitcoin.conf":
|
if conf_file == "bitcoin.conf":
|
||||||
fp.write("wallet=wallet.dat\n")
|
fp.write("wallet=bsx_wallet\n")
|
||||||
|
|
||||||
|
|
||||||
def prepareDir(datadir, nodeId, network_key, network_pubkey):
|
def prepareDir(datadir, nodeId, network_key, network_pubkey):
|
||||||
@@ -137,7 +137,7 @@ def prepareDir(datadir, nodeId, network_key, network_pubkey):
|
|||||||
fp.write("debug=1\n")
|
fp.write("debug=1\n")
|
||||||
fp.write("debugexclude=libevent\n")
|
fp.write("debugexclude=libevent\n")
|
||||||
fp.write("zmqpubsmsg=tcp://127.0.0.1:" + str(BASE_ZMQ_PORT + nodeId) + "\n")
|
fp.write("zmqpubsmsg=tcp://127.0.0.1:" + str(BASE_ZMQ_PORT + nodeId) + "\n")
|
||||||
fp.write("wallet=wallet.dat\n")
|
fp.write("wallet=bsx_wallet\n")
|
||||||
fp.write("fallbackfee=0.01\n")
|
fp.write("fallbackfee=0.01\n")
|
||||||
|
|
||||||
fp.write("acceptnonstdtxn=0\n")
|
fp.write("acceptnonstdtxn=0\n")
|
||||||
@@ -313,7 +313,7 @@ class Test(unittest.TestCase):
|
|||||||
cfg.BITCOIN_BINDIR,
|
cfg.BITCOIN_BINDIR,
|
||||||
btc_data_dir,
|
btc_data_dir,
|
||||||
"regtest",
|
"regtest",
|
||||||
"-wallet=wallet.dat -legacy create",
|
"-wallet=bsx_wallet -legacy create",
|
||||||
"bitcoin-wallet",
|
"bitcoin-wallet",
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
@@ -321,7 +321,7 @@ class Test(unittest.TestCase):
|
|||||||
cfg.BITCOIN_BINDIR,
|
cfg.BITCOIN_BINDIR,
|
||||||
btc_data_dir,
|
btc_data_dir,
|
||||||
"regtest",
|
"regtest",
|
||||||
"-wallet=wallet.dat create",
|
"-wallet=bsx_wallet create",
|
||||||
"bitcoin-wallet",
|
"bitcoin-wallet",
|
||||||
)
|
)
|
||||||
cls.daemons.append(startDaemon(btc_data_dir, cfg.BITCOIN_BINDIR, cfg.BITCOIND))
|
cls.daemons.append(startDaemon(btc_data_dir, cfg.BITCOIN_BINDIR, cfg.BITCOIND))
|
||||||
@@ -333,7 +333,7 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
if os.path.exists(os.path.join(DASH_BINDIR, 'dash-wallet')):
|
if os.path.exists(os.path.join(DASH_BINDIR, 'dash-wallet')):
|
||||||
logging.info('Creating DASH wallet.')
|
logging.info('Creating DASH wallet.')
|
||||||
callrpc_cli(DASH_BINDIR, dash_data_dir, 'regtest', '-wallet=wallet.dat create', 'dash-wallet')
|
callrpc_cli(DASH_BINDIR, dash_data_dir, 'regtest', '-wallet=bsx_wallet create', 'dash-wallet')
|
||||||
"""
|
"""
|
||||||
cls.daemons.append(startDaemon(dash_data_dir, DASH_BINDIR, DASHD))
|
cls.daemons.append(startDaemon(dash_data_dir, DASH_BINDIR, DASHD))
|
||||||
logging.info("Started %s %d", DASHD, cls.daemons[-1].handle.pid)
|
logging.info("Started %s %d", DASHD, cls.daemons[-1].handle.pid)
|
||||||
@@ -346,7 +346,7 @@ class Test(unittest.TestCase):
|
|||||||
cfg.PARTICL_BINDIR,
|
cfg.PARTICL_BINDIR,
|
||||||
data_dir,
|
data_dir,
|
||||||
"regtest",
|
"regtest",
|
||||||
"-wallet=wallet.dat -legacy create",
|
"-wallet=bsx_wallet -legacy create",
|
||||||
"particl-wallet",
|
"particl-wallet",
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
@@ -354,7 +354,7 @@ class Test(unittest.TestCase):
|
|||||||
cfg.PARTICL_BINDIR,
|
cfg.PARTICL_BINDIR,
|
||||||
data_dir,
|
data_dir,
|
||||||
"regtest",
|
"regtest",
|
||||||
"-wallet=wallet.dat create",
|
"-wallet=bsx_wallet create",
|
||||||
"particl-wallet",
|
"particl-wallet",
|
||||||
)
|
)
|
||||||
cls.daemons.append(startDaemon(data_dir, cfg.PARTICL_BINDIR, cfg.PARTICLD))
|
cls.daemons.append(startDaemon(data_dir, cfg.PARTICL_BINDIR, cfg.PARTICLD))
|
||||||
@@ -410,7 +410,7 @@ class Test(unittest.TestCase):
|
|||||||
|
|
||||||
waitForRPC(dashRpc, delay_event, rpc_command="getblockchaininfo")
|
waitForRPC(dashRpc, delay_event, rpc_command="getblockchaininfo")
|
||||||
if len(dashRpc("listwallets")) < 1:
|
if len(dashRpc("listwallets")) < 1:
|
||||||
dashRpc("createwallet wallet.dat")
|
dashRpc("createwallet wbsx_wallet")
|
||||||
|
|
||||||
sc.start()
|
sc.start()
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ class Test(TestFunctions):
|
|||||||
dogeRpc = make_rpc_func(i, base_rpc_port=DOGE_BASE_RPC_PORT)
|
dogeRpc = make_rpc_func(i, base_rpc_port=DOGE_BASE_RPC_PORT)
|
||||||
waitForRPC(dogeRpc, test_delay_event, rpc_command="getblockchaininfo")
|
waitForRPC(dogeRpc, test_delay_event, rpc_command="getblockchaininfo")
|
||||||
if len(dogeRpc("listwallets")) < 1:
|
if len(dogeRpc("listwallets")) < 1:
|
||||||
dogeRpc("createwallet", ["wallet.dat", False, True, "", False, False])
|
dogeRpc("createwallet", ["bsx_wallet", False, True, "", False, False])
|
||||||
wif_prefix: int = 239
|
wif_prefix: int = 239
|
||||||
wif = toWIF(wif_prefix, bytes.fromhex(cls.doge_seeds[i]), False)
|
wif = toWIF(wif_prefix, bytes.fromhex(cls.doge_seeds[i]), False)
|
||||||
dogeRpc("sethdseed", [True, wif])
|
dogeRpc("sethdseed", [True, wif])
|
||||||
|
|||||||
@@ -160,7 +160,7 @@ class Test(BaseTest):
|
|||||||
FIRO_BINDIR,
|
FIRO_BINDIR,
|
||||||
data_dir,
|
data_dir,
|
||||||
"regtest",
|
"regtest",
|
||||||
"-wallet=wallet.dat create",
|
"-wallet=bsx_wallet create",
|
||||||
"firo-wallet",
|
"firo-wallet",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -216,7 +216,7 @@ class Test(unittest.TestCase):
|
|||||||
cfg.PARTICL_BINDIR,
|
cfg.PARTICL_BINDIR,
|
||||||
data_dir,
|
data_dir,
|
||||||
"regtest",
|
"regtest",
|
||||||
"-wallet=wallet.dat -legacy create",
|
"-wallet=bsx_wallet -legacy create",
|
||||||
"particl-wallet",
|
"particl-wallet",
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -286,7 +286,7 @@ class Test(unittest.TestCase):
|
|||||||
cfg.BITCOIN_BINDIR,
|
cfg.BITCOIN_BINDIR,
|
||||||
data_dir,
|
data_dir,
|
||||||
"regtest",
|
"regtest",
|
||||||
"-wallet=wallet.dat -legacy create",
|
"-wallet=bsx_wallet -legacy create",
|
||||||
"bitcoin-wallet",
|
"bitcoin-wallet",
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -161,7 +161,7 @@ class TestNMC(BasicSwapTest):
|
|||||||
if len(nmc_rpc("listwallets")) < 1:
|
if len(nmc_rpc("listwallets")) < 1:
|
||||||
nmc_rpc(
|
nmc_rpc(
|
||||||
"createwallet",
|
"createwallet",
|
||||||
["wallet.dat", False, True, "", False, NMC_USE_DESCRIPTORS],
|
["bsx_wallet", False, True, "", False, NMC_USE_DESCRIPTORS],
|
||||||
)
|
)
|
||||||
if NMC_USE_DESCRIPTORS:
|
if NMC_USE_DESCRIPTORS:
|
||||||
nmc_rpc(
|
nmc_rpc(
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ def prepareOtherDir(datadir, nodeId, conf_file="pivx.conf"):
|
|||||||
fp.write(f"paramsdir={params_dir}\n")
|
fp.write(f"paramsdir={params_dir}\n")
|
||||||
|
|
||||||
if conf_file == "bitcoin.conf":
|
if conf_file == "bitcoin.conf":
|
||||||
fp.write("wallet=wallet.dat\n")
|
fp.write("wallet=bsx_wallet\n")
|
||||||
|
|
||||||
|
|
||||||
def prepareDir(datadir, nodeId, network_key, network_pubkey):
|
def prepareDir(datadir, nodeId, network_key, network_pubkey):
|
||||||
@@ -143,7 +143,7 @@ def prepareDir(datadir, nodeId, network_key, network_pubkey):
|
|||||||
fp.write("debug=1\n")
|
fp.write("debug=1\n")
|
||||||
fp.write("debugexclude=libevent\n")
|
fp.write("debugexclude=libevent\n")
|
||||||
fp.write("zmqpubsmsg=tcp://127.0.0.1:" + str(BASE_ZMQ_PORT + nodeId) + "\n")
|
fp.write("zmqpubsmsg=tcp://127.0.0.1:" + str(BASE_ZMQ_PORT + nodeId) + "\n")
|
||||||
fp.write("wallet=wallet.dat\n")
|
fp.write("wallet=bsx_wallet\n")
|
||||||
fp.write("fallbackfee=0.01\n")
|
fp.write("fallbackfee=0.01\n")
|
||||||
|
|
||||||
fp.write("acceptnonstdtxn=0\n")
|
fp.write("acceptnonstdtxn=0\n")
|
||||||
@@ -324,7 +324,7 @@ class Test(unittest.TestCase):
|
|||||||
cfg.BITCOIN_BINDIR,
|
cfg.BITCOIN_BINDIR,
|
||||||
btc_data_dir,
|
btc_data_dir,
|
||||||
"regtest",
|
"regtest",
|
||||||
"-wallet=wallet.dat -legacy create",
|
"-wallet=bsx_wallet -legacy create",
|
||||||
"bitcoin-wallet",
|
"bitcoin-wallet",
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
@@ -332,7 +332,7 @@ class Test(unittest.TestCase):
|
|||||||
cfg.BITCOIN_BINDIR,
|
cfg.BITCOIN_BINDIR,
|
||||||
btc_data_dir,
|
btc_data_dir,
|
||||||
"regtest",
|
"regtest",
|
||||||
"-wallet=wallet.dat create",
|
"-wallet=bsx_wallet create",
|
||||||
"bitcoin-wallet",
|
"bitcoin-wallet",
|
||||||
)
|
)
|
||||||
cls.daemons.append(startDaemon(btc_data_dir, cfg.BITCOIN_BINDIR, cfg.BITCOIND))
|
cls.daemons.append(startDaemon(btc_data_dir, cfg.BITCOIN_BINDIR, cfg.BITCOIND))
|
||||||
@@ -352,7 +352,7 @@ class Test(unittest.TestCase):
|
|||||||
cfg.PARTICL_BINDIR,
|
cfg.PARTICL_BINDIR,
|
||||||
data_dir,
|
data_dir,
|
||||||
"regtest",
|
"regtest",
|
||||||
"-wallet=wallet.dat -legacy create",
|
"-wallet=bsx_wallet -legacy create",
|
||||||
"particl-wallet",
|
"particl-wallet",
|
||||||
)
|
)
|
||||||
except Exception:
|
except Exception:
|
||||||
@@ -360,7 +360,7 @@ class Test(unittest.TestCase):
|
|||||||
cfg.PARTICL_BINDIR,
|
cfg.PARTICL_BINDIR,
|
||||||
data_dir,
|
data_dir,
|
||||||
"regtest",
|
"regtest",
|
||||||
"-wallet=wallet.dat create",
|
"-wallet=bsx_wallet create",
|
||||||
"particl-wallet",
|
"particl-wallet",
|
||||||
)
|
)
|
||||||
cls.daemons.append(startDaemon(data_dir, cfg.PARTICL_BINDIR, cfg.PARTICLD))
|
cls.daemons.append(startDaemon(data_dir, cfg.PARTICL_BINDIR, cfg.PARTICLD))
|
||||||
|
|||||||
@@ -313,7 +313,7 @@ class Test(unittest.TestCase):
|
|||||||
ltc_datadir = os.path.join(test_path, "litecoin")
|
ltc_datadir = os.path.join(test_path, "litecoin")
|
||||||
rv = json.loads(
|
rv = json.loads(
|
||||||
callcoincli(
|
callcoincli(
|
||||||
ltc_cli_path, ltc_datadir, "getwalletinfo", wallet="wallet.dat"
|
ltc_cli_path, ltc_datadir, "getwalletinfo", wallet="bsx_wallet"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
assert "unlocked_until" in rv
|
assert "unlocked_until" in rv
|
||||||
@@ -474,7 +474,7 @@ class Test(unittest.TestCase):
|
|||||||
ltc_datadir = os.path.join(test_path, "litecoin")
|
ltc_datadir = os.path.join(test_path, "litecoin")
|
||||||
rv = json.loads(
|
rv = json.loads(
|
||||||
callcoincli(
|
callcoincli(
|
||||||
ltc_cli_path, ltc_datadir, "getwalletinfo", wallet="wallet.dat"
|
ltc_cli_path, ltc_datadir, "getwalletinfo", wallet="bsx_wallet"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
assert "unlocked_until" in rv
|
assert "unlocked_until" in rv
|
||||||
@@ -653,7 +653,7 @@ class Test(unittest.TestCase):
|
|||||||
logging.info("Check both LTC wallets are encrypted and mweb seeds match.")
|
logging.info("Check both LTC wallets are encrypted and mweb seeds match.")
|
||||||
rv = json.loads(
|
rv = json.loads(
|
||||||
callcoincli(
|
callcoincli(
|
||||||
ltc_cli_path, ltc_datadir, "getwalletinfo", wallet="wallet.dat"
|
ltc_cli_path, ltc_datadir, "getwalletinfo", wallet="bsx_wallet"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
assert "unlocked_until" in rv
|
assert "unlocked_until" in rv
|
||||||
@@ -769,7 +769,7 @@ class Test(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
walletdir = os.path.join(test_path, "regtest", "wallets", "bdb_wallet")
|
walletdir = os.path.join(test_path, "regtest", "wallets", "bdb_wallet")
|
||||||
walletpath = os.path.join(walletdir, "wallet.dat")
|
walletpath = os.path.join(walletdir, "bsx_wallet")
|
||||||
|
|
||||||
db = berkeleydb.db.DB()
|
db = berkeleydb.db.DB()
|
||||||
db.open(
|
db.open(
|
||||||
@@ -812,10 +812,10 @@ class Test(unittest.TestCase):
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
bkp_path = os.path.join(walletdir, "wallet.dat" + ".bkp")
|
bkp_path = os.path.join(walletdir, "bsx_wallet" + ".bkp")
|
||||||
for i in range(1000):
|
for i in range(1000):
|
||||||
if os.path.exists(bkp_path):
|
if os.path.exists(bkp_path):
|
||||||
bkp_path = os.path.join(walletdir, "wallet.dat" + f".bkp{i}")
|
bkp_path = os.path.join(walletdir, "bsx_wallet" + f".bkp{i}")
|
||||||
|
|
||||||
assert os.path.exists(bkp_path) is False
|
assert os.path.exists(bkp_path) is False
|
||||||
if os.path.isfile(walletpath):
|
if os.path.isfile(walletpath):
|
||||||
@@ -940,7 +940,7 @@ class Test(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
logging.info(f"Looking for hdchain for {seedid_bytes.hex()}")
|
logging.info(f"Looking for hdchain for {seedid_bytes.hex()}")
|
||||||
walletdir = os.path.join(test_path, "regtest", "wallets", "bdb_wallet2")
|
walletdir = os.path.join(test_path, "regtest", "wallets", "bdb_wallet2")
|
||||||
walletpath = os.path.join(walletdir, "wallet.dat")
|
walletpath = os.path.join(walletdir, "bsx_wallet")
|
||||||
found_hdchain = False
|
found_hdchain = False
|
||||||
max_key_count = 4000000 # arbitrary
|
max_key_count = 4000000 # arbitrary
|
||||||
with open(walletpath, "rb") as fp:
|
with open(walletpath, "rb") as fp:
|
||||||
@@ -1134,7 +1134,7 @@ class Test(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
walletdir = os.path.join(test_path, "regtest", "wallets", "descr_wallet")
|
walletdir = os.path.join(test_path, "regtest", "wallets", "descr_wallet")
|
||||||
walletpath = os.path.join(walletdir, "wallet.dat")
|
walletpath = os.path.join(walletdir, "bsx_wallet")
|
||||||
|
|
||||||
orig_active_descriptors = []
|
orig_active_descriptors = []
|
||||||
with sqlite3.connect(walletpath) as conn:
|
with sqlite3.connect(walletpath) as conn:
|
||||||
@@ -1234,10 +1234,10 @@ class Test(unittest.TestCase):
|
|||||||
"descr_wallet",
|
"descr_wallet",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
bkp_path = os.path.join(walletdir, "wallet.dat" + ".bkp")
|
bkp_path = os.path.join(walletdir, "bsx_wallet" + ".bkp")
|
||||||
for i in range(1000):
|
for i in range(1000):
|
||||||
if os.path.exists(bkp_path):
|
if os.path.exists(bkp_path):
|
||||||
bkp_path = os.path.join(walletdir, "wallet.dat" + f".bkp{i}")
|
bkp_path = os.path.join(walletdir, "bsx_wallet" + f".bkp{i}")
|
||||||
|
|
||||||
assert os.path.exists(bkp_path) is False
|
assert os.path.exists(bkp_path) is False
|
||||||
if os.path.isfile(walletpath):
|
if os.path.isfile(walletpath):
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ class Test(TestBase):
|
|||||||
|
|
||||||
num_blocks = 431
|
num_blocks = 431
|
||||||
self.ltc_addr = callltcnoderpc(
|
self.ltc_addr = callltcnoderpc(
|
||||||
1, "getnewaddress", ["mining_addr", "bech32"], wallet="wallet.dat"
|
1, "getnewaddress", ["mining_addr", "bech32"], wallet="bsx_wallet"
|
||||||
)
|
)
|
||||||
logging.info("Mining %d Litecoin blocks to %s", num_blocks, self.ltc_addr)
|
logging.info("Mining %d Litecoin blocks to %s", num_blocks, self.ltc_addr)
|
||||||
callltcnoderpc(1, "generatetoaddress", [num_blocks, self.ltc_addr])
|
callltcnoderpc(1, "generatetoaddress", [num_blocks, self.ltc_addr])
|
||||||
@@ -162,7 +162,7 @@ class Test(TestBase):
|
|||||||
mweb_addr = callltcnoderpc(
|
mweb_addr = callltcnoderpc(
|
||||||
1, "getnewaddress", ["mweb_addr", "mweb"], wallet="mweb"
|
1, "getnewaddress", ["mweb_addr", "mweb"], wallet="mweb"
|
||||||
)
|
)
|
||||||
callltcnoderpc(1, "sendtoaddress", [mweb_addr, 1], wallet="wallet.dat")
|
callltcnoderpc(1, "sendtoaddress", [mweb_addr, 1], wallet="bsx_wallet")
|
||||||
num_blocks = 69
|
num_blocks = 69
|
||||||
callltcnoderpc(1, "generatetoaddress", [num_blocks, self.ltc_addr])
|
callltcnoderpc(1, "generatetoaddress", [num_blocks, self.ltc_addr])
|
||||||
|
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ def callbtcrpc(
|
|||||||
node_id,
|
node_id,
|
||||||
method,
|
method,
|
||||||
params=[],
|
params=[],
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
base_rpc_port=BITCOIN_RPC_PORT_BASE + PORT_OFS,
|
base_rpc_port=BITCOIN_RPC_PORT_BASE + PORT_OFS,
|
||||||
):
|
):
|
||||||
auth = "test_btc_{0}:test_btc_pwd_{0}".format(node_id)
|
auth = "test_btc_{0}:test_btc_pwd_{0}".format(node_id)
|
||||||
@@ -153,7 +153,7 @@ def callnmcrpc(
|
|||||||
node_id,
|
node_id,
|
||||||
method,
|
method,
|
||||||
params=[],
|
params=[],
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
base_rpc_port=NAMECOIN_RPC_PORT_BASE + PORT_OFS,
|
base_rpc_port=NAMECOIN_RPC_PORT_BASE + PORT_OFS,
|
||||||
):
|
):
|
||||||
auth = "test_nmc_{0}:test_nmc_pwd_{0}".format(node_id)
|
auth = "test_nmc_{0}:test_nmc_pwd_{0}".format(node_id)
|
||||||
@@ -336,7 +336,7 @@ def start_processes(self):
|
|||||||
|
|
||||||
if "litecoin" in self.test_coins_list:
|
if "litecoin" in self.test_coins_list:
|
||||||
self.ltc_addr = callltcrpc(
|
self.ltc_addr = callltcrpc(
|
||||||
0, "getnewaddress", ["mining_addr"], wallet="wallet.dat"
|
0, "getnewaddress", ["mining_addr"], wallet="bsx_wallet"
|
||||||
)
|
)
|
||||||
num_blocks: int = 431
|
num_blocks: int = 431
|
||||||
have_blocks: int = callltcrpc(0, "getblockcount")
|
have_blocks: int = callltcrpc(0, "getblockcount")
|
||||||
@@ -346,7 +346,7 @@ def start_processes(self):
|
|||||||
0,
|
0,
|
||||||
"generatetoaddress",
|
"generatetoaddress",
|
||||||
[num_blocks - have_blocks, self.ltc_addr],
|
[num_blocks - have_blocks, self.ltc_addr],
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
|
|
||||||
# https://github.com/litecoin-project/litecoin/issues/807
|
# https://github.com/litecoin-project/litecoin/issues/807
|
||||||
@@ -354,7 +354,7 @@ def start_processes(self):
|
|||||||
mweb_addr = callltcrpc(
|
mweb_addr = callltcrpc(
|
||||||
0, "getnewaddress", ["mweb_addr", "mweb"], wallet="mweb"
|
0, "getnewaddress", ["mweb_addr", "mweb"], wallet="mweb"
|
||||||
)
|
)
|
||||||
callltcrpc(0, "sendtoaddress", [mweb_addr, 1.0], wallet="wallet.dat")
|
callltcrpc(0, "sendtoaddress", [mweb_addr, 1.0], wallet="bsx_wallet")
|
||||||
num_blocks = 69
|
num_blocks = 69
|
||||||
|
|
||||||
have_blocks: int = callltcrpc(0, "getblockcount")
|
have_blocks: int = callltcrpc(0, "getblockcount")
|
||||||
@@ -362,7 +362,7 @@ def start_processes(self):
|
|||||||
0,
|
0,
|
||||||
"generatetoaddress",
|
"generatetoaddress",
|
||||||
[500 - have_blocks, self.ltc_addr],
|
[500 - have_blocks, self.ltc_addr],
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
|
|
||||||
if "decred" in self.test_coins_list:
|
if "decred" in self.test_coins_list:
|
||||||
@@ -413,7 +413,7 @@ def start_processes(self):
|
|||||||
|
|
||||||
if "bitcoincash" in self.test_coins_list:
|
if "bitcoincash" in self.test_coins_list:
|
||||||
self.bch_addr = callbchrpc(
|
self.bch_addr = callbchrpc(
|
||||||
0, "getnewaddress", ["mining_addr"], wallet="wallet.dat"
|
0, "getnewaddress", ["mining_addr"], wallet="bsx_wallet"
|
||||||
)
|
)
|
||||||
num_blocks: int = 200
|
num_blocks: int = 200
|
||||||
have_blocks: int = callbchrpc(0, "getblockcount")
|
have_blocks: int = callbchrpc(0, "getblockcount")
|
||||||
@@ -427,7 +427,7 @@ def start_processes(self):
|
|||||||
0,
|
0,
|
||||||
"generatetoaddress",
|
"generatetoaddress",
|
||||||
[num_blocks - have_blocks, self.bch_addr],
|
[num_blocks - have_blocks, self.bch_addr],
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
|
|
||||||
if "dogecoin" in self.test_coins_list:
|
if "dogecoin" in self.test_coins_list:
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ class TestBCH(BasicSwapTest):
|
|||||||
BITCOINCASH_BINDIR,
|
BITCOINCASH_BINDIR,
|
||||||
data_dir,
|
data_dir,
|
||||||
"regtest",
|
"regtest",
|
||||||
"-wallet=wallet.dat create",
|
"-wallet=bsx_wallet create",
|
||||||
bch_wallet_bin,
|
bch_wallet_bin,
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -172,7 +172,7 @@ class TestBCH(BasicSwapTest):
|
|||||||
"getnewaddress",
|
"getnewaddress",
|
||||||
["mining_addr"],
|
["mining_addr"],
|
||||||
base_rpc_port=BCH_BASE_RPC_PORT,
|
base_rpc_port=BCH_BASE_RPC_PORT,
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
if not cls.restore_instance:
|
if not cls.restore_instance:
|
||||||
num_blocks: int = 200
|
num_blocks: int = 200
|
||||||
@@ -182,7 +182,7 @@ class TestBCH(BasicSwapTest):
|
|||||||
"generatetoaddress",
|
"generatetoaddress",
|
||||||
[num_blocks, cls.bch_addr],
|
[num_blocks, cls.bch_addr],
|
||||||
base_rpc_port=BCH_BASE_RPC_PORT,
|
base_rpc_port=BCH_BASE_RPC_PORT,
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|||||||
@@ -1999,7 +1999,7 @@ class BasicSwapTest(TestFunctions):
|
|||||||
assert addr1_info[key_id_field] == addr_int1_info[key_id_field]
|
assert addr1_info[key_id_field] == addr_int1_info[key_id_field]
|
||||||
assert original_seed_id == after_seed_id
|
assert original_seed_id == after_seed_id
|
||||||
finally:
|
finally:
|
||||||
ci.setActiveWallet("wallet.dat")
|
ci.setActiveWallet("bsx_wallet")
|
||||||
chain_client_settings["manage_daemon"] = False
|
chain_client_settings["manage_daemon"] = False
|
||||||
|
|
||||||
def test_015_changetype(self):
|
def test_015_changetype(self):
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ class Test(BaseTest):
|
|||||||
"getnewaddress",
|
"getnewaddress",
|
||||||
["initial funds", "bech32"],
|
["initial funds", "bech32"],
|
||||||
base_rpc_port=LTC_BASE_RPC_PORT,
|
base_rpc_port=LTC_BASE_RPC_PORT,
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
|
|
||||||
callnoderpc(
|
callnoderpc(
|
||||||
@@ -99,7 +99,7 @@ class Test(BaseTest):
|
|||||||
"sendtoaddress",
|
"sendtoaddress",
|
||||||
[ltc_addr1, 1000],
|
[ltc_addr1, 1000],
|
||||||
base_rpc_port=LTC_BASE_RPC_PORT,
|
base_rpc_port=LTC_BASE_RPC_PORT,
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
|
|
||||||
wait_for_balance(
|
wait_for_balance(
|
||||||
@@ -975,7 +975,7 @@ class Test(BaseTest):
|
|||||||
"getnewaddress",
|
"getnewaddress",
|
||||||
["Withdrawal test", "legacy"],
|
["Withdrawal test", "legacy"],
|
||||||
base_rpc_port=LTC_BASE_RPC_PORT,
|
base_rpc_port=LTC_BASE_RPC_PORT,
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
wallets0 = read_json_api(TEST_HTTP_PORT + 0, "wallets")
|
wallets0 = read_json_api(TEST_HTTP_PORT + 0, "wallets")
|
||||||
assert float(wallets0["LTC"]["balance"]) > 100
|
assert float(wallets0["LTC"]["balance"]) > 100
|
||||||
|
|||||||
@@ -415,7 +415,7 @@ class BaseTest(unittest.TestCase):
|
|||||||
cfg.PARTICL_BINDIR,
|
cfg.PARTICL_BINDIR,
|
||||||
data_dir,
|
data_dir,
|
||||||
"regtest",
|
"regtest",
|
||||||
"-wallet=wallet.dat -legacy create",
|
"-wallet=bsx_wallet -legacy create",
|
||||||
part_wallet_bin,
|
part_wallet_bin,
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -426,7 +426,7 @@ class BaseTest(unittest.TestCase):
|
|||||||
cfg.PARTICL_BINDIR,
|
cfg.PARTICL_BINDIR,
|
||||||
data_dir,
|
data_dir,
|
||||||
"regtest",
|
"regtest",
|
||||||
"-wallet=wallet.dat create",
|
"-wallet=bsx_wallet create",
|
||||||
part_wallet_bin,
|
part_wallet_bin,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -504,7 +504,7 @@ class BaseTest(unittest.TestCase):
|
|||||||
cfg.BITCOIN_BINDIR,
|
cfg.BITCOIN_BINDIR,
|
||||||
data_dir,
|
data_dir,
|
||||||
"regtest",
|
"regtest",
|
||||||
"-wallet=wallet.dat -legacy create",
|
"-wallet=bsx_wallet -legacy create",
|
||||||
btc_wallet_bin,
|
btc_wallet_bin,
|
||||||
)
|
)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
@@ -515,7 +515,7 @@ class BaseTest(unittest.TestCase):
|
|||||||
cfg.BITCOIN_BINDIR,
|
cfg.BITCOIN_BINDIR,
|
||||||
data_dir,
|
data_dir,
|
||||||
"regtest",
|
"regtest",
|
||||||
"-wallet=wallet.dat create",
|
"-wallet=bsx_wallet create",
|
||||||
btc_wallet_bin,
|
btc_wallet_bin,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -537,7 +537,7 @@ class BaseTest(unittest.TestCase):
|
|||||||
)
|
)
|
||||||
# wallet_name, disable_private_keys, blank, passphrase, avoid_reuse, descriptors
|
# wallet_name, disable_private_keys, blank, passphrase, avoid_reuse, descriptors
|
||||||
rpc_func(
|
rpc_func(
|
||||||
"createwallet", ["wallet.dat", False, True, "", False, True]
|
"createwallet", ["bsx_wallet", False, True, "", False, True]
|
||||||
)
|
)
|
||||||
rpc_func("createwallet", ["bsx_watch", True, True, "", False, True])
|
rpc_func("createwallet", ["bsx_watch", True, True, "", False, True])
|
||||||
else:
|
else:
|
||||||
@@ -567,7 +567,7 @@ class BaseTest(unittest.TestCase):
|
|||||||
cfg.LITECOIN_BINDIR,
|
cfg.LITECOIN_BINDIR,
|
||||||
data_dir,
|
data_dir,
|
||||||
"regtest",
|
"regtest",
|
||||||
"-wallet=wallet.dat create",
|
"-wallet=bsx_wallet create",
|
||||||
ltc_wallet_bin,
|
ltc_wallet_bin,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -724,7 +724,7 @@ class BaseTest(unittest.TestCase):
|
|||||||
"getnewaddress",
|
"getnewaddress",
|
||||||
["mining_addr", "bech32"],
|
["mining_addr", "bech32"],
|
||||||
base_rpc_port=BTC_BASE_RPC_PORT,
|
base_rpc_port=BTC_BASE_RPC_PORT,
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
num_blocks = 400 # Mine enough to activate segwit
|
num_blocks = 400 # Mine enough to activate segwit
|
||||||
logging.info(f"Mining {num_blocks} Bitcoin blocks to {cls.btc_addr}")
|
logging.info(f"Mining {num_blocks} Bitcoin blocks to {cls.btc_addr}")
|
||||||
@@ -740,7 +740,7 @@ class BaseTest(unittest.TestCase):
|
|||||||
"getnewaddress",
|
"getnewaddress",
|
||||||
["initial addr"],
|
["initial addr"],
|
||||||
base_rpc_port=BTC_BASE_RPC_PORT,
|
base_rpc_port=BTC_BASE_RPC_PORT,
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
for i in range(5):
|
for i in range(5):
|
||||||
callnoderpc(
|
callnoderpc(
|
||||||
@@ -748,7 +748,7 @@ class BaseTest(unittest.TestCase):
|
|||||||
"sendtoaddress",
|
"sendtoaddress",
|
||||||
[btc_addr1, 100],
|
[btc_addr1, 100],
|
||||||
base_rpc_port=BTC_BASE_RPC_PORT,
|
base_rpc_port=BTC_BASE_RPC_PORT,
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
|
|
||||||
# Switch addresses so wallet amounts stay constant
|
# Switch addresses so wallet amounts stay constant
|
||||||
@@ -793,7 +793,7 @@ class BaseTest(unittest.TestCase):
|
|||||||
"getnewaddress",
|
"getnewaddress",
|
||||||
["mining_addr", "bech32"],
|
["mining_addr", "bech32"],
|
||||||
base_rpc_port=LTC_BASE_RPC_PORT,
|
base_rpc_port=LTC_BASE_RPC_PORT,
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
logging.info(
|
logging.info(
|
||||||
f"Mining {num_blocks} Litecoin blocks to {cls.ltc_addr}"
|
f"Mining {num_blocks} Litecoin blocks to {cls.ltc_addr}"
|
||||||
@@ -803,7 +803,7 @@ class BaseTest(unittest.TestCase):
|
|||||||
"generatetoaddress",
|
"generatetoaddress",
|
||||||
[num_blocks, cls.ltc_addr],
|
[num_blocks, cls.ltc_addr],
|
||||||
base_rpc_port=LTC_BASE_RPC_PORT,
|
base_rpc_port=LTC_BASE_RPC_PORT,
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
|
|
||||||
num_blocks = 31
|
num_blocks = 31
|
||||||
@@ -820,7 +820,7 @@ class BaseTest(unittest.TestCase):
|
|||||||
"generatetoaddress",
|
"generatetoaddress",
|
||||||
[num_blocks, cls.ltc_addr],
|
[num_blocks, cls.ltc_addr],
|
||||||
base_rpc_port=LTC_BASE_RPC_PORT,
|
base_rpc_port=LTC_BASE_RPC_PORT,
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
|
|
||||||
# https://github.com/litecoin-project/litecoin/issues/807
|
# https://github.com/litecoin-project/litecoin/issues/807
|
||||||
@@ -830,14 +830,14 @@ class BaseTest(unittest.TestCase):
|
|||||||
"getnewaddress",
|
"getnewaddress",
|
||||||
["mweb_addr", "mweb"],
|
["mweb_addr", "mweb"],
|
||||||
base_rpc_port=LTC_BASE_RPC_PORT,
|
base_rpc_port=LTC_BASE_RPC_PORT,
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
callnoderpc(
|
callnoderpc(
|
||||||
0,
|
0,
|
||||||
"sendtoaddress",
|
"sendtoaddress",
|
||||||
[mweb_addr, 1],
|
[mweb_addr, 1],
|
||||||
base_rpc_port=LTC_BASE_RPC_PORT,
|
base_rpc_port=LTC_BASE_RPC_PORT,
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
|
|
||||||
ltc_addr1 = callnoderpc(
|
ltc_addr1 = callnoderpc(
|
||||||
@@ -845,7 +845,7 @@ class BaseTest(unittest.TestCase):
|
|||||||
"getnewaddress",
|
"getnewaddress",
|
||||||
["initial addr"],
|
["initial addr"],
|
||||||
base_rpc_port=LTC_BASE_RPC_PORT,
|
base_rpc_port=LTC_BASE_RPC_PORT,
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
for i in range(5):
|
for i in range(5):
|
||||||
callnoderpc(
|
callnoderpc(
|
||||||
@@ -853,7 +853,7 @@ class BaseTest(unittest.TestCase):
|
|||||||
"sendtoaddress",
|
"sendtoaddress",
|
||||||
[ltc_addr1, 100],
|
[ltc_addr1, 100],
|
||||||
base_rpc_port=LTC_BASE_RPC_PORT,
|
base_rpc_port=LTC_BASE_RPC_PORT,
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
|
|
||||||
num_blocks = 69
|
num_blocks = 69
|
||||||
@@ -867,7 +867,7 @@ class BaseTest(unittest.TestCase):
|
|||||||
"generatetoaddress",
|
"generatetoaddress",
|
||||||
[num_blocks, cls.ltc_addr],
|
[num_blocks, cls.ltc_addr],
|
||||||
base_rpc_port=LTC_BASE_RPC_PORT,
|
base_rpc_port=LTC_BASE_RPC_PORT,
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
|
|
||||||
checkForks(
|
checkForks(
|
||||||
@@ -875,7 +875,7 @@ class BaseTest(unittest.TestCase):
|
|||||||
0,
|
0,
|
||||||
"getblockchaininfo",
|
"getblockchaininfo",
|
||||||
base_rpc_port=LTC_BASE_RPC_PORT,
|
base_rpc_port=LTC_BASE_RPC_PORT,
|
||||||
wallet="wallet.dat",
|
wallet="bsx_wallet",
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user