From 5bc5cbaf310f60e89c72e8ecf3f6187c85499027 Mon Sep 17 00:00:00 2001 From: brunoerg Date: Wed, 20 Apr 2022 18:12:39 -0300 Subject: [PATCH 1/2] doc: add reference to `getrawmempool` RPC in `/mempool/contents` REST doc --- doc/REST-interface.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/REST-interface.md b/doc/REST-interface.md index f11624fd28..4b46f29153 100644 --- a/doc/REST-interface.md +++ b/doc/REST-interface.md @@ -125,6 +125,7 @@ Refer to the `getmempoolinfo` RPC help for details. Returns the transactions in the mempool. Only supports JSON as output format. +Refer to the `getrawmempool` RPC help for details. Risks ------------- From bef61496ab5e12e38ac5794cd0836723af070ab5 Mon Sep 17 00:00:00 2001 From: brunoerg Date: Thu, 21 Apr 2022 08:31:01 -0300 Subject: [PATCH 2/2] test: compare `/mempool/contents` response with `getrawmempool` RPC --- test/functional/interface_rest.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/functional/interface_rest.py b/test/functional/interface_rest.py index 30c9e0c9cd..95dc40cb52 100755 --- a/test/functional/interface_rest.py +++ b/test/functional/interface_rest.py @@ -326,6 +326,10 @@ class RESTTest (BitcoinTestFramework): # Check that there are our submitted transactions in the TX memory pool 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): assert tx in json_obj assert_equal(json_obj[tx]['spentby'], txs[i + 1:i + 2])