aboutsummaryrefslogtreecommitdiff
path: root/src/test
Commit message (Collapse)AuthorAgeFilesLines
...
* | | univalue: add type check unit testsJonas Schnelli2015-06-041-0/+42
| | |
* | | util: Add ParseInt64 and ParseDouble functionsWladimir J. van der Laan2015-06-041-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Strict parsing functions for other numeric types. - ParseInt64 analogous to ParseInt32, but for 64-bit values. - ParseDouble for doubles. - Make all three Parse* functions more strict (e.g. reject whitespace on the inside) Also add tests.
* | | Simplify RPCclient, adapt json_parse_error testWladimir J. van der Laan2015-06-041-13/+10
| | | | | | | | | | | | | | | # Conflicts: # src/test/rpc_tests.cpp
* | | fix univalue json parse testsJonas Schnelli2015-06-041-9/+12
| | |
* | | Remove JSON Spirit wrapper, remove JSON Spirit leftoversJonas Schnelli2015-06-046-44/+29
| | | | | | | | | | | | | | | | | | - implement find_value() function for UniValue - replace all Array/Value/Object types with UniValues, remove JSON Spirit to UniValue wrapper - remove JSON Spirit sources
* | | remove JSON Spirit UniValue wrapperJonas Schnelli2015-06-046-35/+35
| | |
* | | fix rpc unit test, plain numbers are not JSON compatible objectJonas Schnelli2015-06-041-2/+2
| | | | | | | | | | | | UniValues read() does only read valid json.
* | | univalue: add support for real, fix percision and make it json_spirit compatibleJonas Schnelli2015-06-041-5/+5
| | | | | | | | | | | | - avoid breaking the API because of different number/percision handling
* | | expicit set UniValue type to avoid empty valuesJonas Schnelli2015-06-042-3/+3
| | |
* | | extend conversion to UniValueJonas Schnelli2015-06-042-6/+9
| | |
* | | Convert tree to using univalue. Eliminate all json_spirit uses.Jeff Garzik2015-06-045-61/+63
| | |
* | | UniValue: prefer .size() to .count(), to harmonize w/ existing treeJeff Garzik2015-06-041-8/+8
| | |
* | | Merge pull request #5875Wladimir J. van der Laan2015-06-031-1/+1
|\ \ \ | | | | | | | | | | | | | | | | aa8c827 P2P regression test for new AcceptBlock behavior (Suhas Daftuar) 9be0e68 Be stricter in processing unrequested blocks (Suhas Daftuar)
| * | | Be stricter in processing unrequested blocksSuhas Daftuar2015-06-021-1/+1
| |/ / | | | | | | | | | | | | AcceptBlock will no longer process an unrequested block, unless it has not been previously processed and has more work than chainActive.Tip()
* / / json: fail read_string if string contains trailing garbageWladimir J. van der Laan2015-06-031-0/+18
|/ / | | | | | | | | | | | | | | | | | | Change `read_string` to fail when not the entire input has been consumed. This avoids unexpected, even dangerous behavior (fixes #6223). The new JSON parser adapted in #6121 also solves this problem so in master this is a temporary fix, but should be backported to older releases. Also adds tests for the new behavior.
* | Merge pull request #6183Wladimir J. van der Laan2015-06-011-4/+6
|\ \ | | | | | | | | | 28bf062 Fix off-by-one error w/ nLockTime in the wallet (Peter Todd)
| * | Fix off-by-one error w/ nLockTime in the walletPeter Todd2015-05-271-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously due to an off-by-one error the wallet ignored nLockTime-by-height transactions that would be valid in the next block even though they are accepted into the mempool. The transactions wouldn't show up until confirmed, nor would they be included in the unconfirmed balance. Similar to the mempool behavior fix in 665bdd3b, the wallet code was calling IsFinalTx() directly without taking into account the fact that doing so tells you if the transaction could have been mined in the *current* block, rather than the next block. To fix this we strip IsFinalTx() of non-consensus-critical functionality, removing the default arguments, and add CheckFinalTx() to check if a transaction will be final in the next block.
* | | Merge pull request #5669Wladimir J. van der Laan2015-05-274-11/+9
|\ \ \ | | | | | | | | | | | | | | | | da29ecb Consensus: MOVEONLY: Move CValidationState from main consensus/validation (jtimon) 27afcd8 Consensus: Refactor: Decouple CValidationState from main::AbortNode() (Cory Fields)
| * | | Consensus: MOVEONLY: Move CValidationState from main consensus/validationjtimon2015-05-154-11/+9
| | | |
* | | | Merge pull request #6186Wladimir J. van der Laan2015-05-271-0/+5
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | b45c50c Fix two problems in CSubNet parsing (Wladimir J. van der Laan) 19e8d7b Simplify code for CSubnet (Wladimir J. van der Laan)
| * | | | Fix two problems in CSubNet parsingWladimir J. van der Laan2015-05-261-0/+5
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix two CSubNet constructor problems: - The use of `/x` where 8 does not divide x was broken, due to a bit-order issue - The use of e.g. `1.2.3.4/24` where the netmasked bits in the network are not 0 was broken. Fix this by explicitly normalizing the netwok according to the bitmask. Also add tests for these cases. Fixes #6179. Thanks to @jonasschnelli for reporting and initial fix.
* | | | Remove duplicate chainparams.h include from alert_testsMichael Ford2015-05-261-1/+0
| | | |
* | | | Merge pull request #5947Wladimir J. van der Laan2015-05-261-0/+64
|\ \ \ \ | |/ / / |/| | | | | | | 36cba8f Alert if it is very likely we are getting a bad chain (Gavin Andresen)
| * | | Alert if it is very likely we are getting a bad chainGavin Andresen2015-05-141-0/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create a monitoring task that counts how many blocks have been found in the last four hours. If very few or too many have been found, an alert is triggered. "Very few" and "too many" are set based on a false positive rate of once every fifty years of constant running with constant hashing power, which works out to getting 5 or fewer or 48 or more blocks in four hours (instead of the average of 24). Only one alert per day is triggered, so if you get disconnected from the network (or are being Sybil'ed) -alertnotify will be triggered after 3.5 hours but you won't get another -alertnotify for 24 hours. Tested with a new unit test and by running on the main network with -debug=partitioncheck Run test/test_bitcoin --log_level=message to see the alert messages: WARNING: check your network connection, 3 blocks received in the last 4 hours (24 expected) WARNING: abnormally high number of blocks generated, 60 blocks received in the last 4 hours (24 expected) The -debug=partitioncheck debug.log messages look like: ThreadPartitionCheck : Found 22 blocks in the last 4 hours ThreadPartitionCheck : likelihood: 0.0777702
* | | | Merge pull request #5996Wladimir J. van der Laan2015-05-191-3/+36
|\ \ \ \ | | | | | | | | | | | | | | | 935bd0a Chainparams: Refactor: Decouple main::GetBlockValue() from Params() [renamed GetBlockSubsidy] (Jorge Timón)
| * | | | Chainparams: Refactor: Decouple main::GetBlockValue() from Params() [renamed ↵Jorge Timón2015-05-151-3/+36
| | |/ / | |/| | | | | | | | | | | | | | | | | | GetBlockSubsidy] Remove redundant getter CChainParams::SubsidyHalvingInterval()
* / | | More robust CScheduler unit testGavin Andresen2015-05-161-9/+18
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | On a busy or slow system, the CScheduler unit test could fail because it assumed all threads would be done after a couple of milliseconds. Replace the hard-coded sleep with CScheduler stop() method that will cleanly exit the servicing threads when all tasks are completely finished.
* | | Merge pull request #6102Wladimir J. van der Laan2015-05-151-3/+24
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | 86a5f4b Relocate calls to CheckDiskSpace (Alex Morcos) 67708ac Write block index more frequently than cache flushes (Pieter Wuille) b3ed423 Cache tweak and logging improvements (Pieter Wuille) fc684ad Use accurate memory for flushing decisions (Pieter Wuille) 046392d Keep track of memory usage in CCoinsViewCache (Pieter Wuille) 540629c Add memusage.h (Pieter Wuille)
| * | Keep track of memory usage in CCoinsViewCachePieter Wuille2015-05-111-3/+24
| |/
* | Merge pull request #5964Gavin Andresen2015-05-141-0/+110
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | 9a1dcea Use CScheduler for net's DumpAddresses (Gavin Andresen) ddd0acd Create a scheduler thread for lightweight tasks (Gavin Andresen) 68d370b CScheduler unit test (Gavin Andresen) cfefe5b scheduler: fix with boost <= 1.50 (Cory Fields) ca66717 build: make libboost_chrono mandatory (Cory Fields) 928b950 CScheduler class for lightweight task scheduling (Gavin Andresen) e656560 [Qt] add defaultConfirmTarget constant to sendcoinsdialog (Philip Kaufmann)
| * | CScheduler unit testGavin Andresen2015-05-141-0/+110
| |/
* | Merge pull request #5159Wladimir J. van der Laan2015-05-131-0/+186
|\ \ | |/ |/| | | b649e03 Create new BlockPolicyEstimator for fee estimates (Alex Morcos)
| * Create new BlockPolicyEstimator for fee estimatesAlex Morcos2015-05-131-0/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Add more script edge condition tests.Dave Collins2015-05-062-0/+9
| | | | | | | | | | | | This commit adds some tests to the script_valid.json and tx_invalid.json data which exercise more edge conditions that are not currently being tested.
* | Merge pull request #6047Wladimir J. van der Laan2015-05-061-0/+3
|\ \ | | | | | | | | | | | | a56054b Update key.cpp to use new libsecp256k1 (Pieter Wuille) a591d98 Squashed 'src/secp256k1/' changes from 1897b8e..22f60a6 (Pieter Wuille)
| * | Update key.cpp to use new libsecp256k1Pieter Wuille2015-05-041-0/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | libsecp256k1's API changed, so update key.cpp to use it. Libsecp256k1 now has explicit context objects, which makes it completely thread-safe. In turn, keep an explicit context object in key.cpp, which is explicitly initialized destroyed. This is not really pretty now, but it's more efficient than the static initialized object in key.cpp (which made for example bitcoin-tx slow, as for most of its calls, libsecp256k1 wasn't actually needed). This also brings in the new blinding support in libsecp256k1. By passing in a random seed, temporary variables during the elliptic curve computations are altered, in such a way that if an attacker does not know the blind, observing the internal operations leaks less information about the keys used. This was implemented by Greg Maxwell.
* | Merge pull request #6055Wladimir J. van der Laan2015-05-062-9/+11
|\ \ | | | | | | | | | | | | | | | | | | a8cdaf5 checkpoints: move the checkpoints enable boolean into main (Cory Fields) 11982d3 checkpoints: Decouple checkpoints from Params (Cory Fields) 6996823 checkpoints: make checkpoints a member of CChainParams (Cory Fields) 9f13a10 checkpoints: store mapCheckpoints in CCheckpointData rather than a pointer (Cory Fields)
| * | checkpoints: move the checkpoints enable boolean into mainCory Fields2015-04-301-2/+2
| | | | | | | | | | | | | | | This pertains to app-state, so it doesn't make sense to handle inside the checkpoint functions.
| * | checkpoints: Decouple checkpoints from ParamsCory Fields2015-04-301-7/+9
| | | | | | | | | | | | Pass checkpoint data in as necessary
* | | Better mruset unit testPieter Wuille2015-04-301-72/+54
| | |
* | | Use ring buffer of set iterators instead of deque of copies in mrusetPieter Wuille2015-04-301-1/+1
| | |
* | | Rolling bloom filter classGavin Andresen2015-04-301-0/+78
|/ / | | | | | | | | | | | | For when you need to keep track of the last N items you've seen, and can tolerate some false-positives. Rebased-by: Pieter Wuille <[email protected]>
* | Merge pull request #6022Wladimir J. van der Laan2015-04-301-1/+1
|\ \ | | | | | | | | | b74dcb3 Separate CTranslationInterface from CClientUIInterface (Jorge Timón)
| * | Separate CTranslationInterface from CClientUIInterfaceJorge Timón2015-04-161-1/+1
| |/
* | Merge pull request #6075Wladimir J. van der Laan2015-04-291-0/+18
|\ \ | | | | | | | | | 9fadf1c Add additional script edge condition tests. (Dave Collins)
| * | Add additional script edge condition tests.Dave Collins2015-04-281-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds several tests to the script_invalid.json data which exercise some edge conditions that are not currently being tested. These are mainly being added to cover several cases a branch coverage analysis of btcd showed are not already being covered, but given more tests of edge conditions are always a good thing, I'm contributing them upstream.
* | | Merge pull request #6074Wladimir J. van der Laan2015-04-291-1/+1
|\ \ \ | | | | | | | | | | | | d8f4cc3 Correct the PUSHDATA4 minimal encoding test. (Dave Collins)
| * | | Correct the PUSHDATA4 minimal encoding test.Dave Collins2015-04-271-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test which is intended to prove that the script engine is properly rejecting non-minimally encoded PUSHDATA4 data is using the wrong opcode and value. The test is using 0x4f, which is OP_1NEGATE instead of the desired 0x4e, which is OP_PUSHDATA4. Further, the push of data is intended to be 256 bytes, but the value the test is using is 0x00100000 (4096), instead of the desired 0x00010000 (256). This commit fixes both issues. This was found while examining the branch coverage in btcd against only these tests to help find missing branch coverage.
* | | Merge pull request #5918Pieter Wuille2015-04-281-0/+24
|\ \ \ | |/ / |/| | | | | f7303f9 Use equivalent PoW for non-main-chain requests (Pieter Wuille)
| * | Use equivalent PoW for non-main-chain requestsPieter Wuille2015-04-221-0/+24
| |/