Skip to content

Commit

Permalink
[qa] fix binary response parsing in rest test
Browse files Browse the repository at this point in the history
Removing rstrip() from response parsing because it removes 0x20,
which can be a legitimate first byte of a block hash
  • Loading branch information
patricklodder committed Feb 20, 2022
1 parent d483dfb commit cdc98a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qa/rpc-tests/rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ def run_test(self):
resp_bin = http_get_call(url.hostname, url.port, '/rest/blockhashbyheight/' + str(block_json_obj['height']) + self.FORMAT_SEPARATOR + 'bin', True)
assert_equal(resp_bin.status, 200)
assert_equal(int(resp_bin.getheader('content-length')), 32)
response_str = resp_bin.read().rstrip()
response_str = resp_bin.read()
blockhash = response_str[::-1].hex()
assert_equal(blockhash, block_json_obj['hash'])

Expand Down

0 comments on commit cdc98a3

Please sign in to comment.