MCPcopy Create free account
hub / github.com/ElementsProject/elements / from_hex

Function from_hex

test/functional/test_framework/messages.py:196–203  ·  view source on GitHub ↗

Deserialize from a hex string representation (e.g. from RPC) Note that there is no complementary helper like e.g. `to_hex` for the inverse operation. To serialize a message object to a hex string, simply use obj.serialize().hex()

(obj, hex_string)

Source from the content-addressed store, hash-verified

194
195
196def from_hex(obj, hex_string):
197 """Deserialize from a hex string representation (e.g. from RPC)
198
199 Note that there is no complementary helper like e.g. `to_hex` for the
200 inverse operation. To serialize a message object to a hex string, simply
201 use obj.serialize().hex()"""
202 obj.deserialize(BytesIO(bytes.fromhex(hex_string)))
203 return obj
204
205
206def tx_from_hex(hex_string):

Callers 14

run_testMethod · 0.90
run_testMethod · 0.90
build_block_on_tipMethod · 0.90
test_coinbase_witnessMethod · 0.90
mine_blockMethod · 0.90
mine_blockMethod · 0.90
mine_large_blocksMethod · 0.90
assert_tx_validMethod · 0.90
run_testMethod · 0.90

Calls 1

deserializeMethod · 0.45