Changeset View
Changeset View
Standalone View
Standalone View
test/functional/rpc_blockchain.py
Show First 20 Lines • Show All 227 Lines • ▼ Show 20 Lines | def _test_getblockheader(self): | ||||
secondbesthash = node.getblockhash(199) | secondbesthash = node.getblockhash(199) | ||||
header = node.getblockheader(besthash) | header = node.getblockheader(besthash) | ||||
assert_equal(header['hash'], besthash) | assert_equal(header['hash'], besthash) | ||||
assert_equal(header['height'], 200) | assert_equal(header['height'], 200) | ||||
assert_equal(header['confirmations'], 1) | assert_equal(header['confirmations'], 1) | ||||
assert_equal(header['previousblockhash'], secondbesthash) | assert_equal(header['previousblockhash'], secondbesthash) | ||||
assert_is_hex_string(header['chainwork']) | assert_is_hex_string(header['chainwork']) | ||||
assert_equal(header['nTx'], 1) | |||||
assert_is_hash_string(header['hash']) | assert_is_hash_string(header['hash']) | ||||
assert_is_hash_string(header['previousblockhash']) | assert_is_hash_string(header['previousblockhash']) | ||||
assert_is_hash_string(header['merkleroot']) | assert_is_hash_string(header['merkleroot']) | ||||
assert_is_hash_string(header['bits'], length=None) | assert_is_hash_string(header['bits'], length=None) | ||||
assert isinstance(header['time'], int) | assert isinstance(header['time'], int) | ||||
assert isinstance(header['mediantime'], int) | assert isinstance(header['mediantime'], int) | ||||
assert isinstance(header['nonce'], int) | assert isinstance(header['nonce'], int) | ||||
assert isinstance(header['version'], int) | assert isinstance(header['version'], int) | ||||
▲ Show 20 Lines • Show All 107 Lines • Show Last 20 Lines |