diff options
author | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-01-29 01:07:18 +0100 |
---|---|---|
committer | Sebastian Falbesoner <sebastian.falbesoner@gmail.com> | 2021-01-29 01:07:18 +0100 |
commit | ba7e17e073f833eccd4c7c111ae9058c3f123371 (patch) | |
tree | fb8ddb2af94c57cc08c9a937f4f4a9bbf03a9ff0 /test/functional/rpc_blockchain.py | |
parent | 32b191fb66e644c690c94cbfdae6ddbc754769d7 (diff) | |
download | bitcoin-ba7e17e073f833eccd4c7c111ae9058c3f123371.tar.xz |
rpc, test: document {previous,next}blockhash as optional
Affects the following RPCs:
- getblockheader
- getblock
Also adds trivial tests on genesis block (should not contain
"previousblockhash") and best block (should not contain
"nextblockhash").
Diffstat (limited to 'test/functional/rpc_blockchain.py')
-rwxr-xr-x | test/functional/rpc_blockchain.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/functional/rpc_blockchain.py b/test/functional/rpc_blockchain.py index 99be6b7b8e..cbc1ce7037 100755 --- a/test/functional/rpc_blockchain.py +++ b/test/functional/rpc_blockchain.py @@ -304,6 +304,9 @@ class BlockchainTest(BitcoinTestFramework): header.calc_sha256() assert_equal(header.hash, besthash) + assert 'previousblockhash' not in node.getblockheader(node.getblockhash(0)) + assert 'nextblockhash' not in node.getblockheader(node.getbestblockhash()) + def _test_getdifficulty(self): difficulty = self.nodes[0].getdifficulty() # 1 hash in 2 should be valid, so difficulty should be 1/2**31 @@ -408,6 +411,9 @@ class BlockchainTest(BitcoinTestFramework): # Restore chain state move_block_file('rev_wrong', 'rev00000.dat') + assert 'previousblockhash' not in node.getblock(node.getblockhash(0)) + assert 'nextblockhash' not in node.getblock(node.getbestblockhash()) + if __name__ == '__main__': BlockchainTest().main() |