proto.eth.tx.bump: fix file ext; tx.tx_proxy: error handling

This commit is contained in:
The MMGen Project 2025-05-07 18:24:07 +00:00
commit cfdd10dc60
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
2 changed files with 13 additions and 7 deletions

View file

@ -18,6 +18,7 @@ from ....tx import bump as TxBase
from .completed import Completed, TokenCompleted
from .new import TokenNew
from .new_swap import NewSwap
from .unsigned import AutomountUnsigned, TokenAutomountUnsigned
class Bump(Completed, NewSwap, TxBase.Bump):
desc = 'fee-bumped transaction'
@ -39,7 +40,9 @@ class TokenBump(TokenCompleted, TokenNew, Bump):
desc = 'fee-bumped transaction'
class AutomountBump(Bump):
pass
ext = AutomountUnsigned.ext
automount = AutomountUnsigned.automount
class TokenAutomountBump(TokenBump):
pass
ext = TokenAutomountUnsigned.ext
automount = TokenAutomountUnsigned.automount

View file

@ -164,11 +164,14 @@ class EtherscanTxProxyClient(TxProxyClient):
from ..obj import CoinTxID, is_coin_txid
form = self.get_form_element(result_text)
json_text = form.find('div/div/div')[1].tail
txid = json.loads(json_text)['result'].removeprefix('0x')
if is_coin_txid(txid):
return CoinTxID(txid)
else:
return False
txid = None
try:
txid = json.loads(json_text)['result'].removeprefix('0x')
except json.JSONDecodeError:
msg(json_text)
except Exception as e:
msg(f'{type(e).__name__}: {e}')
return CoinTxID(txid) if is_coin_txid(txid) else False
def send_tx(cfg, txhex):