aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorFabian Jahr <fjahr@protonmail.com>2021-03-04 01:37:50 +0100
committerFabian Jahr <fjahr@protonmail.com>2021-04-19 21:11:37 +0200
commit5f96d7d22d8e05876c6fc014e70488699950fe38 (patch)
tree5fcdaa66b621d076b23c8224c822fad040cc188f /test
parent23fe50436be641d7417152adc683192649ba206a (diff)
downloadbitcoin-5f96d7d22d8e05876c6fc014e70488699950fe38.tar.xz
rpc: gettxoutsetinfo rejects hash_serialized_2 for specific height
Diffstat (limited to 'test')
-rwxr-xr-xtest/functional/feature_coinstatsindex.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/functional/feature_coinstatsindex.py b/test/functional/feature_coinstatsindex.py
index cef60c5731..d3adde5cc5 100755
--- a/test/functional/feature_coinstatsindex.py
+++ b/test/functional/feature_coinstatsindex.py
@@ -52,6 +52,7 @@ class CoinStatsIndexTest(BitcoinTestFramework):
self._test_coin_stats_index()
self._test_use_index_option()
self._test_reorg_index()
+ self._test_index_rejects_hash_serialized()
def block_sanity_check(self, block_info):
block_subsidy = 50
@@ -298,6 +299,15 @@ class CoinStatsIndexTest(BitcoinTestFramework):
self.wait_until(lambda: not try_rpc(-32603, "Unable to read UTXO set", node.gettxoutsetinfo, 'muhash'))
assert_raises_rpc_error(-32603, "Unable to read UTXO set", node.gettxoutsetinfo, 'muhash', reorg_block)
+ def _test_index_rejects_hash_serialized(self):
+ self.log.info("Test that the rpc raises if the legacy hash is passed with the index")
+
+ msg = "hash_serialized_2 hash type cannot be queried for a specific block"
+ assert_raises_rpc_error(-8, msg, self.nodes[1].gettxoutsetinfo, hash_type='hash_serialized_2', hash_or_height=111)
+
+ for use_index in {True, False, None}:
+ assert_raises_rpc_error(-8, msg, self.nodes[1].gettxoutsetinfo, hash_type='hash_serialized_2', hash_or_height=111, use_index=use_index)
+
if __name__ == '__main__':
CoinStatsIndexTest().main()