tx.tx_proxy.send_tx(): add test param
This commit is contained in:
parent
7e442eadad
commit
8b27679202
2 changed files with 4 additions and 4 deletions
|
|
@ -123,7 +123,7 @@ class OnlineSigned(Signed):
|
|||
await asyncio.sleep(2)
|
||||
from .tx_proxy import send_tx
|
||||
msg('{} TX: {}'.format('Testing' if cfg.test else 'Sending', coin_txid.hl()))
|
||||
if ret := send_tx(cfg, txhex):
|
||||
if ret := send_tx(cfg, txhex, test=cfg.test):
|
||||
if ret != coin_txid:
|
||||
ymsg(f'Warning: txid mismatch (after sending) ({ret} != {coin_txid})')
|
||||
sent_status = 'confirm_post_send'
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ class EtherscanTxProxyClient(TxProxyClient):
|
|||
msg(f'{type(e).__name__}: {e}')
|
||||
return CoinTxID(txid) if is_coin_txid(txid) else False
|
||||
|
||||
def send_tx(cfg, txhex):
|
||||
def send_tx(cfg, txhex, *, test=False):
|
||||
|
||||
c = get_client(cfg)
|
||||
msg(f'Using {pink(cfg.tx_proxy.upper())} tx proxy')
|
||||
|
|
@ -147,10 +147,10 @@ def send_tx(cfg, txhex):
|
|||
tx_hex = txhex)
|
||||
msg('done')
|
||||
|
||||
if cfg.test:
|
||||
if test:
|
||||
msg(f'Form retrieved from {orange(c.host)} and parsed')
|
||||
msg(green('Transaction can be sent'))
|
||||
return False
|
||||
return None
|
||||
|
||||
msg_r('Sending data...')
|
||||
result_text = c.post_form(data=post_data, timeout=180)
|
||||
|
|
|
|||
Loading…
Reference in a new issue