Skip to content

Commit 459104b

Browse files
fyquahkiminuo
authored andcommitted
rest: Add test for prevout fields in getblock
1 parent 4330af6 commit 459104b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/functional/interface_rest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -311,6 +311,15 @@ def run_test(self):
311311
if 'coinbase' not in tx['vin'][0]}
312312
assert_equal(non_coinbase_txs, set(txs))
313313

314+
# Verify that the non-coinbase tx has "prevout" key set
315+
for tx_obj in json_obj["tx"]:
316+
for vin in tx_obj["vin"]:
317+
if "coinbase" not in vin:
318+
assert "prevout" in vin
319+
assert_equal(vin["prevout"]["generated"], False)
320+
else:
321+
assert "prevout" not in vin
322+
314323
# Check the same but without tx details
315324
json_obj = self.test_rest_request(f"/block/notxdetails/{newblockhash[0]}")
316325
for tx in txs:

0 commit comments

Comments
 (0)