Skip to content

Commit 5dc6d92

Browse files
committed
test: make BIP157 messages default-constructible (MESSAGEMAP compatibility)
In order to deserialize received or read messages via lookup in MESSAGEMAP (e.g.: `t = MESSAGEMAP[msgtype]()`), the messages must have a default constructor, i.e. there needs to be the possibility to initialize them with zero arguments.
1 parent 71e4cfe commit 5dc6d92

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/functional/test_framework/messages.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,7 +1672,7 @@ class msg_getcfilters:
16721672
__slots__ = ("filter_type", "start_height", "stop_hash")
16731673
msgtype = b"getcfilters"
16741674

1675-
def __init__(self, filter_type, start_height, stop_hash):
1675+
def __init__(self, filter_type=None, start_height=None, stop_hash=None):
16761676
self.filter_type = filter_type
16771677
self.start_height = start_height
16781678
self.stop_hash = stop_hash
@@ -1722,7 +1722,7 @@ class msg_getcfheaders:
17221722
__slots__ = ("filter_type", "start_height", "stop_hash")
17231723
msgtype = b"getcfheaders"
17241724

1725-
def __init__(self, filter_type, start_height, stop_hash):
1725+
def __init__(self, filter_type=None, start_height=None, stop_hash=None):
17261726
self.filter_type = filter_type
17271727
self.start_height = start_height
17281728
self.stop_hash = stop_hash
@@ -1775,7 +1775,7 @@ class msg_getcfcheckpt:
17751775
__slots__ = ("filter_type", "stop_hash")
17761776
msgtype = b"getcfcheckpt"
17771777

1778-
def __init__(self, filter_type, stop_hash):
1778+
def __init__(self, filter_type=None, stop_hash=None):
17791779
self.filter_type = filter_type
17801780
self.stop_hash = stop_hash
17811781

0 commit comments

Comments
 (0)