aboutsummaryrefslogtreecommitdiff
path: root/src/test
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | Merge pull request #5611Wladimir J. van der Laan2015-01-071-4/+6
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | f0b8afc tests: fix spurious windows test failures after 012598880c (Cory Fields)
| * | | | | tests: fix spurious windows test failures after 012598880cCory Fields2015-01-061-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on rare occasions, rand() was returning duped values, causing duplicate transactions. BuildMerkleTree happily used these, but CPartialMerkleTree caught them and returned a null merkle root. Rather than taking changes with rand(), use the loop counter to guarantee unique values. At sipa's request, also remove the remaining uses of rand().
* | | | | | Merge pull request #5513Wladimir J. van der Laan2015-01-064-22/+9
|\ \ \ \ \ \ | |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | 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-023-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | A few boost::asio were left around because they're very wordy otherwise.
| * | | | | namespace: drop boost::assign altogether hereCory Fields2015-01-021-12/+8
| | | | | | | | | | | | | | | | | | | | | | | | Standard functions are even simpler
* | | | | | Merge pull request #5564Wladimir J. van der Laan2015-01-061-4/+4
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | | | | | | | de236f5 clarify obscure uses of EvalScript() (Pavel Vasin)
| * | | | | clarify obscure uses of EvalScript()Pavel Vasin2014-12-301-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | The 3rd argument of EvalScript() is the unsigned int flags, not a bool.
* | | | | | arith_uint256: remove initialization from byte vectorWladimir J. van der Laan2015-01-051-16/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove initialization from vector (as this is only used in the tests). Also implement SetHex and GetHex in terms of uint256, to avoid duplicate code as well as avoid endianness issues (as they work in term of bytes).
* | | | | | Remove now-unused methods from arith_uint256 and base_uintWladimir J. van der Laan2015-01-051-30/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Methods that access the guts of arith_uint256 are removed, as these are incompatible between endians. Use uint256 instead - Serialization is no longer needed as arith_uint256's are never read or written - GetHash is never used on arith_uint256
* | | | | | Remove arith_uint160Wladimir J. van der Laan2015-01-051-267/+23
| | | | | | | | | | | | | | | | | | | | | | | | We never do 160-bit arithmetic.
* | | | | | Add tests for new uint256Wladimir J. van der Laan2015-01-051-0/+268
| | | | | |
* | | | | | uint256->arith_uint256 blob256->uint256Wladimir J. van der Laan2015-01-051-163/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce new opaque implementation of `uint256`, move old "arithmetic" implementation to `arith_uint256.
* | | | | | Use arith_uint256 where necessaryWladimir J. van der Laan2015-01-052-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | Also add conversion from/to uint256 where needed.
* | | | | | String conversions uint256 -> uint256SWladimir J. van der Laan2015-01-054-34/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* | | | | | Replace uint256(1) with static constantWladimir J. van der Laan2015-01-051-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SignatureHash and its test function SignatureHashOld return uint256(1) as a special error signaling value. Return a local static constant with the same value instead.
* | | | | | Replace direct use of 0 with SetNull and IsNullWladimir J. van der Laan2015-01-053-5/+5
| |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | Replace x=0 with .SetNull(), x==0 with IsNull(), x!=0 with !IsNull(). Replace uses of uint256(0) with uint256().
* | | | | Merge pull request #5349Wladimir J. van der Laan2015-01-021-0/+11
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | 0125988 Implement test for merkle tree malleability in CPartialMerkleTree (Pieter Wuille)
| * | | | | Implement test for merkle tree malleability in CPartialMerkleTreePieter Wuille2014-12-111-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a check that is mentioned in BIP 37, but never implemented in the reference code. As Bitcoin Core so far never decodes partial merkle trees, this is not a problem. But perhaps others use the code as a reference.
* | | | | | Remove redundant copyright notices from README filesWladimir J. van der Laan2015-01-021-5/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The normative place for these for the entire project is COPYING, and the main README already has a MIT license section.
* | | | | | Merge #5528 fromJeff Garzik2014-12-312-0/+11
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | | | | | | | branch 'bitcoin-tx-copy-paste' of git://github.com/ers35/bitcoin into merge-5528
| * | | | | bitcoin-tx: Add test case for signing a txEric R. Schulz2014-12-242-0/+11
| | | | | |
* | | | | | Adding RPC tests for the following wallet related calls: getbalance,Everett Forth2014-12-231-1/+36
|/ / / / / | | | | | | | | | | | | | | | | | | | | listsinceblock, listtransactions, listlockunspent, listaccounts listaddressgroupings
* | | | | Added "Core" to copyright headerssandakersmann2014-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Github-Pull: #5494 Rebased-From: 15de949bb9277e442302bdd8dee299a8d6deee60
* | | | | Merge pull request #5470Wladimir J. van der Laan2014-12-1941-41/+41
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | 78253fc Remove references to X11 licence (Michael Ford)
| * | | | | Remove references to X11 licenceMichael Ford2014-12-1641-41/+41
| | | | | |
* | | | | | Merge pull request #5421Wladimir J. van der Laan2014-12-192-0/+21
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | cac15be Test unexecuted OP_CODESEPARATOR (Peter Todd)
| * | | | | | Test unexecuted OP_CODESEPARATORPeter Todd2014-12-042-0/+21
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OP_CODESEPARATOR is an actual executed instruction, not a declarative thing, so if it's wrapped in an OP_IF it can be turned off. Using this to implement Rivest's Paywords is left as an exercise for the reader.
* | | | | | make all catch() arguments constPhilip Kaufmann2014-12-172-3/+2
| |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | - I saw this on http://en.cppreference.com/w/cpp/language/try_catch and thought it would be a good idea - also unify used format to better be able to search for exception uses in our codebase
* | | | | minor fix on script test data docsManuel Araoz2014-12-162-2/+2
| |/ / / |/| | |
* | | | Merge pull request #5409Wladimir J. van der Laan2014-12-092-31/+23
|\ \ \ \ | | | | | | | | | | | | | | | 65b0328 newlines in strings are invalid JSON (Ryan X. Charles)
| * | | | newlines in strings are invalid JSONRyan X. Charles2014-12-022-31/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although script_valid.json and script_invalid.json are loaded correctly by the JSON interpreter used by bitcoin core, these same files are often used by other libraries and do not necessarily load correctly due to the fact that newlines contained inside strings are not valid and must instead use the escape character \n. The files tx_valid.json and tx_invalid.json handle this correctly, so I've changed the formatting in script_valid.json and script_invalid.json to mirror those files.
* | | | | Add a new test for FormatParagraph (string longer than the default width).Pavel Janík2014-12-061-0/+1
| | | | |
* | | | | Move CMerkleBlock and CPartialMerkleTree to their own fileMatt Corallo2014-12-052-2/+6
| | | | |
* | | | | MOVEONLY: core/ -> primitives/Luke Dashjr2014-12-032-2/+2
|/ / / /
* | | | Move CHECKMULTISIG order tests out of automatically generated blockPieter Wuille2014-12-012-43/+42
| | | |
* | | | Use deterministically generated script testsPieter Wuille2014-12-013-76/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that signing is deterministic, we can require exact correspondence between the automatically generated tests and the ones read from JSON. Do this, and update the tests to those deterministic versions. Note that some flag changes weren't correctly applied before.
* | | | Merge pull request #5227Wladimir J. van der Laan2014-12-013-2/+107
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | 4cdaa95 Resize after succesful result (Pieter Wuille) 9d8604f Header define style cleanups (Pieter Wuille) a53fd41 Deterministic signing (Pieter Wuille) 3060e36 Add the RFC6979 PRNG (Pieter Wuille) a8f5087 Add HMAC-SHA256 (Pieter Wuille) 36fa4a7 Split up crypto/sha2 (Pieter Wuille)
| * | | Deterministic signingPieter Wuille2014-11-202-1/+25
| | | |
| * | | Add the RFC6979 PRNGPieter Wuille2014-11-201-0/+36
| | | |
| * | | Add HMAC-SHA256Pieter Wuille2014-11-201-0/+43
| | | |
| * | | Split up crypto/sha2Pieter Wuille2014-11-201-1/+3
| | | |
* | | | Merge pull request #1816Wladimir J. van der Laan2014-11-241-0/+2
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b867e40 CreateNewBlock: Stick height in coinbase so we pass template sanity check (Luke Dashjr) 60755db submitblock: Check for duplicate submissions explicitly (Luke Dashjr) bc6cb41 QA RPC tests: Add tests block block proposals (Luke Dashjr) 9765a50 Implement BIP 23 Block Proposal (Luke Dashjr) 3dcbb9b Abstract DecodeHexBlk and BIP22ValidationResult functions out of submitblock (Luke Dashjr) 132ea9b miner_tests: Disable checkpoints so they don't fail the subsidy-change test (Luke Dashjr) df08a62 TestBlockValidity function for CBlock proposals (used by CreateNewBlock) (Luke Dashjr) 4ea1be7 CreateNewBlock and miner_tests: Also check generated template is valid by CheckBlockHeader, ContextualCheckBlockHeader, CheckBlock, and ContextualCheckBlock (Luke Dashjr) a48f2d6 Abstract context-dependent block checking from acceptance (Luke Dashjr)
| * | | | miner_tests: Disable checkpoints so they don't fail the subsidy-change testLuke Dashjr2014-11-181-0/+2
| | | | |
* | | | | Add sanity check after key generationPieter Wuille2014-11-231-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a sanity check to prevent cosmic rays from flipping a bit in the generated public key, or bugs in the elliptic curve code. This is simply done by signing a (randomized) message, and verifying the result.
* | | | | Test the exact order of CHECKMULTISIG sig/pubkey evaluationPeter Todd2014-11-202-0/+44
| | | | | | | | | | | | | | | | | | | | Possible with STRICTENC
* | | | | Make STRICTENC invalid pubkeys fail the script rather than the opcode.Pieter Wuille2014-11-203-15/+42
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | This turns STRICTENC turn into a softforking-safe change (even though it is not intended as a consensus rule), and as a result guarantee that using it for mempool validation only results in consensus-valid transactions in the mempool.
* | | | Merge pull request #5000Pieter Wuille2014-11-203-1/+24
|\ \ \ \ | | | | | | | | | | | | | | | 0391423 Discourage NOPs reserved for soft-fork upgrades (Peter Todd)
| * | | | Discourage NOPs reserved for soft-fork upgradesPeter Todd2014-11-173-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | build: add quick consensus lib testsCory Fields2014-11-191-1/+12
| | | | | | | | | | | | | | | | | | | | They should be hooked up in other places as well, but this is a start.
* | | | | Do not use EC code in global constructorsPieter Wuille2014-11-181-1/+2
|/ / / /