NewTX, BumpTX: remove unnecessary async call
This commit is contained in:
parent
bcb6170195
commit
131787afb8
9 changed files with 13 additions and 13 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue