aboutsummaryrefslogtreecommitdiff
path: root/src/test/transaction_tests.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move ParseScript() helper, becoming accessible outside src/test/Jeff Garzik2014-07-291-1/+1
|
* Add CMutableTransaction and make CTransaction immutable.Pieter Wuille2014-06-211-7/+7
| | | | | In addition, introduce a cached hash inside CTransaction, to prevent recalculating it over and over again.
* Fix transaction testsWladimir J. van der Laan2014-05-091-1/+1
| | | | Conflict between low-s (6fd7ef2) and test updates in d3a33fc.
* Add rejection of non-null CHECKMULTISIG dummy valuesPeter Todd2014-05-081-0/+1
| | | | | | This is a source of transaction mutability as the dummy value was previously not checked and could be modified to something other than the usual OP_0 value.
* Let tx (in)valid tests use any SCRIPT_VERIFY flagPeter Todd2014-05-051-6/+43
| | | | Previously only P2SH could be set.
* Add required locks in testsWladimir J. van der Laan2014-04-231-0/+1
| | | | Unit tests with DEBUG_LOCKORDER were running into assertions.
* Add licenses for tests and test dataWladimir J. van der Laan2014-03-181-1/+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
* Merge pull request #3737 from jgarzik/op-return-sizeGavin Andresen2014-02-261-7/+7
|\ | | | | script: reduce OP_RETURN standard relay bytes to 40
| * script: reduce OP_RETURN standard relay bytes to 40Jeff Garzik2014-02-261-7/+7
| | | | | | | | Per mailing list discussion.
* | Drop fees by 10x due to the persistently higher exchange rate.Mike Hearn2013-11-261-2/+2
|/ | | | | | | | | | | | | | | | The last fee drop was by 5x (from 50k satoshis to 10k satoshis) in the 0.8.2 release which was about 6 months ago. The current fee is (assuming a $500 exchange rate) about 5 dollar cents. The new fee after this patch is 0.5 cents. Miners who prefer the higher fees are obviously still able to use the command line flags to override this setting. Miners who choose to create smaller blocks will select the highest-fee paying transactions anyway. This would hopefully be the last manual adjustment ever required before floating fees become normal.
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-5/+11
| | | | | | | | | Use misc methods of avoiding unnecesary header includes. Replace int typedefs with int##_t from stdint.h. Replace PRI64[xdu] with PRI[xdu]64 from inttypes.h. Normalize QT_VERSION ifs where possible. Resolve some indirect dependencies as direct ones. Remove extern declarations from .cpp files.
* Merge pull request #3128Gavin Andresen2013-11-011-1/+14
|\ | | | | | | | | | | | | 0056095 Show short scriptPubKeys correctly (Peter Todd) 22de68d Relay OP_RETURN TxOut as standard transaction type (Peter Todd) Signed-off-by: Gavin Andresen <[email protected]>
| * Relay OP_RETURN TxOut as standard transaction typePeter Todd2013-10-241-1/+14
| | | | | | | | | | | | Also fix decoderawtransaction to not show reqSigs or addresses for nulldata txouts. (Previous version also left reqSigs uninitialized mistakenly)
* | Revert "Switch to using raw_utf8"Jeff Garzik2013-10-221-2/+2
|/ | | | This reverts commit 2ecb7555a9df1e843fd25f588819e4ca1d94b266.
* Merge pull request #2740 from constantined/constantinedGavin Andresen2013-10-221-2/+2
|\ | | | | UTF-8 support for JSON-RPC
| * Switch to using raw_utf8constantined2013-07-231-2/+2
| |
* | Relay OP_RETURN data TxOut as standard transaction typeJeff Garzik2013-10-021-0/+14
| |
* | included-tests: generate binary data from test files for inclusion into test ↵Cory Fields2013-09-161-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Log reason for non-standard transaction rejectionJeff Garzik2013-06-231-4/+5
| |
* | Removed AcceptToMemoryPool method from CTransaction. This method belongs to ↵Eric Lombrozo2013-06-051-12/+12
|/ | | | | | | | | | | | | | | | | 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.
* Define dust transaction outputs, and make them non-standardGavin Andresen2013-05-031-12/+22
|
* CValidationState frameworkPieter Wuille2013-01-301-4/+8
|
* Introduce script verification flagsPieter Wuille2012-11-151-2/+2
| | | | | | | | These flags select features to be enabled/disabled during script evaluation/checking, instead of several booleans passed along. Currently these flags are defined: * SCRIPT_VERIFY_P2SH: enable BIP16-style subscript evaluation * SCRIPT_VERIFY_STRICTENC: enforce strict adherence to pubkey/sig encoding standards.
* Direct CCoins referencesPieter Wuille2012-10-201-3/+0
| | | | | | | | To prevent excessive copying of CCoins in and out of the CCoinsView implementations, introduce a GetCoins() function in CCoinsViewCache with returns a direct reference. The block validation and connection logic is updated to require caching CCoinsViews, and exploits the GetCoins() function heavily.
* UltraprunePieter Wuille2012-10-201-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This switches bitcoin's transaction/block verification logic to use a "coin database", which contains all unredeemed transaction output scripts, amounts and heights. The name ultraprune comes from the fact that instead of a full transaction index, we only (need to) keep an index with unspent outputs. For now, the blocks themselves are kept as usual, although they are only necessary for serving, rescanning and reorganizing. The basic datastructures are CCoins (representing the coins of a single transaction), and CCoinsView (representing a state of the coins database). There are several implementations for CCoinsView. A dummy, one backed by the coins database (coins.dat), one backed by the memory pool, and one that adds a cache on top of it. FetchInputs, ConnectInputs, ConnectBlock, DisconnectBlock, ... now operate on a generic CCoinsView. The block switching logic now builds a single cached CCoinsView with changes to be committed to the database before any changes are made. This means no uncommitted changes are ever read from the database, and should ease the transition to another database layer which does not support transactions (but does support atomic writes), like LevelDB. For the getrawtransaction() RPC call, access to a txid-to-disk index would be preferable. As this index is not necessary or even useful for any other part of the implementation, it is not provided. Instead, getrawtransaction() uses the coin database to find the block height, and then scans that block to find the requested transaction. This is slow, but should suffice for debug purposes.
* Check for canonical public keys and signaturesPieter Wuille2012-09-211-2/+2
| | | | Only enabled inside tests for now.
* check tx.CheckTransaction for data-driven tx tests.Matt Corallo2012-09-051-2/+8
| | | | | (and change so that only one case has to fail to make a tx_invalid test correct)
* Add data-driven transaction tests.Matt Corallo2012-08-201-0/+138
|
* Refactor: split CKeyID/CScriptID/CTxDestination from CBitcoinAddressPieter Wuille2012-05-241-2/+2
| | | | | | | | | | | | | | | | | This introduces internal types: * CKeyID: reference (hash160) of a key * CScriptID: reference (hash160) of a script * CTxDestination: a boost::variant of the former two CBitcoinAddress is retrofitted to be a Base58 encoding of a CTxDestination. This allows all internal code to only use the internal types, and only have RPC and GUI depend on the base58 code. Furthermore, the header dependencies are a lot saner now. base58.h is at the top (right below rpc and gui) instead of at the bottom. For the rest: wallet -> script -> keystore -> key. Only keystore still requires a forward declaration of CScript. Solving that would require splitting script into two layers.
* Fix tests after recent refactorsPieter Wuille2012-04-171-1/+1
|
* Fix tests after 38067c18Pieter Wuille2012-02-201-1/+1
|
* Merge branch 'standardScriptSigs' of github.com:gavinandresen/bitcoin-gitGavin Andresen2012-02-071-6/+18
|\
| * Make transactions with extra data in their scriptSig's non-standard.Gavin Andresen2012-01-191-6/+18
| |
* | Simplify counting of P2SH sigops to match BIP 16 (thanks to Matt Corallo for ↵Gavin Andresen2012-01-201-2/+0
|/ | | | | | prompting this). This also removes an un-needed sigops-per-byte check when accepting transactions to the memory pool (un-needed assuming only standard transactions are being accepted). And it only counts P2SH sigops after the switchover date.
* Refactored ConnectInputs, so valid-transaction-checks are done before ↵Gavin Andresen2012-01-131-0/+85
| | | | ECDSA-verifying signatures.
* Rework unit tests so test_bitcoin.cpp does not #include them allGavin Andresen2011-12-191-2/+2
|
* Add file for transaction tests.Matt Corallo2011-08-081-0/+25