diff --git a/mmgen/main_txbump.py b/mmgen/main_txbump.py index 74c1b60a..179f6c5d 100755 --- a/mmgen/main_txbump.py +++ b/mmgen/main_txbump.py @@ -188,7 +188,7 @@ async def main(): msg(orig_tx.info.format(terse=True)) from .tw.ctl import TwCtl - tx = await BumpTX( + tx = BumpTX( cfg = cfg, data = orig_tx.__dict__, automount = cfg.autosign, diff --git a/mmgen/main_txcreate.py b/mmgen/main_txcreate.py index aadc1585..85d183c1 100755 --- a/mmgen/main_txcreate.py +++ b/mmgen/main_txcreate.py @@ -135,7 +135,7 @@ async def main(): proto = cfg._proto from .tx import NewTX - tx1 = await NewTX(cfg=cfg, proto=proto, target=target) + tx1 = NewTX(cfg=cfg, proto=proto, target=target) tx2 = await tx1.create( cmd_args = cfg._args, diff --git a/mmgen/main_txdo.py b/mmgen/main_txdo.py index 02aeb29c..fd970f75 100755 --- a/mmgen/main_txdo.py +++ b/mmgen/main_txdo.py @@ -170,7 +170,7 @@ async def main(): else: proto = cfg._proto - tx1 = await NewTX(cfg=cfg, proto=proto, target=target) + tx1 = NewTX(cfg=cfg, proto=proto, target=target) tx2 = await tx1.create( cmd_args = cfg._args, diff --git a/mmgen/proto/btc/tx/unsigned.py b/mmgen/proto/btc/tx/unsigned.py index 26689ef8..5dd3f1fe 100755 --- a/mmgen/proto/btc/tx/unsigned.py +++ b/mmgen/proto/btc/tx/unsigned.py @@ -67,7 +67,7 @@ class Unsigned(Completed, TxBase.Unsigned): try: self.update_serialized(ret['hex']) from ....tx import SignedTX - new = await SignedTX(cfg=self.cfg, data=self.__dict__, automount=self.automount) + new = SignedTX(cfg=self.cfg, data=self.__dict__, automount=self.automount) tx_decoded = await self.rpc.call('decoderawtransaction', ret['hex']) new.compare_size_and_estimated_size(tx_decoded) new.coin_txid = CoinTxID(self.deserialized.txid) diff --git a/mmgen/proto/eth/tx/new.py b/mmgen/proto/eth/tx/new.py index 64eaba9d..7940cf34 100755 --- a/mmgen/proto/eth/tx/new.py +++ b/mmgen/proto/eth/tx/new.py @@ -246,7 +246,7 @@ class TokenNew(TokenBase, New): data = t.create_transfer_data( to_addr = to_addr or self.outputs[0].addr, - amt = self.outputs[0].amt or await self.twuo.twctl.get_balance(self.inputs[0].addr), + amt = self.outputs[0].amt or await self.twctl.get_balance(self.inputs[0].addr), op = self.token_op) try: diff --git a/mmgen/proto/eth/tx/unsigned.py b/mmgen/proto/eth/tx/unsigned.py index e49f4fa2..58ab401b 100755 --- a/mmgen/proto/eth/tx/unsigned.py +++ b/mmgen/proto/eth/tx/unsigned.py @@ -95,7 +95,7 @@ class Unsigned(Completed, TxBase.Unsigned): await self.do_sign(o, keys[0].sec.wif) msg('OK') from ....tx import SignedTX - tx = await SignedTX(cfg=self.cfg, data=self.__dict__, automount=self.automount) + tx = SignedTX(cfg=self.cfg, data=self.__dict__, automount=self.automount) tx.check_serialized_integrity() return tx except Exception as e: diff --git a/mmgen/tx/__init__.py b/mmgen/tx/__init__.py index 4098723a..4a76d02e 100755 --- a/mmgen/tx/__init__.py +++ b/mmgen/tx/__init__.py @@ -77,8 +77,6 @@ async def _get_obj_async(_clsname, _modname, **kwargs): # No twctl required for the Unsigned and Signed(data=unsigned.__dict__) classes used during # signing. if proto and proto.tokensym and clsname in ( - 'New', - 'NewSwap', 'OnlineSigned', 'AutomountOnlineSigned', 'Sent', @@ -95,12 +93,12 @@ def _get_async(clsname, modname): return lambda **kwargs: _get_obj_async(clsname, modname, **kwargs) BaseTX = _get('Base', 'base') +NewTX = _get('New', 'new') +NewSwapTX = _get('NewSwap', 'new_swap') +BumpTX = _get('Bump', 'bump') UnsignedTX = _get('Unsigned', 'unsigned') +SignedTX = _get('Signed', 'signed') -NewTX = _get_async('New', 'new') -NewSwapTX = _get_async('NewSwap', 'new_swap') CompletedTX = _get_async('Completed', 'completed') -SignedTX = _get_async('Signed', 'signed') OnlineSignedTX = _get_async('OnlineSigned', 'online') SentTX = _get_async('Sent', 'online') -BumpTX = _get_async('Bump', 'bump') diff --git a/mmgen/tx/new.py b/mmgen/tx/new.py index 676fb50d..7838565c 100755 --- a/mmgen/tx/new.py +++ b/mmgen/tx/new.py @@ -469,6 +469,7 @@ class New(Base): minconf = self.cfg.minconf, addrs = await self.get_input_addrs_from_inputs_opt()) await self.twuo.get_data() + self.twctl = self.twuo.twctl from ..ui import do_license_msg do_license_msg(self.cfg) @@ -480,6 +481,7 @@ class New(Base): self.twuo.display_total() if do_info: + del self.twctl del self.twuo.twctl import sys sys.exit(0) diff --git a/test/daemontest_d/tx.py b/test/daemontest_d/tx.py index 10b36886..87d6fab4 100755 --- a/test/daemontest_d/tx.py +++ b/test/daemontest_d/tx.py @@ -114,7 +114,7 @@ class unit_tests: d.start() proto = init_proto(cfg, 'btc', need_amt=True) - await NewTX(cfg=cfg, proto=proto, target='tx') + NewTX(cfg=cfg, proto=proto, target='tx') d.stop() d.remove_datadir()