mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-03-25 15:05:55 +01:00
test: Add functional tests for sendtxrcncl from inbound
This commit is contained in:
@@ -1838,3 +1838,31 @@ class msg_cfcheckpt:
|
||||
def __repr__(self):
|
||||
return "msg_cfcheckpt(filter_type={:#x}, stop_hash={:x})".format(
|
||||
self.filter_type, self.stop_hash)
|
||||
|
||||
class msg_sendtxrcncl:
|
||||
__slots__ = ("initiator", "responder", "version", "salt")
|
||||
msgtype = b"sendtxrcncl"
|
||||
|
||||
def __init__(self):
|
||||
self.initiator = False
|
||||
self.responder = False
|
||||
self.version = 0
|
||||
self.salt = 0
|
||||
|
||||
def deserialize(self, f):
|
||||
self.initiator = struct.unpack("<?", f.read(1))[0]
|
||||
self.responder = struct.unpack("<?", f.read(1))[0]
|
||||
self.version = struct.unpack("<I", f.read(4))[0]
|
||||
self.salt = struct.unpack("<Q", f.read(8))[0]
|
||||
|
||||
def serialize(self):
|
||||
r = b""
|
||||
r += struct.pack("<?", self.initiator)
|
||||
r += struct.pack("<?", self.responder)
|
||||
r += struct.pack("<I", self.version)
|
||||
r += struct.pack("<Q", self.salt)
|
||||
return r
|
||||
|
||||
def __repr__(self):
|
||||
return "msg_sendtxrcncl(initiator=%i, responder=%i, version=%lu, salt=%lu)" %\
|
||||
(self.initiator, self.responder, self.version, self.salt)
|
||||
|
||||
@@ -62,6 +62,7 @@ from test_framework.messages import (
|
||||
msg_sendaddrv2,
|
||||
msg_sendcmpct,
|
||||
msg_sendheaders,
|
||||
msg_sendtxrcncl,
|
||||
msg_tx,
|
||||
MSG_TX,
|
||||
MSG_TYPE_MASK,
|
||||
@@ -126,6 +127,7 @@ MESSAGEMAP = {
|
||||
b"sendaddrv2": msg_sendaddrv2,
|
||||
b"sendcmpct": msg_sendcmpct,
|
||||
b"sendheaders": msg_sendheaders,
|
||||
b"sendtxrcncl": msg_sendtxrcncl,
|
||||
b"tx": msg_tx,
|
||||
b"verack": msg_verack,
|
||||
b"version": msg_version,
|
||||
@@ -421,6 +423,7 @@ class P2PInterface(P2PConnection):
|
||||
def on_sendaddrv2(self, message): pass
|
||||
def on_sendcmpct(self, message): pass
|
||||
def on_sendheaders(self, message): pass
|
||||
def on_sendtxrcncl(self, message): pass
|
||||
def on_tx(self, message): pass
|
||||
def on_wtxidrelay(self, message): pass
|
||||
|
||||
|
||||
Reference in New Issue
Block a user