mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 18:38:09 +01:00
Start on network.
This commit is contained in:
@@ -43,6 +43,7 @@ from tests.basicswap.common import (
|
||||
checkForks,
|
||||
stopDaemons,
|
||||
wait_for_offer,
|
||||
delay_for,
|
||||
TEST_HTTP_HOST,
|
||||
TEST_HTTP_PORT,
|
||||
BASE_P2P_PORT,
|
||||
@@ -142,13 +143,12 @@ def callnoderpc(node_id, method, params=[], wallet=None, base_rpc_port=BASE_RPC_
|
||||
|
||||
def run_coins_loop(cls):
|
||||
while not stop_test:
|
||||
time.sleep(1.0)
|
||||
try:
|
||||
if cls.btc_addr is not None:
|
||||
btcRpc('generatetoaddress 1 {}'.format(cls.btc_addr))
|
||||
except Exception as e:
|
||||
logging.warning('run_coins_loop ' + str(e))
|
||||
|
||||
time.sleep(1.0)
|
||||
|
||||
|
||||
def run_loop(cls):
|
||||
@@ -303,6 +303,10 @@ class Test(unittest.TestCase):
|
||||
offer_id = swap_clients[0].postOffer(Coins.PART, Coins.BTC, 100 * COIN, 0.1 * COIN, 100 * COIN, SwapTypes.SELLER_FIRST)
|
||||
wait_for_offer(delay_event, swap_clients[1], offer_id)
|
||||
|
||||
swap_clients[1].add_connection('127.0.0.1', BASE_P2P_PORT + 0, swap_clients[0]._network._network_pubkey)
|
||||
|
||||
delay_for(delay_event, 1000)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
|
||||
@@ -206,19 +206,19 @@ def signal_handler(sig, frame):
|
||||
|
||||
def run_coins_loop(cls):
|
||||
while not stop_test:
|
||||
time.sleep(1.0)
|
||||
try:
|
||||
nmcRpc('generatetoaddress 1 {}'.format(cls.nmc_addr))
|
||||
btcRpc('generatetoaddress 1 {}'.format(cls.btc_addr))
|
||||
except Exception as e:
|
||||
logging.warning('run_coins_loop ' + str(e))
|
||||
time.sleep(1.0)
|
||||
|
||||
|
||||
def run_loop(self):
|
||||
while not stop_test:
|
||||
time.sleep(1)
|
||||
for c in self.swap_clients:
|
||||
c.update()
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
def make_part_cli_rpc_func(node_id):
|
||||
|
||||
@@ -215,18 +215,18 @@ def signal_handler(sig, frame):
|
||||
def run_coins_loop(cls):
|
||||
while not stop_test:
|
||||
try:
|
||||
time.sleep(1.0)
|
||||
ltcRpc('generatetoaddress 1 {}'.format(cls.ltc_addr))
|
||||
btcRpc('generatetoaddress 1 {}'.format(cls.btc_addr))
|
||||
except Exception as e:
|
||||
logging.warning('run_coins_loop ' + str(e))
|
||||
time.sleep(1.0)
|
||||
|
||||
|
||||
def run_loop(cls):
|
||||
while not stop_test:
|
||||
time.sleep(1)
|
||||
for c in cls.swap_clients:
|
||||
c.update()
|
||||
time.sleep(1)
|
||||
|
||||
|
||||
def make_part_cli_rpc_func(node_id):
|
||||
|
||||
@@ -238,7 +238,6 @@ def callnoderpc(node_id, method, params=[], wallet=None, base_rpc_port=BASE_RPC_
|
||||
|
||||
def run_coins_loop(cls):
|
||||
while not stop_test:
|
||||
time.sleep(1.0)
|
||||
try:
|
||||
if cls.btc_addr is not None:
|
||||
btcRpc('generatetoaddress 1 {}'.format(cls.btc_addr))
|
||||
@@ -246,6 +245,7 @@ def run_coins_loop(cls):
|
||||
callrpc_xmr_na(XMR_BASE_RPC_PORT + 1, 'generateblocks', {'wallet_address': cls.xmr_addr, 'amount_of_blocks': 1})
|
||||
except Exception as e:
|
||||
logging.warning('run_coins_loop ' + str(e))
|
||||
time.sleep(1.0)
|
||||
|
||||
|
||||
def run_loop(cls):
|
||||
|
||||
Reference in New Issue
Block a user