aboutsummaryrefslogtreecommitdiff
path: root/src/test/transaction_tests.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [trivial] New DEFAULT_MIN_RELAY_TX_FEE = 1000MarcoFalke2015-11-091-1/+1
|
* transaction_tests: Be more strict checking dustMarcoFalke2015-11-091-2/+17
| | | | | | * Don't allow off-by-one or more * Make clear dust is coupled with minRelayTxFee * Check rounding for odd values
* tests: update transaction_tests for new dust thresholdWladimir J. van der Laan2015-10-101-1/+1
|
* Accept any sequence of PUSHDATAs in OP_RETURN outputsPeter Todd2015-10-011-2/+19
| | | | | | | | | | | | 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!)
* [Univalue] add univalue over subtreeJonas Schnelli2015-10-011-1/+1
| | | | similar to secp256k1 include and compile univalue over a subtree
* Includes: Cleanup around net main and walletJorge Timón2015-07-231-1/+1
| | | | | | -Move from .h to .cpp: in main, net and wallet -Remove unnecessary #include "main.h" -Cleanup some wallet files includes
* TRIVIAL: Missing includesJorge Timón2015-07-231-0/+1
|
* Policy: MOVEONLY: 3 functions to policy.o:Luke Dashjr2015-06-261-0/+1
| | | | | | | | - [script/standard.o] IsStandard - [main.o] IsStandardTx - [main.o] AreInputsStandard Also, don't use namespace std in policy.cpp
* Merge pull request #6124Wladimir J. van der Laan2015-06-261-1/+2
|\ | | | | | | | | | | | | 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)
| * Replace NOP2 with CHECKLOCKTIMEVERIFY (BIP65)Peter Todd2015-06-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | <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.
* | Remove JSON Spirit wrapper, remove JSON Spirit leftoversJonas Schnelli2015-06-041-20/+3
| | | | | | | | | | | | - 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-041-9/+9
| |
* | extend conversion to UniValueJonas Schnelli2015-06-041-0/+1
| |
* | Convert tree to using univalue. Eliminate all json_spirit uses.Jeff Garzik2015-06-041-9/+24
| |
* | Consensus: MOVEONLY: Move CValidationState from main consensus/validationjtimon2015-05-151-1/+2
|/
* tests: add a BasicTestingSetup and apply to all testsWladimir J. van der Laan2015-03-121-1/+2
| | | | | | | | Make sure that chainparams and logging is properly initialized. Doing this for every test may be overkill, but this initialization is so simple that that does not matter. This should fix the travis issues.
* Merge pull request #5286Wladimir J. van der Laan2015-02-031-4/+4
|\ | | | | | | | | 44e9a6b Update the 'test_IsStandard' unit test (Flavien Charlon) a930658 Change the default maximum OP_RETURN size to 80 bytes (Flavien Charlon)
| * Update the 'test_IsStandard' unit testFlavien Charlon2014-11-161-4/+4
| | | | | | | | | | The maximum length for the payload of an OP_RETURN output is now 80 bytes, and unit tests must be modified to account for the change.
* | Avoid storing a reference passed to SignatureChecker constructorsPieter Wuille2015-02-021-2/+2
| |
* | Use separate SignatureChecker for CMutableTransactionPieter Wuille2015-02-021-2/+2
| |
* | Merge pull request #5143Wladimir J. van der Laan2015-01-081-1/+2
|\ \ | | | | | | | | | | | | | | | da918ac Make SCRIPT_VERIFY_CLEANSTACK a standardness requirement (Pieter Wuille) b6e03cc Add SCRIPT_VERIFY_CLEANSTACK (BIP62 rule 6) (Pieter Wuille) ae4151b No semantic change: reuse stack variable in P2SH evaluation (Pieter Wuille)
| * | Add SCRIPT_VERIFY_CLEANSTACK (BIP62 rule 6)Pieter Wuille2014-11-251-1/+2
| | | | | | | | | | | | | | | Based on an earlier patch by Peter Todd, though the rules here are different (P2SH scripts should not have a CLEANSTACK check before the P2SH evaluation).
* | | Merge pull request #5513Wladimir J. van der Laan2015-01-061-2/+1
|\ \ \ | | | | | | | | | | | | | | | | | | | | 856e862 namespace: drop most boost namespaces and a few header cleanups (Cory Fields) 9b1ab86 namespace: drop boost::assign altogether here (Cory Fields) a324199 namespace: remove boost namespace pollution (Cory Fields)
| * | | namespace: drop most boost namespaces and a few header cleanupsCory Fields2015-01-021-2/+1
| | | | | | | | | | | | | | | | A few boost::asio were left around because they're very wordy otherwise.
* | | | String conversions uint256 -> uint256SWladimir J. van der Laan2015-01-051-2/+2
|/ / / | | | | | | | | | | | | | | | | | | If uint256() constructor takes a string, uint256(0) will become dangerous when uint256 does not take integers anymore (it will go through std::string(const char*) making a NULL string, and the explicit keyword is no help).
* / / Remove references to X11 licenceMichael Ford2014-12-161-1/+1
|/ /
* | Discourage NOPs reserved for soft-fork upgradesPeter Todd2014-11-171-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NOP1 to NOP10 are reserved for future soft-fork upgrades. In the event of an upgrade such NOPs have *VERIFY behavior, meaning that if their arguments are not correct the script fails. Discouraging these NOPs by rejecting transactions containing them from the mempool ensures that we'll never accept transactions, nor mine blocks, with scripts that are now invalid according to the majority of hashing power even if we're not yet upgraded. Previously this wasn't an issue as the IsStandard() rules didn't allow upgradable NOPs anyway, but 7f3b4e95 relaxed the IsStandard() rules for P2SH redemptions allowing any redeemScript to be spent. We *do* allow upgradable NOPs in scripts so long as they are not executed. This is harmless as there is no opportunity for the script to be invalid post-upgrade.
* | script: check ScriptError values in script testsCory Fields2014-11-141-3/+7
|/
* Separate protocol versioning from clientversionCory Fields2014-10-291-0/+1
|
* Add SCRIPT_VERIFY_MINIMALDATA (BIP62 rules 3 and 4)Pieter Wuille2014-10-251-0/+1
| | | | | Also use the new flag as a standard rule, and replace the IsCanonicalPush standardness check with it (as it is more complete).
* Add SCRIPT_VERIFY_SIGPUSHONLY (BIP62 rule 2)Pieter Wuille2014-10-251-0/+1
|
* script: add ToByteVector() for converting anything with begin/endCory Fields2014-10-171-2/+2
| | | | This should move to a util header once their dependencies are cleaned up.
* Make SCRIPT_VERIFY_STRICTENC compatible with BIP62Pieter Wuille2014-10-081-0/+1
| | | | | | | | * Delete canonical_tests.cpp, and move the tests to script_tests.cpp. * Split off SCRIPT_VERIFY_DERSIG from SCRIPT_VERIFY_STRICTENC (the BIP62 part of it). * Change signature STRICTENC/DERSIG semantics to fail the script entirely rather than the CHECKSIG result (softfork safety, and BIP62 requirement). * Add many autogenerated tests for several odd cases. * Mention specific BIP62 rules in the script verification flags.
* Merge pull request #4834Pieter Wuille2014-10-081-5/+5
|\ | | | | | | | | | | | | | | 7c70438 Get rid of the dummy CCoinsViewCache constructor arg (Pieter Wuille) ed27e53 Add coins_tests with a large randomized CCoinViewCache test. (Pieter Wuille) 058b08c Do not keep fully spent but unwritten CCoins entries cached. (Pieter Wuille) c9d1a81 Get rid of CCoinsView's SetCoins and SetBestBlock. (Pieter Wuille) f28aec0 Use ModifyCoins instead of mutable GetCoins. (Pieter Wuille)
| * Get rid of the dummy CCoinsViewCache constructor argPieter Wuille2014-09-241-2/+2
| |
| * Get rid of CCoinsView's SetCoins and SetBestBlock.Pieter Wuille2014-09-231-3/+3
| | | | | | | | | | | | All direct modifications are now done through ModifyCoins, and BatchWrite is used for pushing batches of queued modifications up, so we don't need the low-level SetCoins and SetBestBlock anymore in the top-level CCoinsView class.
* | Replace SCRIPT_VERIFY_NOCACHE by flag directly to checkerPieter Wuille2014-10-021-3/+2
| |
* | Add automatic script test generation, and actual checksig testsPieter Wuille2014-09-261-12/+30
|/
* Merge pull request #4555Wladimir J. van der Laan2014-09-171-2/+2
|\ | | | | | | | | | | | | 6dcfda2 Don't pass nHashType to EvalScript nor CheckSig (jtimon) 2b23a87 Don't pass nHashType to VerifyScript (jtimon) ce3649fb Remove CScriptCheck::nHashType (was always 0) (jtimon) 358562b Remove unused function main:VerifySignature (jtimon)
| * Don't pass nHashType to VerifyScriptjtimon2014-09-121-2/+2
| |
* | Move CTxDestination from script/script to script/standardPieter Wuille2014-09-161-3/+3
|/
* Make script_{valid,invalid}.json validation flags configurablePieter Wuille2014-09-081-3/+3
|
* Move CScript class and dependencies to script/scriptjtimon2014-09-081-1/+1
|
* Rename script.h/.cpp to scriptutils.h/.cpp (plus remove duplicated includes)jtimon2014-09-081-1/+1
|
* 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.