aboutsummaryrefslogtreecommitdiff
path: root/test/functional/blockchain.py
AgeCommit message (Collapse)Author
2017-10-26[rpc] Add initialblockdownload to getblockchaininfoJohn Newbery
2017-10-09Merge #10853: [tests] Fix RPC failure testing (again)MarcoFalke
47ba8cf71 scripted-diff: rename assert_raises_jsonrpc to assert_raises_rpc error (John Newbery) 677d893ff [tests] do not allow assert_raises_message to be called with JSONRPCException (John Newbery) 5864e9c16 [tests] remove direct testing on JSONRPCException from individual test cases (John Newbery) Pull request description: I did this a few months ago (here: #9707), but a few new examples have crept back in. When testing RPC failures, the test case should always assert the error value and message, to ensure that the failure was for the correct reason. Not doing that can hide bugs in the test code and mean that the test is not testing the correct behaviour. RPC failure testing should use the utility function `assert_raises_jsonrpc()` (renamed in the final commit of this PR to `assert_raises_rpc_error()`. This PR does the following: - changes all remaining instances of tests directly testing on `JSONRPCException` to calls to `assert_raises_jsonrpc()` - prevents `assert_raises_message()` from being called with `JSONRPCException` - scripted-diff changes `assert_raises_jsonrpc()` to `assert_raises_rpc_error()` Tree-SHA512: 2cc5e320704ec623a6e5a27d3c2c81cea86b502e29896f03bb5bf92cc36725132c1144410aecdf49e90d4577d512ee467d50d8184e9d5c5d0870bfc931316a5a
2017-10-09Merge #11367: [rpc] getblockchaininfo: add size_on_disk, prune_target_sizeWladimir J. van der Laan
b7dfc6c [rpc] getblockchaininfo: add size_on_disk, prune_target_size, automatic_pruning (Daniel Edgecumbe) Pull request description: Tree-SHA512: c255c27d6c922434d203ffdefda0dd3dddbd765b6a9cce5f80f5af5cb0b1c11c8aff6f4d00e96a326701d0bc81aace2f216fd1985675aa979f76c16f564a6cf6
2017-10-05scripted-diff: rename assert_raises_jsonrpc to assert_raises_rpc errorJohn Newbery
-BEGIN VERIFY SCRIPT- sed -i 's/assert_raises_jsonrpc/assert_raises_rpc_error/g' test/functional/*py test/functional/test_framework/*py -END VERIFY SCRIPT-
2017-10-02Merge #11021: [rpc] fix getchaintxstats()Wladimir J. van der Laan
07704c1 Add some tests for getchaintxstats (Akio Nakamura) 3336676 Fix getchaintxstats() (Akio Nakamura) Pull request description: 1. calculate nblocks more adaptive. -> set default nblocks to min (blocks for 1 month, target block's height - 1) -> before PR: if not specify nblocks-parameter, illegal parameter error will happen when target block height is below nblocks. 2. correct error message. -> nblocks accepts [1 .. block's height -1] . so add a word "-1". 3. add check 0-divide. -> if nTimeDiff = 0 then use UniValue(UniValue::VNULL) and returns {... "txrate": null} . -> before PR: if nTimeDiff = 0 then returns {... "txrate":} and bitcoin-cli cannot handle the response. Tree-SHA512: e1962ce7bb05a5bc7dec03eb04a8e7578f50fdb68927fcfc0a2232905ef4d679293eee148ebe0866682d209a8c458d21fbe71715e7311adb81f37089aae1ed93
2017-09-29[rpc] getblockchaininfo: add size_on_disk, prune_target_size, automatic_pruningDaniel Edgecumbe
Fix pruneheight help text. Move fPruneMode block to match output ordering with help text. Add functional tests for new fields in getblockchaininfo.
2017-09-27Add warnings field to getblockchaininfoAndrew Chow
2017-09-20[test] Add getblockchaininfo functional testJoão Barbosa
2017-09-06[qa] TestNode: Add wait_until_stopped helper methodMarcoFalke
2017-09-01[tests] don't override __init__() in individual testsJohn Newbery
Almost all test scripts currently need to override the __init__() method. When they do that they need to call into super().__init__() as the base class does some generic initialization. This commit makes the base class __init__() call into set_test_params() method. Individual test cases can override set_test_params() to setup their test parameters.
2017-09-01[tests] TestNode: separate add_node from start_nodeJohn Newbery
Separates the act of creating a TestNode object from starting the node. The test_framework now keeps track of its list of TestNodes, and test writers can call start_node() and stop_node() without having to update the self.nodes list.
2017-08-25Add some tests for getchaintxstatsAkio Nakamura
1. Add a test for no parameters. 2. Add a test for the block's height = 1. 3. Add a test for nblocks is out of range.
2017-08-15[tests] Introduce TestNodeJohn Newbery
TestNode is a class responsible for all state related to a bitcoind node under test. It stores local state, is responsible for tracking the bitcoind process and delegates unrecognised messages to the RPC connection. This commit changes start_nodes and stop_nodes to start and stop the bitcoind nodes in parallel, making test setup and teardown much faster.
2017-06-29[tests] Move stop_node and start_node methods to BitcoinTestFrameworkJohn Newbery
This commit moves functions start_node, start_nodes, stop_node and stop_nodes functions into the BitcoinTestFramework class. It also moves the bitcoind_processes dict and coverage variables into BitcoinTestFramework.
2017-06-23[qa] blockchain: Pass on closed connection during generate callMarcoFalke
2017-06-20qa: Add stopatheight testMarcoFalke
2017-06-06Merge #10426: Replace bytes_serialized with bogosizeWladimir J. van der Laan
8b22af3 Replace bytes_serialized with bogosize (Pieter Wuille) Tree-SHA512: e70a981bbb977329f9e324c45f9a1346ec9aacfbbad5474e608cdd1f852257502bb7db8003fd578260a609e45d1a9cf87ce96df9c4187d92d50f60a209e232ce
2017-06-05Replace bytes_serialized with bogosizePieter Wuille
2017-06-02[test] Add test for getchaintxstatsJimmy Song
2017-05-26Report on-disk size in gettxoutsetinfoPieter Wuille
2017-05-26Remove/ignore tx version in utxo and undoPieter Wuille
This makes the following changes: * In undo data and the chainstate database, the transaction nVersion field is removed from the data structures, always written as 0, and ignored when reading. * The definition of hash_serialized in gettxoutsetinfo is changed to no longer incude the nVersion field. It is renamed to hash_serialized_2 to avoid confusion. The new definition also includes transaction height and coinbase information, as this information was missing before. This depends on having a CHashVerifier-based undo data checksum verifier. Apart from changing the definition of serialized_hash, downgrading after using this patch is supported, as no release ever used the value of nVersion field in UTXO entries.
2017-05-25Add test for empty chain and reorg consistency for gettxoutsetinfo.Gregory Maxwell
2017-05-14Merge #10253: [test] Add test for getnetworkhashpsMarcoFalke
de487b7 Tests: Add test for getnetworkhashps (Jimmy Song) Tree-SHA512: b1418ad904618f639ffa34dd40906692aff1fdf1a0d13a9af00039e7a6a2b758091734b89c0c91e8d455da6b15a0e435a9a9ca97a41d97bf395b844c761ffa27
2017-05-02Remove unused Python importspracticalswift
2017-05-02[tests] Remove is_network_split from funtional test casesJohn Newbery
2017-04-21Tests: Add test for getnetworkhashpsJimmy Song
2017-04-19Tests: Add test for getdifficultyJimmy Song
Test added to blockchain.py as adding a new test to reduce test run time.
2017-03-20Rename rpc-tests directory to functionalJohn Newbery