rest: Add test for prevout fields in getblock
This commit is contained in:
1 parent
4330af6f72
commit
459104b2aa
1 file changed
+9
@@ -311,6 +311,15 @@ class RESTTest (BitcoinTestFramework):
|
|||||||
if 'coinbase' not in tx['vin'][0]}
|
if 'coinbase' not in tx['vin'][0]}
|
||||||
assert_equal(non_coinbase_txs, set(txs))
|
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
|
# Check the same but without tx details
|
||||||
json_obj = self.test_rest_request(f"/block/notxdetails/{newblockhash[0]}")
|
json_obj = self.test_rest_request(f"/block/notxdetails/{newblockhash[0]}")
|
||||||
for tx in txs:
|
for tx in txs:
|
||||||
|
|||||||
Reference in new issue
Block a user