From 8b27679202391cdeaa70f8b30fd4aa30331a87eb Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Tue, 27 Oct 2026 13:30:14 +0000 Subject: [PATCH] tx.tx_proxy.send_tx(): add `test` param --- mmgen/tx/online.py | 2 +- mmgen/tx/tx_proxy.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mmgen/tx/online.py b/mmgen/tx/online.py index b3192b82..68915462 100644 --- a/mmgen/tx/online.py +++ b/mmgen/tx/online.py @@ -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' diff --git a/mmgen/tx/tx_proxy.py b/mmgen/tx/tx_proxy.py index fbbaa15b..7863a0ee 100644 --- a/mmgen/tx/tx_proxy.py +++ b/mmgen/tx/tx_proxy.py @@ -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)