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

Method test_serialize

code-ch13/network.py:184–186  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

182class VersionMessageTest(TestCase):
183
184 def test_serialize(self):
185 v = VersionMessage(timestamp=0, nonce=b'\x00' * 8)
186 self.assertEqual(v.serialize().hex(), '7f11010000000000000000000000000000000000000000000000000000000000000000000000ffff00000000208d000000000000000000000000000000000000ffff00000000208d0000000000000000182f70726f6772616d6d696e67626974636f696e3a302e312f0000000000')
187
188
189class VerAckMessage:

Callers

nothing calls this directly

Calls 3

serializeMethod · 0.95
VersionMessageClass · 0.70
hexMethod · 0.45

Tested by

no test coverage detected