0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00

test: make CAddress in functional tests comparable

This way we can compare CAddress objects using `==` or even
arrays of CAddress using `array1 == array2`.
This commit is contained in:
Vasil Dimov 2021-06-11 15:33:23 +02:00
parent 33e211d2a4
commit e7468139a1
No known key found for this signature in database
GPG key ID: 54DF06F64B55CBBF

View file

@ -229,6 +229,9 @@ class CAddress:
self.ip = "0.0.0.0"
self.port = 0
def __eq__(self, other):
return self.net == other.net and self.ip == other.ip and self.nServices == other.nServices and self.port == other.port and self.time == other.time
def deserialize(self, f, *, with_time=True):
"""Deserialize from addrv1 format (pre-BIP155)"""
if with_time: