|
24 | 24 | from jmclient import (YieldGeneratorBasic, load_test_config, jm_single,
|
25 | 25 | JMClientProtocolFactory, start_reactor, SegwitWallet, get_mchannels,
|
26 | 26 | SegwitLegacyWallet, JMWalletDaemon)
|
| 27 | +import jmclient |
27 | 28 | from jmclient.wallet_rpc import api_version_string
|
28 | 29 |
|
29 | 30 | log = get_log()
|
30 | 31 |
|
31 |
| -# For quicker testing, restrict the range of timelock |
32 |
| -# addresses to avoid slow load of multiple bots. |
33 |
| -# Note: no need to revert this change as test runs |
34 |
| -# in isolation. |
35 |
| -from jmclient import FidelityBondMixin |
36 |
| -FidelityBondMixin.TIMELOCK_ERA_YEARS = 2 |
37 |
| -FidelityBondMixin.TIMELOCK_EPOCH_YEAR = datetime.now().year |
38 |
| -FidelityBondMixin.TIMENUMBERS_PER_PUBKEY = 12 |
39 |
| - |
40 | 32 | wallet_name = "test-onion-yg-runner.jmdat"
|
41 | 33 |
|
42 | 34 | mean_amt = 2.0
|
@@ -196,8 +188,7 @@ def test_start_yg_and_taker_setup(setup_onion_ygrunner):
|
196 | 188 | wallet_service = wallet_services[end_bot_num - 1]['wallet']
|
197 | 189 | jmprint("\n\nTaker wallet seed : " + wallet_services[end_bot_num - 1]['seed'])
|
198 | 190 | # for manual audit if necessary, show the maker's wallet seeds
|
199 |
| - # also (note this audit should be automated in future, see |
200 |
| - # test_full_coinjoin.py in this directory) |
| 191 | + # also (note this audit should be automated in future) |
201 | 192 | jmprint("\n\nMaker wallet seeds: ")
|
202 | 193 | for i in range(start_bot_num, end_bot_num):
|
203 | 194 | jmprint("Maker seed: " + wallet_services[i - 1]['seed'])
|
@@ -331,8 +322,12 @@ def process_coinjoin_response(response):
|
331 | 322 | json_body = json.loads(response.decode("utf-8"))
|
332 | 323 | print("coinjoin response: {}".format(json_body))
|
333 | 324 |
|
334 |
| -@pytest.fixture(scope="module") |
335 |
| -def setup_onion_ygrunner(): |
| 325 | +@pytest.fixture |
| 326 | +def setup_onion_ygrunner(monkeypatch): |
| 327 | + # For quicker testing, restrict the range of timelock |
| 328 | + # addresses to avoid slow load of multiple bots. |
| 329 | + monkeypatch.setattr(jmclient.FidelityBondMixin, 'TIMELOCK_ERA_YEARS', 2) |
| 330 | + monkeypatch.setattr(jmclient.FidelityBondMixin, 'TIMELOCK_EPOCH_YEAR', datetime.now().year) |
336 | 331 | load_test_config()
|
337 | 332 | jm_single().bc_interface.tick_forward_chain_interval = 10
|
338 | 333 | jm_single().bc_interface.simulate_blocks()
|
0 commit comments