aboutsummaryrefslogtreecommitdiff
path: root/qa/rpc-tests/util.py
Commit message (Collapse)AuthorAgeFilesLines
* [QA] restructure rpc tests directoryJonas Schnelli2015-05-181-357/+0
| | | | * move non-test classes to subdir `test-framework`
* Merge pull request #5159Wladimir J. van der Laan2015-05-131-4/+4
|\ | | | | | | b649e03 Create new BlockPolicyEstimator for fee estimates (Alex Morcos)
| * Create new BlockPolicyEstimator for fee estimatesAlex Morcos2015-05-131-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This class groups transactions that have been confirmed in blocks into buckets, based on either their fee or their priority. Then for each bucket, the class calculates what percentage of the transactions were confirmed within various numbers of blocks. It does this by keeping an exponentially decaying moving history for each bucket and confirm block count of the percentage of transactions in that bucket that were confirmed within that number of blocks. -Eliminate txs which didn't have all inputs available at entry from fee/pri calcs -Add dynamic breakpoints and tracking of confirmation delays in mempool transactions -Remove old CMinerPolicyEstimator and CBlockAverage code -New smartfees.py -Pass a flag to the estimation code, using IsInitialBlockDownload as a proxy for when we are still catching up and we shouldn't be counting how many blocks it takes for transactions to be included. -Add a policyestimator unit test
* | Merge pull request #6085Wladimir J. van der Laan2015-05-041-1/+1
|\ \ | | | | | | | | | | | | b05a89b Non-grammatical language improvements (Luke Dashjr) 7e6d23b Bugfix: Grammar fixes (Corinne Dashjr)
| * | Bugfix: Grammar fixesCorinne Dashjr2015-05-011-1/+1
| | |
* | | Add some travis debugging for python scriptsSuhas Daftuar2015-04-281-0/+8
| | | | | | | | | | | | | | | Adds printing to the console before/after calls to bitcoin-cli -rpcwait, if the PYTHON_DEBUG environment variable is initialized.
* | | Python p2p testing frameworkSuhas Daftuar2015-04-281-4/+7
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | mininode.py provides a framework for connecting to a bitcoin node over the p2p network. NodeConn is the main object that manages connectivity to a node and provides callbacks; the interface for those callbacks is defined by NodeConnCB. Defined also are all data structures from bitcoin core that pass on the network (CBlock, CTransaction, etc), along with de-/serialization functions. maxblocksinflight.py is an example test using this framework that tests whether a node is limiting the maximum number of in-flight block requests. This also adds support to util.py for specifying the binary to use when starting nodes (for tests that compare the behavior of different bitcoind versions), and adds maxblocksinflight.py to the pull tester.
* / Add block pruning functionalitymrbandrews2015-04-221-2/+5
|/ | | | | | | | | | | | | | | | | | | | | | This adds a -prune=N option to bitcoind, which if set to N>0 will enable block file pruning. When pruning is enabled, block and undo files will be deleted to try to keep total space used by those files to below the prune target (N, in MB) specified by the user, subject to some constraints: - The last 288 blocks on the main chain are always kept (MIN_BLOCKS_TO_KEEP), - N must be at least 550MB (chosen as a value for the target that could reasonably be met, with some assumptions about block sizes, orphan rates, etc; see comment in main.h), - No blocks are pruned until chainActive is at least 100,000 blocks long (on mainnet; defined separately for mainnet, testnet, and regtest in chainparams as nPruneAfterHeight). This unsets NODE_NETWORK if pruning is enabled. Also included is an RPC test for pruning (pruning.py). Thanks to @rdponticelli for earlier work on this feature; this is based in part off that work.
* Introduce separate 'generate' RPC callPieter Wuille2015-04-011-1/+1
|
* Coinbases-in-mempool regression testGavin Andresen2014-12-021-1/+11
| | | | | | | Immature coinbase spends are allowed in the memory pool if they can be mined in the next block. They are not allowed in the memory pool if they cannot be mined in the next block. This regression test tests those edge cases.
* [REST] add REST interface tests in rpc-test sectionJonas Schnelli2014-12-011-1/+5
|
* Port of wallet.sh to python (wallet.py).mrbandrews2014-11-201-3/+13
| | | | Also included are minor edits to util.py to create a clean blockchain and add a parameter to gather_inputs to specify number of confirmations.
* RPC tests: create initial chain with specific timestampsGavin Andresen2014-11-171-8/+17
| | | | | Use setmocktime to create the initial block chain with 10-minute-apart-blocks starting 1 Jan 2014.
* don't override dir() in qa rpc testsBryan Bishop2014-11-141-8/+8
| | | | | Replace "dir" with "dirname" in util.py in qa/rpc-tests/ because "dir" is the name of a function in python.
* gather_inputs: use correct variable in error messagedexX72014-11-071-1/+1
| | | | "amount" and "fee" do not exist (anymore?).
* tests: allow rpc-tests to get filenames for bitcoind and bitcoin-cli from ↵Cory Fields2014-10-311-4/+4
| | | | | | the environment This will allow for windows tests to run with bitcoind.exe and bitcoin-cli.exe
* Merge pull request #5139Gavin Andresen2014-10-271-4/+7
|\ | | | | | | | | | | 9f87325 Start with tidier cache directories (Gavin Andresen) Signed-off-by: Gavin Andresen <[email protected]>
| * Start with tidier cache directoriesGavin Andresen2014-10-241-4/+7
| | | | | | | | Remove more files from the cached, 200-block-chain data directories.
* | Merge pull request #5121Wladimir J. van der Laan2014-10-271-1/+1
|\ \ | |/ |/| | | 214091d Update license in pull-tester and rpc-tests (Michael Ford)
| * Update license in pull-tester and rpc-testsMichael Ford2014-10-231-1/+1
| | | | | | | | Add missing copyright/license header where necessary
* | Work around #5113.Daniel Kraft2014-10-241-0/+4
|/
* Fix make_change to not create half-satoshisGavin Andresen2014-09-051-4/+6
|
* Merge pull request #4522 from dgenr8/set_discover_0Gavin Andresen2014-07-151-2/+2
|\ | | | | Set -discover=0 in regtest framework
| * Set -discover=0 in regtest frameworkTom Harding2014-07-131-2/+2
| | | | | | | | | | | | The regtest framework is local, so often there is no need to discover our external IP. Setting -discover=0 in util.py works around shutdown hang caused by GetExternalIP waiting in recv().
* | Add test for getblocktemplate longpollingWladimir J. van der Laan2014-07-111-1/+3
|/
* Print better errors, and add util stop_node() function.Gavin Andresen2014-07-091-5/+10
|
* qa/rpc_tests: Wait for handshake to complete in connect_nodesWladimir J. van der Laan2014-06-231-0/+4
| | | | | | | This avoids a race condition in which the connection was made but the version handshake is not completed yet. In that case transactions won't be broadcasted to a peer yet, and the nodes will wait forever for their mempools to sync.
* estimatefee / estimatepriority RPC methodsGavin Andresen2014-06-061-18/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New RPC methods: return an estimate of the fee (or priority) a transaction needs to be likely to confirm in a given number of blocks. Mike Hearn created the first version of this method for estimating fees. It works as follows: For transactions that took 1 to N (I picked N=25) blocks to confirm, keep N buckets with at most 100 entries in each recording the fees-per-kilobyte paid by those transactions. (separate buckets are kept for transactions that confirmed because they are high-priority) The buckets are filled as blocks are found, and are saved/restored in a new fee_estiamtes.dat file in the data directory. A few variations on Mike's initial scheme: To estimate the fee needed for a transaction to confirm in X buckets, all of the samples in all of the buckets are used and a median of all of the data is used to make the estimate. For example, imagine 25 buckets each containing the full 100 entries. Those 2,500 samples are sorted, and the estimate of the fee needed to confirm in the very next block is the 50'th-highest-fee-entry in that sorted list; the estimate of the fee needed to confirm in the next two blocks is the 150'th-highest-fee-entry, etc. That algorithm has the nice property that estimates of how much fee you need to pay to get confirmed in block N will always be greater than or equal to the estimate for block N+1. It would clearly be wrong to say "pay 11 uBTC and you'll get confirmed in 3 blocks, but pay 12 uBTC and it will take LONGER". A single block will not contribute more than 10 entries to any one bucket, so a single miner and a large block cannot overwhelm the estimates.
* Allow multiple regression tests to run at onceGavin Andresen2014-06-061-15/+22
| | | | | Choose ports at startup based on PID, so multiple regression tests can run on the same system at the same time.
* Add Python test for -rpcbind and -rpcallowipWladimir J. van der Laan2014-05-131-4/+28
| | | | | Add a new test, `rpcbind_test.py`, that extensively tests the new `-rpcbind` functionality.
* Have pull-tester run the listtransactions.py regression testGavin Andresen2014-04-021-5/+8
| | | | | This should show how to run a python-based regression test successfully in the pull-tester environment.
* Fix regression testsGavin Andresen2014-03-241-11/+21
| | | | | | | Taught bitcoind to close the HTTP connection after it gets a 'stop' command, to make it easier for the regression tests to cleanly stop. Move bitcoinrpc files to correct location. Tidied up the python-based regression tests.
* Add licenses for tests and test dataWladimir J. van der Laan2014-03-181-0/+3
| | | | | | | | - Add license headers to source files (years based on commit dates) in `src/test` as well as `qa` - Add `README.md` to `src/test/data` specifying MIT license Fixes #3848
* Python-based regression testsGavin Andresen2014-02-281-0/+136
skeleton.py : a do-nothing test skeleton listtransactions.py : start of regression test for listtransactions call