Skip to content

Commit

Permalink
Merge bitcoin#24797: test: compare /chaininfo response with `getblo…
Browse files Browse the repository at this point in the history
…ckchaininfo` RPC

0f7dc89 test: compare `/chaininfo` response with `getblockchaininfo` RPC (brunoerg)

Pull request description:

  The `/chaininfo` REST endpoint gets its infos from `getblockchaininfo` RPC, so this PR adds an `assert_equal` (in `interface_rest`) to ensure both responses are the same. Obs: other endpoints do the same for their respective RPC.

ACKs for top commit:
  0xB10C:
    Concept and Code Review ACK 0f7dc89. Belts-and-spenders.

Tree-SHA512: 51cbcf988090272e406a47dc869710740b74e2222af29c05ddcbf53bd49765cdc59efb525e970867f091b3d2efec4fb13371a342d9e484e51144b760265bc5b8
  • Loading branch information
MarcoFalke authored and vijaydasmp committed Jul 21, 2024
1 parent 6b5ae4a commit 883d9e0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/functional/interface_rest.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,5 +342,9 @@ def run_test(self):
json_obj = self.test_rest_request("/chaininfo")
assert_equal(json_obj['bestblockhash'], bb_hash)

# Compare with normal RPC getblockchaininfo response
blockchain_info = self.nodes[0].getblockchaininfo()
assert_equal(blockchain_info, json_obj)

if __name__ == '__main__':
RESTTest().main()

0 comments on commit 883d9e0

Please sign in to comment.