From 152901143c1679d82e26dc676e72cc200e21990b Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Thu, 10 Feb 2022 12:51:41 +0000 Subject: [PATCH] relocate module: regtest -> base_proto.bitcoin.regtest --- mmgen/base_proto/bitcoin/daemon.py | 2 +- mmgen/{ => base_proto/bitcoin}/regtest.py | 12 ++++++------ mmgen/main_regtest.py | 2 +- mmgen/opts.py | 2 +- test/test_py_d/ts_regtest.py | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) rename mmgen/{ => base_proto/bitcoin}/regtest.py (96%) diff --git a/mmgen/base_proto/bitcoin/daemon.py b/mmgen/base_proto/bitcoin/daemon.py index 39a9d436..20443788 100755 --- a/mmgen/base_proto/bitcoin/daemon.py +++ b/mmgen/base_proto/bitcoin/daemon.py @@ -55,7 +55,7 @@ class bitcoin_core_daemon(CoinDaemon): """ fall back on hard-coded credentials """ - from ...regtest import MMGenRegtest + from .regtest import MMGenRegtest self.rpc_user = MMGenRegtest.rpc_user self.rpc_password = MMGenRegtest.rpc_password diff --git a/mmgen/regtest.py b/mmgen/base_proto/bitcoin/regtest.py similarity index 96% rename from mmgen/regtest.py rename to mmgen/base_proto/bitcoin/regtest.py index f72cc2dc..2673a5d8 100755 --- a/mmgen/regtest.py +++ b/mmgen/base_proto/bitcoin/regtest.py @@ -17,14 +17,14 @@ # along with this program. If not, see . """ -regtest: Coin daemon regression test mode setup and operations for the MMGen suite +base_proto.bitcoin.regtest: Coin daemon regression test mode setup and operations """ import os,time,shutil,json,re from subprocess import run,PIPE -from .common import * -from .protocol import init_proto -from .rpc import rpc_init,json_encoder +from ...common import * +from ...protocol import init_proto +from ...rpc import rpc_init,json_encoder def create_data_dir(data_dir): try: os.stat(os.path.join(data_dir,'regtest')) @@ -47,7 +47,7 @@ miner_addr = { } def create_hdseed(proto): - from .tool.api import tool_api + from ...tool.api import tool_api t = tool_api() t.init_coin(proto.coin,proto.network) t.addrtype = 'compressed' if proto.coin == 'BCH' else 'bech32' @@ -77,7 +77,7 @@ class MMGenRegtest(MMGenObject): self.coin = coin.lower() assert self.coin in self.coins, f'{coin!r}: invalid coin for regtest' - from .daemon import CoinDaemon + from ...daemon import CoinDaemon self.proto = init_proto(self.coin,regtest=True,need_amt=True) self.d = CoinDaemon(self.coin+'_rt',test_suite=g.test_suite) diff --git a/mmgen/main_regtest.py b/mmgen/main_regtest.py index 992f0800..c7052559 100755 --- a/mmgen/main_regtest.py +++ b/mmgen/main_regtest.py @@ -57,7 +57,7 @@ opts_data = { cmd_args = opts.init(opts_data) -from .regtest import MMGenRegtest +from .base_proto.bitcoin.regtest import MMGenRegtest def check_num_args(): m = getattr(MMGenRegtest,cmd_args[0]) diff --git a/mmgen/opts.py b/mmgen/opts.py index c05f2b5a..ed1a746d 100755 --- a/mmgen/opts.py +++ b/mmgen/opts.py @@ -574,7 +574,7 @@ def check_usr_opts(usr_opts): # Raises an exception if any check fails # die( 'UserOptError', f'--rbf requested, but {proto.coin} does not support replace-by-fee transactions' ) # def chk_bob(key,val,desc): -# from .regtest import MMGenRegtest +# from .base_proto.bitcoin.regtest import MMGenRegtest # try: # os.stat(os.path.join(MMGenRegtest(g.coin).d.datadir,'regtest','debug.log')) # except: diff --git a/test/test_py_d/ts_regtest.py b/test/test_py_d/ts_regtest.py index ff829e47..90cf211f 100755 --- a/test/test_py_d/ts_regtest.py +++ b/test/test_py_d/ts_regtest.py @@ -424,7 +424,7 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared): if not self.deterministic: return 'skip' self.spawn('',msg_only=True) - from mmgen.regtest import MMGenRegtest + from mmgen.base_proto.bitcoin.regtest import MMGenRegtest rt = MMGenRegtest(self.proto.coin) await rt.stop() from shutil import rmtree