mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-25 10:43:19 -03:00
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.
This commit is contained in:
parent
71e4cfefe7
commit
5dc6d92077
1 changed files with 3 additions and 3 deletions
|
@ -1672,7 +1672,7 @@ class msg_getcfilters:
|
|||
__slots__ = ("filter_type", "start_height", "stop_hash")
|
||||
msgtype = b"getcfilters"
|
||||
|
||||
def __init__(self, filter_type, start_height, stop_hash):
|
||||
def __init__(self, filter_type=None, start_height=None, stop_hash=None):
|
||||
self.filter_type = filter_type
|
||||
self.start_height = start_height
|
||||
self.stop_hash = stop_hash
|
||||
|
@ -1722,7 +1722,7 @@ class msg_getcfheaders:
|
|||
__slots__ = ("filter_type", "start_height", "stop_hash")
|
||||
msgtype = b"getcfheaders"
|
||||
|
||||
def __init__(self, filter_type, start_height, stop_hash):
|
||||
def __init__(self, filter_type=None, start_height=None, stop_hash=None):
|
||||
self.filter_type = filter_type
|
||||
self.start_height = start_height
|
||||
self.stop_hash = stop_hash
|
||||
|
@ -1775,7 +1775,7 @@ class msg_getcfcheckpt:
|
|||
__slots__ = ("filter_type", "stop_hash")
|
||||
msgtype = b"getcfcheckpt"
|
||||
|
||||
def __init__(self, filter_type, stop_hash):
|
||||
def __init__(self, filter_type=None, stop_hash=None):
|
||||
self.filter_type = filter_type
|
||||
self.stop_hash = stop_hash
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue