aboutsummaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2013-10-23Add test for monetary value parsingWladimir J. van der Laan
Just-in-case sanity test for JSON spirit and AmountFromValue. Also update rpc_format_monetary_values test to use ValueFromAmount, so that ValueFromAmount is also tested.
2013-10-23Add test for monetary value formattingWladimir J. van der Laan
Tests for issue #3126. This problem pops up after upgrading json-spirit.
2013-10-22Revert "Switch to using raw_utf8"Jeff Garzik
This reverts commit 2ecb7555a9df1e843fd25f588819e4ca1d94b266.
2013-10-22Merge pull request #2740 from constantined/constantinedGavin Andresen
UTF-8 support for JSON-RPC
2013-10-21Merge pull request #2738 from jgarzik/op_returnGavin Andresen
Relay OP_RETURN data TxOut as standard transaction type.
2013-10-19Merge pull request #2884 from gavinandresen/canonicalsizes2Gavin Andresen
Reject non-canonically-encoded CompactSize
2013-10-16Merge pull request #2645 from sipa/inlinesighashGavin Andresen
Inline signature serializer
2013-10-11Refactor/encapsulate chain globals into a CChain classPieter Wuille
2013-10-02Relay OP_RETURN data TxOut as standard transaction typeJeff Garzik
2013-09-29Merge pull request #3015 from theuni/win32-version-infoPieter Wuille
Win32 version info
2013-09-28Inline signature serializerPieter Wuille
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.
2013-09-19Fix minor unit test memory leaksPieter Wuille
2013-09-18autotools: fix the Makefile.include to be safely included anywhere.Cory Fields
This way we can reuse rules rather than duplicating them.
2013-09-16included-tests: generate binary data from test files for inclusion into test ↵Cory Fields
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.
2013-09-10Bugfix: Since test_bitcoin is being built and run inside src/test/, try ↵Luke Dashjr
using relative directories from that point
2013-09-10autotools: use an absolute path to test dataCory Fields
2013-09-05autotools: switch to autotools buildsystemCory Fields
2013-08-25Merge pull request #2928 from jgarzik/cnb-txoutJeff Garzik
CreateNewBlock / getblocktemplate cleaning
2013-08-25Document and test OP_RESERVED weirdnessPeter Todd
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.
2013-08-24CreateNewBlock() now takes scriptPubKey argument,Jeff Garzik
rather than a key. CreateNewBlockWithKey() helper is added to restore existing functionality, making this an equivalent-transformation change.
2013-08-20Add MurmurHash3() unit testPeter Todd
Useful as a source of test vectors to anyone re-implementing bloom filters.
2013-08-15Merge pull request #2880 from gavinandresen/test_numequalGavin Andresen
More unit tests for OP_NUMEQUAL
2013-08-15Merge pull request #2886 from gavinandresen/rpctimingGavin Andresen
Make RPC password resistant to timing attacks
2013-08-15Merge pull request #2131 from sipa/evensGregory Maxwell
Only create signatures with even S, and verification mode to check.
2013-08-15Merge pull request #2829 from sipa/bip32Gavin Andresen
BIP 32 derivation + test vectors
2013-08-16Only create signatures with even S, and verification mode to check.Pieter Wuille
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.
2013-08-09Reject non-canonically-encoded sizesGavin Andresen
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.
2013-08-08Make RPC password resistant to timing attacksGavin Andresen
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.
2013-08-06Merge pull request #2871 from gavinandresen/simplify_maporphanGavin Andresen
Simplify storage of orphan transactions, fix CVE-2013-4627
2013-08-06More unit tests for NUMEQUALGavin Andresen
2013-08-05Merge pull request #2849 from petertodd/if-else-elseGavin Andresen
Add unittests for multiple ELSEs in a row
2013-08-02Simplify storage of orphan transactionsGavin Andresen
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.
2013-07-31Move internal miner/block creation to separate miner.cpp module.Jeff Garzik
Public functions referenced elsewhere are added to miner.h.
2013-07-23Add unittests for multiple ELSEs in a rowPeter Todd
IF ELSE ELSE ENDIF is a valid construct; execution or non-execution inverts on each ELSE encountered.
2013-07-23Switch to using raw_utf8constantined
2013-07-15BIP32 test vectorsPieter Wuille
2013-07-10Merge pull request #2743 from jgarzik/reject-reasonJeff Garzik
Log reason for non-standard transaction rejection
2013-07-07Make the rand tests determinstic. (fixes #2714)Gregory Maxwell
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.
2013-06-23Pulled CheckBlock out of CBlock.Eric Lombrozo
2013-06-24Add HMAC-SHA512 to hashPieter Wuille
2013-06-23Log reason for non-standard transaction rejectionJeff Garzik
2013-06-19Introduce a CChainParameters singleton class and regtest mode.Mike Hearn
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.
2013-06-05Removed AcceptToMemoryPool method from CTransaction. This method belongs to ↵Eric Lombrozo
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.
2013-06-03Merge pull request #2727 from TheBlueMatt/masterWladimir J. van der Laan
One more data-driven test-case
2013-06-02Add new data-driven test-case.Matt Corallo
2013-06-01remove GetBoolArg() fDefault parameter defaulting to falsePhilip Kaufmann
- 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
2013-05-30Merge pull request #2600 from sipa/keyrefactorJeff Garzik
Refactor key.cpp/.h
2013-05-30Merge pull request #2104 from al42and/listreceivedbyaddress_txidsJeff Garzik
listreceivedbyaddress now provides tx ids (issue #1149)
2013-05-30Merge pull request #2657 from gmaxwell/its_after_may15_foreverJeff Garzik
It's after 2013-05-15 forever now, so remove the code for the May 15 fork
2013-05-30CSecret/CKey -> CKey/CPubKey split/refactorPieter Wuille