regtest: remove coin component from data_dir path

This commit is contained in:
The MMGen Project 2024-10-08 12:55:57 +00:00
commit 75051cd831
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
3 changed files with 2 additions and 16 deletions

View file

@ -399,7 +399,7 @@ class Config(Lockable):
"""
if not hasattr(self,'_data_dir'):
self._data_dir = os.path.normpath(os.path.join(*{
'regtest': (self.data_dir_root, 'regtest', self.coin.lower(), (self.regtest_user or 'none') ),
'regtest': (self.data_dir_root, 'regtest', (self.regtest_user or 'none')),
'testnet': (self.data_dir_root, 'testnet'),
'mainnet': (self.data_dir_root,),
}[self.network] ))

View file

@ -41,7 +41,6 @@ class CmdTestAutosignAutomount(CmdTestAutosignThreaded, CmdTestRegtestBDBWallet)
('alice_bal1', 'checking Alice’s balance'),
('alice_txcreate1', 'creating a transaction'),
('alice_txcreate_bad_have_unsigned', 'creating the transaction again (error)'),
('copy_wallet', 'copying Alice’s wallet'),
('alice_run_autosign_setup', 'running ‘autosign setup’ (with default wallet)'),
('wait_loop_start', 'starting autosign wait loop'),
('alice_txstatus1', 'getting transaction status (unsigned)'),
@ -165,19 +164,6 @@ class CmdTestAutosignAutomount(CmdTestAutosignThreaded, CmdTestRegtestBDBWallet)
def alice_txcreate_bad_have_unsent(self):
return self._alice_txcreate(chg_addr='C:5', exit_val=2, expect_str='unsent transaction')
def copy_wallet(self):
self.spawn('', msg_only=True)
if cfg.coin == 'BTC':
return 'skip_msg'
src = Path(self.tr.data_dir, 'regtest', cfg.coin.lower(), 'alice')
dest = Path(self.tr.data_dir, 'regtest', 'btc', 'alice')
dest.mkdir(parents=True, exist_ok=True)
wf = Path(get_file_with_ext(src, 'mmdat')).absolute()
link_path = dest / wf.name
if not link_path.exists():
link_path.symlink_to(wf)
return 'ok'
def alice_run_autosign_setup(self):
return self.run_setup(mn_type='default', use_dfl_wallet=True, passwd=rt_pw)

View file

@ -559,7 +559,7 @@ class CmdTestRegtest(CmdTestBase,CmdTestShared):
return self.walletgen('alice')
def _user_dir(self, user, coin=None):
return joinpath(self.tr.data_dir, 'regtest', coin or self.coin, user)
return joinpath(self.tr.data_dir, 'regtest', user)
def _user_sid(self,user):
if user in self.user_sids: