MCPcopy
hub / github.com/jimmysong/programmingbitcoin / test_serialize

Method test_serialize

code-ch08/script.py:222–226  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

220 self.assertEqual(script.cmds[1], want)
221
222 def test_serialize(self):
223 want = '6a47304402207899531a52d59a6de200179928ca900254a36b8dff8bb75f5f5d71b1cdc26125022008b422690b8461cb52c3cc30330b23d574351872b7c361e9aae3649071c1a7160121035d5c93d9ac96881f19ba1f686f15f009ded7c62efe85a872e6a19b43c15a2937'
224 script_pubkey = BytesIO(bytes.fromhex(want))
225 script = Script.parse(script_pubkey)
226 self.assertEqual(script.serialize().hex(), want)

Callers

nothing calls this directly

Calls 3

parseMethod · 0.45
hexMethod · 0.45
serializeMethod · 0.45

Tested by

no test coverage detected