This commit is contained in:
mainnet-pat
2024-10-30 06:07:29 +00:00
committed by nahuhh
parent ec1671911b
commit 32df813731
7 changed files with 25 additions and 82 deletions

View File

@@ -11,21 +11,14 @@ bch_lock_swipe_script = '4c8fc3519dc4519d02e80300c600cc949d00ce00d18800cf00d2880
coin_settings = {'rpcport': 0, 'rpcauth': 'none', 'blocks_confirmed': 1, 'conf_target': 1, 'use_segwit': False, 'connection_type': 'rpc'}
class TestXmrBchSwapInterface(unittest.TestCase):
# def test_generate_script(self):
# out_1 = bytes.fromhex('a9147171b53baf87efc9c78ffc0e37a78859cebaae4a87')
# out_2 = bytes.fromhex('a9147171b53baf87efc9c78ffc0e37a78859cebaae4a87')
# public_key = bytes.fromhex('03fff97bd5755eeea420453a14355235d382f6472f8568a18b2f057a1460297556')
# ci = BCHInterface(coin_settings, "regtest")
# print(ci.genScriptLockTxScript(None, 1000, out_1, out_2, public_key, 2).hex())
def test_extractScriptLockScriptValues(self):
ci = BCHInterface(coin_settings, "regtest")
script_bytes = CScript(bytes.fromhex(bch_lock_script))
ci.extractScriptLockScriptValues(script_bytes)
script_bytes = CScript(bytes.fromhex(bch_lock_spend_script))
signature, mining_fee, out_1, out_2, public_key, timelock = ci.extractScriptLockScriptValuesFromScriptSig(script_bytes)
ensure(signature is not None, 'signature not present')

View File

@@ -54,8 +54,6 @@ class TestFunctions(BaseTest):
extra_wait_time = 0
test_coin_from = Coins.BCH
def callnoderpc(self, method, params=[], wallet=None, node_id=0):
return callnoderpc(node_id, method, params, wallet, self.base_rpc_port)
@@ -86,6 +84,7 @@ class TestFunctions(BaseTest):
swap_clients[1].ci(Coins.XMR).setFeePriority(0)
class TestBCH(BasicSwapTest):
__test__ = True
test_coin_from = Coins.BCH
@@ -546,4 +545,4 @@ class TestBCH(BasicSwapTest):
def test_08_insufficient_funds_rev(self):
self.prepare_balance(Coins.BCH, 100.0, 1801, 1800)
super().test_08_insufficient_funds_rev()
super().test_08_insufficient_funds_rev()

View File

@@ -241,9 +241,11 @@ def prepare_swapclient_dir(datadir, node_id, network_key, network_pubkey, with_c
def btcCli(cmd, node_id=0):
return callrpc_cli(cfg.BITCOIN_BINDIR, os.path.join(TEST_DIR, 'btc_' + str(node_id)), 'regtest', cmd, cfg.BITCOIN_CLI)
def bchCli(cmd, node_id=0):
return callrpc_cli(cfg.BITCOINCASH_BINDIR, os.path.join(TEST_DIR, 'bch_' + str(node_id)), 'regtest', cmd, cfg.BITCOINCASH_CLI)
def ltcCli(cmd, node_id=0):
return callrpc_cli(cfg.LITECOIN_BINDIR, os.path.join(TEST_DIR, 'ltc_' + str(node_id)), 'regtest', cmd, cfg.LITECOIN_CLI)