MCPcopy
hub / github.com/petertodd/python-bitcoinlib / test_serializationIPv6

Method test_serializationIPv6

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

Source from the content-addressed store, hash-verified

81 self.assertEqual(cSerialized, cSerializedTwice)
82
83 def test_serializationIPv6(self):
84 c = CAddress()
85 c.ip = "1234:ABCD:1234:ABCD:1234:00:ABCD:1234"
86 c.port = 8333
87 c.nTime = 1420576401
88
89 cSerialized = c.serialize()
90 cDeserialized = CAddress.deserialize(cSerialized)
91
92 self.assertEqual(c, cDeserialized)
93
94 cSerializedTwice = cDeserialized.serialize()
95 self.assertEqual(cSerialized, cSerializedTwice)
96
97 def test_serializationDiff(self):
98 # Sanity check that the serialization code preserves differences

Callers

nothing calls this directly

Calls 3

CAddressClass · 0.90
serializeMethod · 0.45
deserializeMethod · 0.45

Tested by

no test coverage detected