aboutsummaryrefslogtreecommitdiff
path: root/test/functional/interface_rest.py
diff options
context:
space:
mode:
authorNiklas Gögge <n.goeggi@gmail.com>2021-12-21 23:20:17 +0100
committerNiklas Gögge <n.goeggi@gmail.com>2021-12-22 20:49:47 +0100
commit4523d28b6bd550bf9f9c724f9aa90c3d2d4ebe3b (patch)
tree25ca942582ee3c8528cd0f0627a501f769941f5c /test/functional/interface_rest.py
parent3a2464f21619c3065ec2f5d8f7431703c30c964a (diff)
downloadbitcoin-4523d28b6bd550bf9f9c724f9aa90c3d2d4ebe3b.tar.xz
[test] compare filter and header with the result of the getblockfilter RPC
Diffstat (limited to 'test/functional/interface_rest.py')
-rwxr-xr-xtest/functional/interface_rest.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/test/functional/interface_rest.py b/test/functional/interface_rest.py
index 8f6743d97c..2842b2534d 100755
--- a/test/functional/interface_rest.py
+++ b/test/functional/interface_rest.py
@@ -273,8 +273,14 @@ class RESTTest (BitcoinTestFramework):
json_obj = self.test_rest_request(f"/headers/5/{bb_hash}")
assert_equal(len(json_obj), 5) # now we should have 5 header objects
json_obj = self.test_rest_request(f"/blockfilterheaders/basic/5/{bb_hash}")
+ first_filter_header = json_obj[0]
assert_equal(len(json_obj), 5) # now we should have 5 filter header objects
- self.test_rest_request(f"/blockfilter/basic/{bb_hash}", req_type=ReqType.BIN, ret_type=RetType.OBJ)
+ json_obj = self.test_rest_request(f"/blockfilter/basic/{bb_hash}")
+
+ # Compare with normal RPC blockfilter response
+ rpc_blockfilter = self.nodes[0].getblockfilter(bb_hash)
+ assert_equal(first_filter_header, rpc_blockfilter['header'])
+ assert_equal(json_obj['filter'], rpc_blockfilter['filter'])
# Test number parsing
for num in ['5a', '-5', '0', '2001', '99999999999999999999999999999999999']: