mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 18:38:09 +01:00
XMR withdrawals work.
spendBLockTx uses sweep_all.
This commit is contained in:
@@ -4,7 +4,6 @@ import tests.basicswap.test_other as test_other
|
||||
import tests.basicswap.test_prepare as test_prepare
|
||||
import tests.basicswap.test_run as test_run
|
||||
import tests.basicswap.test_reload as test_reload
|
||||
import tests.basicswap.test_xmr as test_xmr
|
||||
|
||||
|
||||
def test_suite():
|
||||
@@ -13,6 +12,6 @@ def test_suite():
|
||||
suite.addTests(loader.loadTestsFromModule(test_prepare))
|
||||
suite.addTests(loader.loadTestsFromModule(test_run))
|
||||
suite.addTests(loader.loadTestsFromModule(test_reload))
|
||||
suite.addTests(loader.loadTestsFromModule(test_xmr))
|
||||
# TODO: Add to ci scripts suite.addTests(loader.loadTestsFromModule(test_xmr))
|
||||
|
||||
return suite
|
||||
|
||||
@@ -161,7 +161,7 @@ class Test(unittest.TestCase):
|
||||
assert(pubkey == pubkey_test)
|
||||
|
||||
def test_ecdsa_otves(self):
|
||||
coin_settings = {'rpcport': 0, 'rpcauth': 'none', 'blocks_confirmed': 1}
|
||||
coin_settings = {'rpcport': 0, 'rpcauth': 'none', 'blocks_confirmed': 1, 'conf_target': 1}
|
||||
ci = BTCInterface(coin_settings, 'regtest')
|
||||
vk_sign = i2b(ci.getNewSecretKey())
|
||||
vk_encrypt = i2b(ci.getNewSecretKey())
|
||||
@@ -183,7 +183,7 @@ class Test(unittest.TestCase):
|
||||
assert(vk_encrypt == recovered_key)
|
||||
|
||||
def test_dleag(self):
|
||||
coin_settings = {'rpcport': 0, 'walletrpcport': 0, 'walletrpcauth': 'none', 'blocks_confirmed': 1}
|
||||
coin_settings = {'rpcport': 0, 'walletrpcport': 0, 'walletrpcauth': 'none', 'blocks_confirmed': 1, 'conf_target': 1}
|
||||
ci = XMRInterface(coin_settings, 'regtest')
|
||||
|
||||
key = i2b(ci.getNewSecretKey())
|
||||
|
||||
@@ -547,9 +547,9 @@ class Test(unittest.TestCase):
|
||||
logging.info('---------- Test PART to XMR')
|
||||
swap_clients = self.swap_clients
|
||||
|
||||
js_0 = json.loads(urlopen('http://localhost:1801/json/wallets').read())
|
||||
assert(make_int(js_0[str(int(Coins.XMR))]['balance'], scale=12) > 0)
|
||||
assert(make_int(js_0[str(int(Coins.XMR))]['unconfirmed'], scale=12) > 0)
|
||||
js_1 = json.loads(urlopen('http://localhost:1801/json/wallets').read())
|
||||
assert(make_int(js_1[str(int(Coins.XMR))]['balance'], scale=12) > 0)
|
||||
assert(make_int(js_1[str(int(Coins.XMR))]['unconfirmed'], scale=12) > 0)
|
||||
|
||||
offer_id = swap_clients[0].postOffer(Coins.PART, Coins.XMR, 100 * COIN, 0.11 * XMR_COIN, 100 * COIN, SwapTypes.XMR_SWAP)
|
||||
self.wait_for_offer(swap_clients[1], offer_id)
|
||||
@@ -725,6 +725,14 @@ class Test(unittest.TestCase):
|
||||
|
||||
self.wait_for_no_offer(swap_clients[1], offer_id)
|
||||
|
||||
def test_08_withdraw(self):
|
||||
logging.info('---------- Test xmr withdrawals')
|
||||
swap_clients = self.swap_clients
|
||||
js_0 = json.loads(urlopen('http://localhost:1800/json/wallets').read())
|
||||
address_to = js_0[str(int(Coins.XMR))]['deposit_address']
|
||||
|
||||
swap_clients[1].withdrawCoin(Coins.XMR, 1.1, address_to, False)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user