0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-03 09:56:38 -05:00

Merge bitcoin/bitcoin#24936: test: compare /mempool/contents response with getrawmempool RPC

bef61496ab test: compare `/mempool/contents` response with `getrawmempool` RPC (brunoerg)
5bc5cbaf31 doc: add reference to `getrawmempool` RPC in `/mempool/contents` REST doc (brunoerg)

Pull request description:

  This PR is similar to #24797, it compares `/mempool/contents` REST response with `getrawmempool` RPC (verbose=True) since they use the same `MempoolToJSON` function.

  Also, adds a reference to `getrawmempool` RPC help to get details about the fields from `/mempool/contents`.

ACKs for top commit:
  0xB10C:
    ACK bef6149

Tree-SHA512: b7e9e9c765ee837986ba167b9234a9b95c9ef0a9ebcc2a03d50f6be6d3aba1480bd77c78111d95df1e4023cde6dfc64bf1e7908d9e5b6f96ca46b76611a4a9b4
This commit is contained in:
MarcoFalke 2022-04-21 19:00:57 +02:00
commit 7a4ac713aa
No known key found for this signature in database
GPG key ID: CE2B75697E69A548
2 changed files with 5 additions and 0 deletions

View file

@ -125,6 +125,7 @@ Refer to the `getmempoolinfo` RPC help for details.
Returns the transactions in the mempool. Returns the transactions in the mempool.
Only supports JSON as output format. Only supports JSON as output format.
Refer to the `getrawmempool` RPC help for details.
Risks Risks
------------- -------------

View file

@ -326,6 +326,10 @@ class RESTTest (BitcoinTestFramework):
# Check that there are our submitted transactions in the TX memory pool # Check that there are our submitted transactions in the TX memory pool
json_obj = self.test_rest_request("/mempool/contents") json_obj = self.test_rest_request("/mempool/contents")
raw_mempool_verbose = self.nodes[0].getrawmempool(verbose=True)
assert_equal(json_obj, raw_mempool_verbose)
for i, tx in enumerate(txs): for i, tx in enumerate(txs):
assert tx in json_obj assert tx in json_obj
assert_equal(json_obj[tx]['spentby'], txs[i + 1:i + 2]) assert_equal(json_obj[tx]['spentby'], txs[i + 1:i + 2])