MCPcopy Index your code
hub / github.com/petertodd/python-bitcoinlib / test_serialization

Method test_serialization

bitcoin/tests/test_net.py:48–58  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

46
47class TestCInv(unittest.TestCase):
48 def test_serialization(self):
49 inv = CInv()
50 inv.type = 123
51 inv.hash = b"0" * 32
52 stream = BytesIO()
53
54 inv.stream_serialize(stream)
55 serialized = BytesIO(stream.getvalue())
56
57 deserialized = CInv.stream_deserialize(serialized)
58 self.assertEqual(deserialized, inv)
59
60
61class TestCAddress(unittest.TestCase):

Callers

nothing calls this directly

Calls 3

stream_serializeMethod · 0.95
CInvClass · 0.90
stream_deserializeMethod · 0.45

Tested by

no test coverage detected