From acffdda3093aa3f8e9d8b5482d4c8879e669e4bf Mon Sep 17 00:00:00 2001 From: The MMGen Project Date: Mon, 29 Sep 2025 23:09:17 +0000 Subject: [PATCH] minor cleanups (2 files) --- mmgen/proto/btc/tx/op_return_data.py | 10 +++++----- test/daemontest_d/tx.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/mmgen/proto/btc/tx/op_return_data.py b/mmgen/proto/btc/tx/op_return_data.py index 7061b30d..5025c5e9 100755 --- a/mmgen/proto/btc/tx/op_return_data.py +++ b/mmgen/proto/btc/tx/op_return_data.py @@ -18,9 +18,9 @@ class OpReturnData(bytes, InitErrors): def __new__(cls, proto, data_spec): - desc = 'OpReturnData initializer' + desc = 'OP_RETURN data' - assert isinstance(data_spec, str), f'{desc} must be a string' + assert isinstance(data_spec, str), f'{desc} argument must be a string' if data_spec.startswith('hexdata:'): hexdata = data_spec[8:] @@ -32,12 +32,12 @@ class OpReturnData(bytes, InitErrors): try: ret = data_spec[5:].encode('utf8') except: - raise ValueError(f'{desc} string be UTF-8 encoded') + raise ValueError(f'{desc} value must be UTF-8 encoded') else: - raise ValueError(f'{desc} string must start with ‘data:’ or ‘hexdata:’') + raise ValueError(f'{desc} argument must start with ‘data:’ or ‘hexdata:’') assert 1 <= len(ret) <= proto.max_op_return_data_len, ( - f'{len(ret)}: {desc} string encoded byte length not in range 1-{proto.max_op_return_data_len}') + f'{len(ret)}: invalid {desc} length: not in range 1-{proto.max_op_return_data_len}') return bytes.__new__(cls, ret) diff --git a/test/daemontest_d/tx.py b/test/daemontest_d/tx.py index 87d6fab4..597c8200 100755 --- a/test/daemontest_d/tx.py +++ b/test/daemontest_d/tx.py @@ -47,7 +47,7 @@ async def test_tx(tx_proto, tx_hex, desc, n): dt = DeserializeTX(tx_proto, tx_hex) if cfg.verbose: - Msg('\n\n================================ Core vector: ==================================') + Msg('\n\n=============================== Bitcoin Core: ==================================') Msg_r('.' if cfg.quiet else f'{n:>3}) {desc}\n') if cfg.verbose: Pmsg(d)