diff --git a/mmgen/main_addrimport.py b/mmgen/main_addrimport.py index 83321a1b..320d7178 100755 --- a/mmgen/main_addrimport.py +++ b/mmgen/main_addrimport.py @@ -81,7 +81,7 @@ addrimport_msgs = { """ } -def parse_cmd_args(rpc, cmd_args): +def parse_cmd_args(cmd_args): def import_mmgen_list(infile): return (AddrList, KeyAddrList)[bool(cfg.keyaddr_file)](cfg, proto, infile=infile) @@ -146,7 +146,7 @@ async def main(): for k, v in addrimport_msgs.items(): addrimport_msgs[k] = fmt(v, indent=' ', strip_char='\t').rstrip() - al, infile = parse_cmd_args(twctl.rpc, cfg._args) + al, infile = parse_cmd_args(cfg._args) cfg._util.qmsg( f'OK. {al.num_addrs} addresses' diff --git a/mmgen/obj.py b/mmgen/obj.py index 4941b05d..e12d70fd 100755 --- a/mmgen/obj.py +++ b/mmgen/obj.py @@ -124,10 +124,11 @@ class ImmutableAttr: # Descriptor def assign_with_check(instance, value): if type(value) is dtype: return value - raise TypeError('Attribute {!r} of {} instance must of type {}'.format( + raise TypeError('Attribute {!r} of {} instance must be of type {}, not {}'.format( self.name, type(instance).__name__, - dtype)) + dtype, + type(value))) self.conv = assign_with_check def __set_name__(self, owner, name): diff --git a/mmgen/proto/btc/tw/ctl.py b/mmgen/proto/btc/tw/ctl.py index 1af357dd..4c34f2bf 100755 --- a/mmgen/proto/btc/tw/ctl.py +++ b/mmgen/proto/btc/tw/ctl.py @@ -20,9 +20,6 @@ class BitcoinTwCtl(TwCtl): def init_empty(self): self.data = {'coin': self.proto.coin, 'addresses': {}} - def upgrade_wallet_maybe(self): - pass - async def rpc_get_balance(self, addr, block='latest'): raise NotImplementedError('not implemented') diff --git a/mmgen/proto/eth/tw/ctl.py b/mmgen/proto/eth/tw/ctl.py index 59493363..30098e9e 100755 --- a/mmgen/proto/eth/tw/ctl.py +++ b/mmgen/proto/eth/tw/ctl.py @@ -174,7 +174,7 @@ class EthereumTwCtl(TwCtl): def used_addrs(self): from decimal import Decimal return ( - {k for k, v in self.data['accounts'].items() if Decimal(v['balance'])} | + {k for k, v in self.data['accounts'].items() if Decimal(v.get('balance', 0))} | {k for t in self.data['tokens'].values() for k, v in t.items() if Decimal(v.get('balance', 0))}) diff --git a/mmgen/tw/addresses.py b/mmgen/tw/addresses.py index d3ad0fe4..ddcbc24c 100755 --- a/mmgen/tw/addresses.py +++ b/mmgen/tw/addresses.py @@ -132,7 +132,7 @@ class TwAddresses(TwView): (not (d.is_used and not self.showused) and (d.amt or self.showempty)) ) - def get_column_widths(self, data, wide, interactive): + def get_column_widths(self, data, *, wide, interactive): return self.compute_column_widths( widths = { # fixed cols diff --git a/mmgen/tw/ctl.py b/mmgen/tw/ctl.py index 5ea59330..d9330785 100755 --- a/mmgen/tw/ctl.py +++ b/mmgen/tw/ctl.py @@ -110,6 +110,9 @@ class TwCtl(MMGenObject, metaclass=AsyncInit): self.conv_types(self.data[self.data_key]) + def upgrade_wallet_maybe(self): + pass + def init_from_wallet_file(self): from ..fileutil import check_or_create_dir, get_data_from_file check_or_create_dir(self.tw_dir) diff --git a/test/cmdtest_d/ethswap.py b/test/cmdtest_d/ethswap.py index 6401d3f6..cd5b73d4 100755 --- a/test/cmdtest_d/ethswap.py +++ b/test/cmdtest_d/ethswap.py @@ -466,7 +466,8 @@ class CmdTestEthSwapEth(CmdTestEthSwapMethods, CmdTestSwapMethods, CmdTestEthdev return self._swaptxsend(add_opts=['--verbose', '--status'], status=True) def swaptxmemo4(self): - self.mining_delay() + import time + time.sleep(1) return self._check_token_swaptx_memo('=:b:mkQsXA7mqDtnUpkaXMbDtAL1KMeof4GPw3:0/3/0') def swaptxreceipt4(self):