transaction: tx_from_any: follow-up: only rm whitespaces from strings
This commit is contained in:
@@ -276,11 +276,11 @@ class TestTransaction(ElectrumTestCase):
|
||||
data = raw_tx.data
|
||||
tx_from_any(data) # test if raises (should not)
|
||||
else:
|
||||
mid = len(raw_tx.data) // 2
|
||||
if isinstance(raw_tx.data, str):
|
||||
mid = len(raw_tx.data) // 2 # for str, sprinkle whitespaces all over
|
||||
data = whitespace_str + raw_tx.data[:mid] + whitespace_str + raw_tx.data[mid:] + whitespace_str
|
||||
else:
|
||||
data = whitespace_bytes + raw_tx.data[:mid] + whitespace_bytes + raw_tx.data[mid:] + whitespace_bytes
|
||||
else: # bytes only tolerate whitespaces that are leading/trailing
|
||||
data = whitespace_bytes + raw_tx.data + whitespace_bytes
|
||||
if raw_tx.is_whitespace_allowed:
|
||||
tx_from_any(data) # test if raises (should not)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user