aboutsummaryrefslogtreecommitdiff
path: root/src/test/transaction_tests.cpp
AgeCommit message (Collapse)Author
2017-11-16test: refactor: Use absolute include paths for test data filesWladimir J. van der Laan
2017-11-16scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider
-BEGIN VERIFY SCRIPT- for f in \ src/*.cpp \ src/*.h \ src/bench/*.cpp \ src/bench/*.h \ src/compat/*.cpp \ src/compat/*.h \ src/consensus/*.cpp \ src/consensus/*.h \ src/crypto/*.cpp \ src/crypto/*.h \ src/crypto/ctaes/*.h \ src/policy/*.cpp \ src/policy/*.h \ src/primitives/*.cpp \ src/primitives/*.h \ src/qt/*.cpp \ src/qt/*.h \ src/qt/test/*.cpp \ src/qt/test/*.h \ src/rpc/*.cpp \ src/rpc/*.h \ src/script/*.cpp \ src/script/*.h \ src/support/*.cpp \ src/support/*.h \ src/support/allocators/*.h \ src/test/*.cpp \ src/test/*.h \ src/wallet/*.cpp \ src/wallet/*.h \ src/wallet/test/*.cpp \ src/wallet/test/*.h \ src/zmq/*.cpp \ src/zmq/*.h do base=${f%/*}/ relbase=${base#src/} sed -i "s:#include \"\(.*\)\"\(.*\):if test -e \$base'\\1'; then echo \"#include <\"\$relbase\"\\1>\\2\"; else echo \"#include <\\1>\\2\"; fi:e" $f done -END VERIFY SCRIPT-
2017-08-30[Refactor] Combine scriptPubKey and amount as CTxOut in CScriptCheckJohnson Lau
2017-07-17Remove factor of 3 from definition of dust.Alex Morcos
This redefines dust to be the value of an output such that it would cost that value in fees to (create and) spend the output at the dust relay rate. The previous definition was that it would cost 1/3 of the value. The default dust relay rate is correspondingly increased to 3000 sat/kB so the actual default dust output value of 546 satoshis for a non-segwit output remains unchanged. This commit is a refactor only unless a dustrelayfee is passed on the commandline in which case that number now needs to be increased by a factor of 3 to get the same behavior. -dustrelayfee is a hidden command line option. Note: It's not exactly a refactor due to edge case changes in rounding as evidenced by the required change to the unit test.
2017-06-22scripted-diff: Remove #include <boost/foreach.hpp>Jorge Timón
-BEGIN VERIFY SCRIPT- sed -i ':a;N;$!ba;s/#include <boost\/foreach.hpp>\n//' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp -END VERIFY SCRIPT-
2017-06-13Merge #10502: scripted-diff: Remove BOOST_FOREACH, Q_FOREACH and PAIRTYPEPieter Wuille
1238f13cf scripted-diff: Remove PAIRTYPE (Jorge Timón) 18dc3c396 scripted-diff: Remove Q_FOREACH (Jorge Timón) 7c00c2672 scripted-diff: Fully remove BOOST_FOREACH (Jorge Timón) a5410ac5e Small preparations for Q_FOREACH, PAIRTYPE and #include <boost/foreach.hpp> removal (Jorge Timón) Tree-SHA512: d3ab4a173366402e7dcef31608977b757d4aa07abbbad2ee1bcbcfa311e994a4552f24e5a55272cb22c2dcf89a4b0495e02e9d9aceae4b08c0bab668f20e324c
2017-06-06Use list initialization (C++11) for maps/vectors instead of ↵practicalswift
boost::assign::map_list_of/list_of
2017-06-05scripted-diff: Fully remove BOOST_FOREACHJorge Timón
-BEGIN VERIFY SCRIPT- sed -i 's/BOOST_FOREACH *(\(.*\),/for (\1 :/' ./src/*.h ./src/*.cpp ./src/*/*.h ./src/*/*.cpp ./src/*/*/*.h ./src/*/*/*.cpp ; -END VERIFY SCRIPT-
2017-06-01Switch CScriptCheck to use Coin instead of CCoinsPieter Wuille
2017-06-01Only pass things committed to by tx's witness hash to CScriptCheckMatt Corallo
This clarifies a bit more the ways in which the new script execution cache could break consensus in the future if additional data from the CCoins object were to be used as a part of script execution. After this change, any such consensus breaks should be very visible to reviewers, hopefully ensuring no such changes can be made.
2017-06-01Switch from per-tx to per-txout CCoinsViewCache methods in some placesPieter Wuille
2017-05-26Remove/ignore tx version in utxo and undoPieter Wuille
This makes the following changes: * In undo data and the chainstate database, the transaction nVersion field is removed from the data structures, always written as 0, and ignored when reading. * The definition of hash_serialized in gettxoutsetinfo is changed to no longer incude the nVersion field. It is renamed to hash_serialized_2 to avoid confusion. The new definition also includes transaction height and coinbase information, as this information was missing before. This depends on having a CHashVerifier-based undo data checksum verifier. Apart from changing the definition of serialized_hash, downgrading after using this patch is supported, as no release ever used the value of nVersion field in UTXO entries.
2017-04-06MOVEONLY: tx functions to consensus/tx_verify.oJorge Timón
Functions related to transaction verification.
2017-03-07Merge #9555: [test] Avoid reading a potentially uninitialized variable in ↵MarcoFalke
tx_invalid-test (transaction_tests.cpp) 8455e36 [test] Avoid reading a potentially uninitialized variable in tx_invalid-test (practicalswift) Tree-SHA512: 1064cdd5c9e4612a05397a5880535d93dbb18dec4897b4bbda9e6ad78d30f4c72303e4d23159398f1b33545ff5819e739e374d7cde757e402b26c355268a2319
2017-01-21[test] Avoid reading a potentially uninitialized variable in tx_invalid-testpracticalswift
Prior to this commit the err variable was not guaranteed to be set before the check ... BOOST_CHECK_MESSAGE(err != SCRIPT_ERR_OK, ScriptErrorString(err));
2017-01-16Merge #9380: Separate different uses of minimum feesWladimir J. van der Laan
eb30d1a Introduce -dustrelayfee (Alex Morcos) 7b1add3 Introduce -incrementalrelayfee (Alex Morcos) daec955 Introduce -blockmintxfee (Alex Morcos)
2017-01-16Introduce -dustrelayfeeAlex Morcos
2017-01-02Refactoring: Removed using namespace <xxx> from bench/ and test/ source files.Karl-Johan Alm
2016-12-04Move CTxInWitness inside CTxInPieter Wuille
2016-12-02Make CTransaction actually immutablePieter Wuille
2016-12-02Rename the remaining main.{h,cpp} to validation.{h,cpp}Matt Corallo
2016-10-16Require compressed keys in segwit as policy and disable signing with ↵Johnson Lau
uncompressed keys for segwit scripts
2016-09-27Add policy: null signature for failed CHECK(MULTI)SIGJohnson Lau
2016-09-23Make non-minimal OP_IF/NOTIF argument non-standard for P2WSHJohnson Lau
2016-08-26Rename to PrecomputedTransactionDataPieter Wuille
2016-08-16Unit test for sighash cachingNicolas DORIER
2016-08-16Precompute sighashesPieter Wuille
Original version by Nicolas Dorier. Precomputing version by Pieter Wuille.
2016-06-22[qa] Add transaction tests for segwitNicolasDorier
Including BIP143 P2WSH examples by jl2012.
2016-06-22[qa] Witness version 0 signing unit testsPieter Wuille
2016-06-22Refactor script validation to observe amountsPieter Wuille
This is a preparation for BIP143 support.
2016-06-22BIP141: Witness programPieter Wuille
2016-06-22BIP144: Serialization, hashes, relay (sender side)Pieter Wuille
Contains refactorings by Eric Lombrozo. Contains fixup by Nicolas Dorier. Contains cleanup of CInv::GetCommand by Alex Morcos
2016-02-14BIP112: Implement CHECKSEQUENCEVERIFYMark Friedenbach
- Replace NOP3 with CHECKSEQUENCEVERIFY (BIP112) <nSequence> CHECKSEQUENCEVERIFY -> <nSequence> - Fails if txin.nSequence < nSequence, allowing funds of a txout to be locked for a number of blocks or a duration of time after its inclusion in a block. - Pull most of CheckLockTime() out into VerifyLockTime(), a local function that will be reused for CheckSequence() - Add bitwise AND operator to CScriptNum - Enable CHECKSEQUENCEVERIFY as a standard script verify flag - Transactions that fail CSV verification will be rejected from the mempool, making it easy to test the feature. However blocks containing "invalid" CSV-using transactions will still be accepted; this is *not* the soft-fork required to actually enable CSV for production use.
2016-02-01Get rid of inaccurate ScriptSigArgsExpectedPieter Wuille
(cherry picked from commit 52b29dca7670c3f6d2ab918c0fff1d17c4e494ad)
2015-12-13Bump copyright headers to 2015MarcoFalke
2015-11-09[trivial] New DEFAULT_MIN_RELAY_TX_FEE = 1000MarcoFalke
2015-11-09transaction_tests: Be more strict checking dustMarcoFalke
* Don't allow off-by-one or more * Make clear dust is coupled with minRelayTxFee * Check rounding for odd values
2015-10-10tests: update transaction_tests for new dust thresholdWladimir J. van der Laan
2015-10-01Accept any sequence of PUSHDATAs in OP_RETURN outputsPeter Todd
Previously only one PUSHDATA was allowed, needlessly limiting applications such as matching OP_RETURN contents with bloom filters that operate on a per-PUSHDATA level. Now any combination that passes IsPushOnly() is allowed, so long as the total size of the scriptPubKey is less than 42 bytes. (unchanged modulo non-minimal PUSHDATA encodings) Also, this fixes the odd bug where previously the PUSHDATA could be replaced by any single opcode, even sigops consuming opcodes such as CHECKMULTISIG. (20 sigops!)
2015-10-01[Univalue] add univalue over subtreeJonas Schnelli
similar to secp256k1 include and compile univalue over a subtree
2015-07-23Includes: Cleanup around net main and walletJorge Timón
-Move from .h to .cpp: in main, net and wallet -Remove unnecessary #include "main.h" -Cleanup some wallet files includes
2015-07-23TRIVIAL: Missing includesJorge Timón
2015-06-26Policy: MOVEONLY: 3 functions to policy.o:Luke Dashjr
- [script/standard.o] IsStandard - [main.o] IsStandardTx - [main.o] AreInputsStandard Also, don't use namespace std in policy.cpp
2015-06-26Merge pull request #6124Wladimir J. van der Laan
ffd75ad Enable CHECKLOCKTIMEVERIFY as a standard script verify flag (Peter Todd) bc60b2b Replace NOP2 with CHECKLOCKTIMEVERIFY (BIP65) (Peter Todd) 48e9c57 Move LOCKTIME_THRESHOLD to src/script/script.h (Peter Todd) 99088d6 Make CScriptNum() take nMaxNumSize as an argument (Peter Todd)
2015-06-21Replace NOP2 with CHECKLOCKTIMEVERIFY (BIP65)Peter Todd
<nLockTime> CHECKLOCKTIMEVERIFY -> <nLockTime> Fails if tx.nLockTime < nLockTime, allowing the funds in a txout to be locked until some block height or block time in the future is reached. Only the logic and unittests are implemented; this commit does not have any actual soft-fork logic in it. Thanks to Pieter Wuille for rebase. Credit goes to Gregory Maxwell for the suggestion of comparing the argument against the transaction nLockTime rather than the current time/blockheight directly.
2015-06-04Remove JSON Spirit wrapper, remove JSON Spirit leftoversJonas Schnelli
- implement find_value() function for UniValue - replace all Array/Value/Object types with UniValues, remove JSON Spirit to UniValue wrapper - remove JSON Spirit sources
2015-06-04remove JSON Spirit UniValue wrapperJonas Schnelli
2015-06-04extend conversion to UniValueJonas Schnelli
2015-06-04Convert tree to using univalue. Eliminate all json_spirit uses.Jeff Garzik
2015-05-15Consensus: MOVEONLY: Move CValidationState from main consensus/validationjtimon