Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_blockchain.py
Show First 20 Lines • Show All 257 Lines • ▼ Show 20 Lines | def _test_gettxoutsetinfo(self): | ||||
assert_equal(res2['bestblock'], node.getblockhash(0)) | assert_equal(res2['bestblock'], node.getblockhash(0)) | ||||
assert_equal(len(res2['hash_serialized']), 64) | assert_equal(len(res2['hash_serialized']), 64) | ||||
self.log.info( | self.log.info( | ||||
"Test that gettxoutsetinfo() returns the same result after invalidate/reconsider block") | "Test that gettxoutsetinfo() returns the same result after invalidate/reconsider block") | ||||
node.reconsiderblock(b1hash) | node.reconsiderblock(b1hash) | ||||
res3 = node.gettxoutsetinfo() | res3 = node.gettxoutsetinfo() | ||||
assert_equal(res['total_amount'], res3['total_amount']) | # The field 'disk_size' is non-deterministic and can thus not be | ||||
assert_equal(res['transactions'], res3['transactions']) | # compared between res and res3. Everything else should be the same. | ||||
assert_equal(res['height'], res3['height']) | del res['disk_size'], res3['disk_size'] | ||||
assert_equal(res['txouts'], res3['txouts']) | assert_equal(res, res3) | ||||
assert_equal(res['bogosize'], res3['bogosize']) | |||||
assert_equal(res['bestblock'], res3['bestblock']) | |||||
assert_equal(res['hash_serialized'], res3['hash_serialized']) | |||||
def _test_getblockheader(self): | def _test_getblockheader(self): | ||||
node = self.nodes[0] | node = self.nodes[0] | ||||
assert_raises_rpc_error(-8, | assert_raises_rpc_error(-8, | ||||
"hash must be of length 64 (not 8, for 'nonsense')", | "hash must be of length 64 (not 8, for 'nonsense')", | ||||
node.getblockheader, | node.getblockheader, | ||||
"nonsense") | "nonsense") | ||||
▲ Show 20 Lines • Show All 137 Lines • Show Last 20 Lines |