Skip to content

Commit e746813

Browse files
committed
test: make CAddress in functional tests comparable
This way we can compare CAddress objects using `==` or even arrays of CAddress using `array1 == array2`.
1 parent 33e211d commit e746813

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

test/functional/test_framework/messages.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ def __init__(self):
229229
self.ip = "0.0.0.0"
230230
self.port = 0
231231

232+
def __eq__(self, other):
233+
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
234+
232235
def deserialize(self, f, *, with_time=True):
233236
"""Deserialize from addrv1 format (pre-BIP155)"""
234237
if with_time:

0 commit comments

Comments
 (0)