aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorfyquah <fyquah@protonmail.com>2021-02-27 18:18:41 +0000
committerKiminuo <kiminuo@protonmail.com>2021-10-05 10:42:34 +0200
commit459104b2aae6eeaadfa5a7e47944f1a34780dacd (patch)
treeeecc561197b974267a009f52c382f16d7d7414fc /test
parent4330af6f72172848f5971a052a8f325ed50eb576 (diff)
downloadbitcoin-459104b2aae6eeaadfa5a7e47944f1a34780dacd.tar.xz
rest: Add test for prevout fields in getblock
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/interface_rest.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/functional/interface_rest.py b/test/functional/interface_rest.py
index e0716fc54a..531c42ba2c 100755
--- a/test/functional/interface_rest.py
+++ b/test/functional/interface_rest.py
@@ -311,6 +311,15 @@ class RESTTest (BitcoinTestFramework):
if 'coinbase' not in tx['vin'][0]}
assert_equal(non_coinbase_txs, set(txs))
+ # Verify that the non-coinbase tx has "prevout" key set
+ for tx_obj in json_obj["tx"]:
+ for vin in tx_obj["vin"]:
+ if "coinbase" not in vin:
+ assert "prevout" in vin
+ assert_equal(vin["prevout"]["generated"], False)
+ else:
+ assert "prevout" not in vin
+
# Check the same but without tx details
json_obj = self.test_rest_request(f"/block/notxdetails/{newblockhash[0]}")
for tx in txs: