Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_getblockstats.py
Show First 20 Lines • Show All 189 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
assert_raises_rpc_error(-8, 'Invalid selected statistic {}'.format( | assert_raises_rpc_error(-8, 'Invalid selected statistic {}'.format( | ||||
inv_sel_stat), self.nodes[0].getblockstats, hash_or_height=1, stats=inv_stat) | inv_sel_stat), self.nodes[0].getblockstats, hash_or_height=1, stats=inv_stat) | ||||
# Make sure we aren't always returning inv_sel_stat as the culprit stat | # Make sure we aren't always returning inv_sel_stat as the culprit stat | ||||
assert_raises_rpc_error(-8, 'Invalid selected statistic aaa{}'.format(inv_sel_stat), | assert_raises_rpc_error(-8, 'Invalid selected statistic aaa{}'.format(inv_sel_stat), | ||||
self.nodes[0].getblockstats, hash_or_height=1, stats=['minfee', 'aaa{}'.format(inv_sel_stat)]) | self.nodes[0].getblockstats, hash_or_height=1, stats=['minfee', 'aaa{}'.format(inv_sel_stat)]) | ||||
assert_raises_rpc_error(-8, 'One or more of the selected stats requires -txindex enabled', | assert_raises_rpc_error(-8, 'One or more of the selected stats requires -txindex enabled', | ||||
self.nodes[1].getblockstats, hash_or_height=1) | |||||
assert_raises_rpc_error(-8, 'One or more of the selected stats requires -txindex enabled', | |||||
self.nodes[1].getblockstats, hash_or_height=self.start_height + self.max_stat_pos) | self.nodes[1].getblockstats, hash_or_height=self.start_height + self.max_stat_pos) | ||||
# Mainchain's genesis block shouldn't be found on regtest | # Mainchain's genesis block shouldn't be found on regtest | ||||
assert_raises_rpc_error(-5, 'Block not found', self.nodes[0].getblockstats, | assert_raises_rpc_error(-5, 'Block not found', self.nodes[0].getblockstats, | ||||
hash_or_height='000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f') | hash_or_height='000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f') | ||||
# Invalid number of args | # Invalid number of args | ||||
assert_raises_rpc_error(-1, | assert_raises_rpc_error(-1, | ||||
Show All 12 Lines |