From f05858a01f8a71a2375583bf1099a367b1f79fb7 Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Sat, 15 Nov 2025 09:50:21 +0000 Subject: [PATCH] tw.store: new `get_tw_dir()` classmethod --- mmgen/tw/store.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/mmgen/tw/store.py b/mmgen/tw/store.py index 7766f3b3..5ef12261 100755 --- a/mmgen/tw/store.py +++ b/mmgen/tw/store.py @@ -47,12 +47,7 @@ class TwCtlWithStore(TwCtl, metaclass=AsyncInit): if cfg.cached_balances: self.use_cached_balances = True - self.tw_dir = Path( - self.cfg.data_dir_root, - 'altcoins', - self.proto.coin.lower(), - ('' if self.proto.network == 'mainnet' else self.proto.network) - ) + self.tw_dir = type(self).get_tw_dir(self.cfg, self.proto) self.tw_path = self.tw_dir / self.tw_fn if no_wallet_init: @@ -84,6 +79,14 @@ class TwCtlWithStore(TwCtl, metaclass=AsyncInit): elif self.cfg.debug: msg('read-only wallet, doing nothing') + @classmethod + def get_tw_dir(cls, cfg, proto): + return Path( + cfg.data_dir_root, + 'altcoins', + proto.coin.lower(), + ('' if proto.network == 'mainnet' else proto.network)) + def upgrade_wallet_maybe(self): pass