Skip to content

Commit bdb8b9a

Browse files
committed
test: doc: improve doc for from_hex helper (mention to_hex alternative)
1 parent 1914054 commit bdb8b9a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/functional/test_framework/messages.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,12 @@ def ser_string_vector(l):
190190
return r
191191

192192

193-
# Deserialize from a hex string representation (eg from RPC)
194193
def from_hex(obj, hex_string):
194+
"""Deserialize from a hex string representation (e.g. from RPC)
195+
196+
Note that there is no complementary helper like e.g. `to_hex` for the
197+
inverse operation. To serialize a message object to a hex string, simply
198+
use obj.serialize().hex()"""
195199
obj.deserialize(BytesIO(hex_str_to_bytes(hex_string)))
196200
return obj
197201

0 commit comments

Comments
 (0)