aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/test_framework
diff options
context:
space:
mode:
authorAlex Morcos <morcos@chaincode.com>2016-03-04 16:11:49 -0500
committerAlex Morcos <morcos@chaincode.com>2016-03-21 10:46:25 -0400
commitb536a6fc83ee20cfb80da8bcb5f21c664ec7b5fe (patch)
tree167b1d80c87cddcefa1f452d99142360fcfeabf7 /qa/rpc-tests/test_framework
parent5fa66e4682a59047d2ed2934760ccc052fd85f50 (diff)
Add p2p test for feefilter
Diffstat (limited to 'qa/rpc-tests/test_framework')
-rwxr-xr-xqa/rpc-tests/test_framework/mininode.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/qa/rpc-tests/test_framework/mininode.py b/qa/rpc-tests/test_framework/mininode.py
index 5b6bb190e4..20386c642c 100755
--- a/qa/rpc-tests/test_framework/mininode.py
+++ b/qa/rpc-tests/test_framework/mininode.py
@@ -1023,6 +1023,23 @@ def wait_until(predicate, attempts=float('inf'), timeout=float('inf')):
return False
+class msg_feefilter(object):
+ command = "feefilter"
+
+ def __init__(self, feerate=0L):
+ self.feerate = feerate
+
+ def deserialize(self, f):
+ self.feerate = struct.unpack("<Q", f.read(8))[0]
+
+ def serialize(self):
+ r = ""
+ r += struct.pack("<Q", self.feerate)
+ return r
+
+ def __repr__(self):
+ return "msg_feefilter(feerate=%08x)" % self.feerate
+
# This is what a callback should look like for NodeConn
# Reimplement the on_* functions to provide handling for events
class NodeConnCB(object):
@@ -1098,6 +1115,7 @@ class NodeConnCB(object):
def on_close(self, conn): pass
def on_mempool(self, conn): pass
def on_pong(self, conn, message): pass
+ def on_feefilter(self, conn, message): pass
# More useful callbacks and functions for NodeConnCB's which have a single NodeConn
class SingleNodeConnCB(NodeConnCB):
@@ -1145,7 +1163,8 @@ class NodeConn(asyncore.dispatcher):
"headers": msg_headers,
"getheaders": msg_getheaders,
"reject": msg_reject,
- "mempool": msg_mempool
+ "mempool": msg_mempool,
+ "feefilter": msg_feefilter
}
MAGIC_BYTES = {
"mainnet": "\xf9\xbe\xb4\xd9", # mainnet