Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_getblockstats.py
Show First 20 Lines • Show All 195 Lines • ▼ Show 20 Lines | def run_test(self): | ||||
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=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 | |||||
assert_raises_rpc_error(-1, | |||||
'getblockstats hash_or_height ( stats )', | |||||
self.nodes[0].getblockstats, | |||||
'00', | |||||
1, | |||||
2) | |||||
assert_raises_rpc_error(-1, | |||||
'getblockstats hash_or_height ( stats )', | |||||
self.nodes[0].getblockstats) | |||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
GetblockstatsTest().main() | GetblockstatsTest().main() |