Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_blockchain.py
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | def _test_getchaintxstats(self): | ||||
assert_equal(chaintxstats['txcount'], 2) | assert_equal(chaintxstats['txcount'], 2) | ||||
assert_equal(chaintxstats['window_block_count'], 0) | assert_equal(chaintxstats['window_block_count'], 0) | ||||
assert('window_tx_count' not in chaintxstats) | assert('window_tx_count' not in chaintxstats) | ||||
assert('window_interval' not in chaintxstats) | assert('window_interval' not in chaintxstats) | ||||
assert('txrate' not in chaintxstats) | assert('txrate' not in chaintxstats) | ||||
assert_raises_rpc_error( | assert_raises_rpc_error( | ||||
-8, "Invalid block count: should be between 0 and the block's height - 1", | -8, "Invalid block count: should be between 0 and the block's height - 1", | ||||
self.nodes[0].getchaintxstats, 201) | self.nodes[0].getchaintxstats, 201) | ||||
def _test_gettxoutsetinfo(self): | def _test_gettxoutsetinfo(self): | ||||
node = self.nodes[0] | node = self.nodes[0] | ||||
res = node.gettxoutsetinfo() | res = node.gettxoutsetinfo() | ||||
assert_equal(res['total_amount'], Decimal('8725.00000000')) | assert_equal(res['total_amount'], Decimal('8725.00000000')) | ||||
assert_equal(res['transactions'], 200) | assert_equal(res['transactions'], 200) | ||||
assert_equal(res['height'], 200) | assert_equal(res['height'], 200) | ||||
▲ Show 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | def _test_getblock(self): | ||||
getblockinfo['difficulty'], getblockheaderinfo['difficulty']) | getblockinfo['difficulty'], getblockheaderinfo['difficulty']) | ||||
assert_equal( | assert_equal( | ||||
getblockinfo['chainwork'], getblockheaderinfo['chainwork']) | getblockinfo['chainwork'], getblockheaderinfo['chainwork']) | ||||
assert_equal( | assert_equal( | ||||
getblockinfo['previousblockhash'], getblockheaderinfo['previousblockhash']) | getblockinfo['previousblockhash'], getblockheaderinfo['previousblockhash']) | ||||
assert_equal( | assert_equal( | ||||
getblockinfo['nextblockhash'], getblockheaderinfo['nextblockhash']) | getblockinfo['nextblockhash'], getblockheaderinfo['nextblockhash']) | ||||
if __name__ == '__main__': | if __name__ == '__main__': | ||||
BlockchainTest().main() | BlockchainTest().main() |