aboutsummaryrefslogtreecommitdiff
path: root/src/test
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | Relay OP_RETURN data TxOut as standard transaction typeJeff Garzik2013-10-022-5/+21
| | |/ / | |/| |
* | | | Merge pull request #2884 from gavinandresen/canonicalsizes2Gavin Andresen2013-10-191-0/+60
|\ \ \ \ | | | | | | | | | | Reject non-canonically-encoded CompactSize
| * | | | Reject non-canonically-encoded sizesGavin Andresen2013-08-091-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The length of vectors, maps, sets, etc are serialized using Write/ReadCompactSize -- which, unfortunately, do not use a unique encoding. So deserializing and then re-serializing a transaction (for example) can give you different bits than you started with. That doesn't cause any problems that we are aware of, but it is exactly the type of subtle mismatch that can lead to exploits. With this pull, reading a non-canonical CompactSize throws an exception, which means nodes will ignore 'tx' or 'block' or other messages that are not properly encoded. Please check my logic... but this change is safe with respect to causing a network split. Old clients that receive non-canonically-encoded transactions or blocks deserialize them into CTransaction/CBlock structures in memory, and then re-serialize them before relaying them to peers. And please check my logic with respect to causing a blockchain split: there are no CompactSize fields in the block header, so the block hash is always canonical. The merkle root in the block header is computed on a vector<CTransaction>, so any non-canonical encoding of the transactions in 'tx' or 'block' messages is erased as they are read into memory by old clients, and does not affect the block hash. And, as noted above, old clients re-serialize (with canonical encoding) 'tx' and 'block' messages before relaying to peers.
* | | | | Merge pull request #2645 from sipa/inlinesighashGavin Andresen2013-10-164-3/+123
|\ \ \ \ \ | | | | | | | | | | | | Inline signature serializer
| * | | | | Inline signature serializerPieter Wuille2013-09-284-3/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of building a full copy of a CTransaction being signed, and then modifying bits and pieces until its fits the form necessary for computing the signature hash, use a wrapper serializer that only serializes the necessary bits on-the-fly. This makes it easier to see which data is actually being hash, reduces load on the heap, and also marginally improves performances (around 3-4us/sigcheck here). The performance improvements are much larger for large transactions, though. The old implementation of SignatureHash is moved to a unit tests, to test whether the old and new algorithm result in the same value for randomly-constructed transactions.
* | | | | | Refactor/encapsulate chain globals into a CChain classPieter Wuille2013-10-111-6/+6
| |_|/ / / |/| | | |
* | | | | Merge pull request #3015 from theuni/win32-version-infoPieter Wuille2013-09-291-2/+2
|\ \ \ \ \ | |/ / / / |/| | | | Win32 version info
| * | | | autotools: fix the Makefile.include to be safely included anywhere.Cory Fields2013-09-181-2/+2
| | | | | | | | | | | | | | | | | | | | This way we can reuse rules rather than duplicating them.
* | | | | Fix minor unit test memory leaksPieter Wuille2013-09-192-0/+5
|/ / / /
* | | | included-tests: generate binary data from test files for inclusion into test ↵Cory Fields2013-09-167-69/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | binaries This change moves test data into the binaries rather than reading them from the disk at runtime. Advantages: - Tests become distributable - Cross-compile friendly. Build on one machine and execute in an arbitrary location on another. - Easier testing for backports. Users can verify that tests pass without having to track down corresponding test data. - More trustworthy test results and easier quality assurance as tests make fewer assumptions about their environment. - Tests could theoretically run at client/daemon startup and exit on failure. Disadvantages: - Required 'hexdump' build-dependency. This is a standard bsd tool that should be usable everywhere. It is likely already installed on all build-machines. - Tests can no longer be fudged after build by altering test-data.
* | | | Bugfix: Since test_bitcoin is being built and run inside src/test/, try ↵Luke Dashjr2013-09-103-3/+6
| | | | | | | | | | | | | | | | using relative directories from that point
* | | | autotools: use an absolute path to test dataCory Fields2013-09-101-2/+2
| | | |
* | | | autotools: switch to autotools buildsystemCory Fields2013-09-051-0/+38
| | | |
* | | | Merge pull request #2928 from jgarzik/cnb-txoutJeff Garzik2013-08-251-11/+11
|\ \ \ \ | | | | | | | | | | CreateNewBlock / getblocktemplate cleaning
| * | | | CreateNewBlock() now takes scriptPubKey argument,Jeff Garzik2013-08-241-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | rather than a key. CreateNewBlockWithKey() helper is added to restore existing functionality, making this an equivalent-transformation change.
* | | | | Document and test OP_RESERVED weirdnessPeter Todd2013-08-253-3/+12
|/ / / / | | | | | | | | | | | | | | | | | | | | Seems it was forgotten about when IsPushOnly() and the unittests were written. A particular oddity is that OP_RESERVED doesn't count towards the >201 opcode limit unlike every other named opcode.
* | | | Add MurmurHash3() unit testPeter Todd2013-08-201-0/+44
| | | | | | | | | | | | | | | | | | | | Useful as a source of test vectors to anyone re-implementing bloom filters.
* | | | Merge pull request #2880 from gavinandresen/test_numequalGavin Andresen2013-08-151-0/+9
|\ \ \ \ | | | | | | | | | | More unit tests for OP_NUMEQUAL
| * | | | More unit tests for NUMEQUALGavin Andresen2013-08-061-0/+9
| | | | |
* | | | | Merge pull request #2886 from gavinandresen/rpctimingGavin Andresen2013-08-151-0/+11
|\ \ \ \ \ | | | | | | | | | | | | Make RPC password resistant to timing attacks
| * | | | | Make RPC password resistant to timing attacksGavin Andresen2013-08-081-0/+11
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes issue#2838; this is a tweaked version of pull#2845 that should not leak the length of the password and is more generic, in case we run into other situations where we need timing-attack-resistant comparisons.
* | | | | Merge pull request #2131 from sipa/evensGregory Maxwell2013-08-151-2/+2
|\ \ \ \ \ | | | | | | | | | | | | Only create signatures with even S, and verification mode to check.
| * | | | | Only create signatures with even S, and verification mode to check.Pieter Wuille2013-08-161-2/+2
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To fix a minor malleability found by Sergio Lerner (reported here: https://bitcointalk.org/index.php?topic=8392.msg1245898#msg1245898) The problem is that if (R,S) is a valid ECDSA signature for a given message and public key, (R,-S) is also valid. Modulo N (the order of the secp256k1 curve), this means that both (R,S) and (R,N-S) are valid. Given that N is odd, S and N-S have a different lowest bit. We solve the problem by forcing signatures to have an even S value, excluding one of the alternatives. This commit just changes the signing code to always produce even S values, and adds a verification mode to check it. This code is not enabled anywhere yet. Existing tests in key_tests.cpp verify that the produced signatures are still valid.
* | | | | Merge pull request #2829 from sipa/bip32Gavin Andresen2013-08-152-0/+241
|\ \ \ \ \ | |/ / / / |/| | | | BIP 32 derivation + test vectors
| * | | | BIP32 test vectorsPieter Wuille2013-07-151-0/+116
| | | | |
| * | | | Add HMAC-SHA512 to hashPieter Wuille2013-06-241-0/+125
| | | | |
* | | | | Merge pull request #2871 from gavinandresen/simplify_maporphanGavin Andresen2013-08-061-20/+9
|\ \ \ \ \ | |_|/ / / |/| | | | Simplify storage of orphan transactions, fix CVE-2013-4627
| * | | | Simplify storage of orphan transactionsGavin Andresen2013-08-021-20/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Orphan transactions were stored as a CDataStream pointer; this changes the mapOrphanTransactions data structures to store orphans as a CTransaction. This also fixes CVE-2013-4627 by always re-serializing transactions before relaying them.
* | | | | Merge pull request #2849 from petertodd/if-else-elseGavin Andresen2013-08-052-1/+30
|\ \ \ \ \ | |/ / / / |/| | | | Add unittests for multiple ELSEs in a row
| * | | | Add unittests for multiple ELSEs in a rowPeter Todd2013-07-232-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | IF ELSE ELSE ENDIF is a valid construct; execution or non-execution inverts on each ELSE encountered.
* | | | | Move internal miner/block creation to separate miner.cpp module.Jeff Garzik2013-07-311-0/+1
|/ / / / | | | | | | | | | | | | Public functions referenced elsewhere are added to miner.h.
* | | | Merge pull request #2743 from jgarzik/reject-reasonJeff Garzik2013-07-102-7/+10
|\ \ \ \ | | | | | | | | | | Log reason for non-standard transaction rejection
| * | | | Log reason for non-standard transaction rejectionJeff Garzik2013-06-232-7/+10
| |/ / /
* | | | Make the rand tests determinstic. (fixes #2714)Gregory Maxwell2013-07-071-33/+1
| | | | | | | | | | | | | | | | | | | | | | | | This avoids spurious errors with the old tests but still tests enough that if the rng is replaced with a totally broken one it should still fail.
* | | | Pulled CheckBlock out of CBlock.Eric Lombrozo2013-06-231-1/+1
|/ / /
* | | Introduce a CChainParameters singleton class and regtest mode.Mike Hearn2013-06-192-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new class is accessed via the Params() method and holds most things that vary between main, test and regtest networks. The regtest mode has two purposes, one is to run the bitcoind/bitcoinj comparison tool which compares two separate implementations of the Bitcoin protocol looking for divergence. The other is that when run, you get a local node which can mine a single block instantly, which is highly convenient for testing apps during development as there's no need to wait 10 minutes for a block on the testnet.
* | | Removed AcceptToMemoryPool method from CTransaction. This method belongs to ↵Eric Lombrozo2013-06-054-23/+23
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the mempool instance. Removed AreInputsStandard from CTransaction, made it a regular function in main. Moved CTransaction::GetOutputFor to CCoinsViewCache. Moved GetLegacySigOpCount and GetP2SHSigOpCount out of CTransaction into regular functions in main. Moved GetValueIn and HaveInputs from CTransaction into CCoinsViewCache. Moved AllowFree, ClientCheckInputs, CheckInputs, UpdateCoins, and CheckTransaction out of CTransaction and into main. Moved IsStandard and IsFinal out of CTransaction and put them in main as IsStandardTx and IsFinalTx. Moved GetValueOut out of CTransaction into main. Moved CTxIn, CTxOut, and CTransaction into core. Added minimum fee parameter to CTxOut::IsDust() temporarily until CTransaction is moved to core.h so that CTxOut needn't know about CTransaction.
* | Merge pull request #2727 from TheBlueMatt/masterWladimir J. van der Laan2013-06-031-1/+7
|\ \ | | | | | | One more data-driven test-case
| * | Add new data-driven test-case.Matt Corallo2013-06-021-1/+7
| | |
* | | remove GetBoolArg() fDefault parameter defaulting to falsePhilip Kaufmann2013-06-012-32/+18
| | | | | | | | | | | | | | | | | | | | | | | | - explicitly set the default of all GetBoolArg() calls - rework getarg_test.cpp and util_tests.cpp to cover this change - some indentation fixes - move macdockiconhandler.h include in bitcoin.cpp to the "our headers" section
* | | Merge pull request #2600 from sipa/keyrefactorJeff Garzik2013-05-307-74/+71
|\ \ \ | | | | | | | | Refactor key.cpp/.h
| * | | CSecret/CKey -> CKey/CPubKey split/refactorPieter Wuille2013-05-307-74/+71
| |/ /
* | | Merge pull request #2104 from al42and/listreceivedbyaddress_txidsJeff Garzik2013-05-301-7/+28
|\ \ \ | | | | | | | | listreceivedbyaddress now provides tx ids (issue #1149)
| * | | Updated help and tests for getreceivedby(account|address)Andrey2012-12-161-7/+28
| | | |
* | | | Merge pull request #2657 from gmaxwell/its_after_may15_foreverJeff Garzik2013-05-301-2/+0
|\ \ \ \ | |_|/ / |/| | | It's after 2013-05-15 forever now, so remove the code for the May 15 fork
| * | | It's after 2013-05-15 forever now, so remove the code for the May 15 fork.Gregory Maxwell2013-05-161-2/+0
| | | |
* | | | Add a few data-driven tests for SIGHASH_ANYONECANPAYMatt Corallo2013-05-212-2/+17
|/ / /
* | | Define dust transaction outputs, and make them non-standardGavin Andresen2013-05-033-22/+34
| | |
* | | Remove flaky util thread unit testsGavin Andresen2013-05-031-58/+0
| | |
* | | Port Thread* methods to boost::thread_groupGavin Andresen2013-04-031-2/+4
| | |