Skip to content

Commit 4523d28

Browse files
committed
[test] compare filter and header with the result of the getblockfilter RPC
1 parent 3a2464f commit 4523d28

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/functional/interface_rest.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,14 @@ def run_test(self):
273273
json_obj = self.test_rest_request(f"/headers/5/{bb_hash}")
274274
assert_equal(len(json_obj), 5) # now we should have 5 header objects
275275
json_obj = self.test_rest_request(f"/blockfilterheaders/basic/5/{bb_hash}")
276+
first_filter_header = json_obj[0]
276277
assert_equal(len(json_obj), 5) # now we should have 5 filter header objects
277-
self.test_rest_request(f"/blockfilter/basic/{bb_hash}", req_type=ReqType.BIN, ret_type=RetType.OBJ)
278+
json_obj = self.test_rest_request(f"/blockfilter/basic/{bb_hash}")
279+
280+
# Compare with normal RPC blockfilter response
281+
rpc_blockfilter = self.nodes[0].getblockfilter(bb_hash)
282+
assert_equal(first_filter_header, rpc_blockfilter['header'])
283+
assert_equal(json_obj['filter'], rpc_blockfilter['filter'])
278284

279285
# Test number parsing
280286
for num in ['5a', '-5', '0', '2001', '99999999999999999999999999999999999']:

0 commit comments

Comments
 (0)