Browse Source

minor cleanups (2 files)

The MMGen Project 2 months ago
parent
commit
acffdda309
2 changed files with 6 additions and 6 deletions
  1. 5 5
      mmgen/proto/btc/tx/op_return_data.py
  2. 1 1
      test/daemontest_d/tx.py

+ 5 - 5
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)
 

+ 1 - 1
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)