aboutsummaryrefslogtreecommitdiff
path: root/src/test/pmt_tests.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright headers to 2018DrahtBot2018-07-271-1/+1
|
* Increment MIT Licence copyright header year on files modified in 2017Akira Takizawa2018-01-031-1/+1
|
* scripted-diff: Replace #include "" with #include <> (ryanofsky)MeshCollider2017-11-161-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -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-
* Merge #10545: Use list initialization (C++11) for maps/vectors instead of ↵Wladimir J. van der Laan2017-06-081-9/+9
|\ | | | | | | | | | | | | | | boost::assign::map_list_of/list_of 3fb81a8 Use list initialization (C++11) for maps/vectors instead of boost::assign::map_list_of/list_of (practicalswift) Tree-SHA512: 63a9ac9ec5799472943dce1cd92a4b14e7f1fe12758a5fc4b1efceaf2c85a4ba71dad5ccc50813527f18b192e7714c076e2478ecd6ca0d452b24e88416f872f7
| * Use list initialization (C++11) for maps/vectors instead of ↵practicalswift2017-06-061-9/+9
| | | | | | | | boost::assign::map_list_of/list_of
* | scripted-diff: Use new naming style for insecure_rand* functionsPieter Wuille2017-06-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- sed -i 's/\<insecure_randbits(/InsecureRandBits(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_randbool(/InsecureRandBool(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_randrange(/InsecureRandRange(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_randbytes(/InsecureRandBytes(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_rand256(/InsecureRand256(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<insecure_rand(/InsecureRand32(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp sed -i 's/\<seed_insecure_rand(/SeedInsecureRand(/g' src/test/*.cpp src/test/*.h src/wallet/test/*.cpp -END VERIFY SCRIPT-
* | scripted-diff: Use randbits/bool instead of randrange where possiblePieter Wuille2017-06-071-1/+1
| | | | | | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- sed -i 's/insecure_randbits(1)/insecure_randbool()/g' src/test/*_tests.cpp sed -i 's/insecure_randrange(2)/insecure_randbool()/g' src/test/*_tests.cpp sed -i 's/insecure_randrange(4)/insecure_randbits(2)/g' src/test/*_tests.cpp sed -i 's/insecure_randrange(32)/insecure_randbits(5)/g' src/test/*_tests.cpp sed -i 's/insecure_randrange(256)/insecure_randbits(8)/g' src/test/*_tests.cpp -END VERIFY SCRIPT-
* | Replace rand() & ((1 << N) - 1) with randbits(N)Pieter Wuille2017-06-071-1/+1
| |
* | Replace more rand() % NUM by randrangesPieter Wuille2017-06-071-1/+1
| |
* | scripted-diff: use insecure_rand256/randrange morePieter Wuille2017-06-051-1/+1
| | | | | | | | | | | | | | | | -BEGIN VERIFY SCRIPT- sed -i "s/\<GetRandHash(/insecure_rand256(/" src/test/*_tests.cpp sed -i "s/\<GetRand(/insecure_randrange(/" src/test/*_tests.cpp src/test/test_bitcoin.cpp sed -i 's/\<insecure_rand() % \([0-9]\+\)/insecure_randrange(\1)/g' src/test/*_tests.cpp -END VERIFY SCRIPT-
* | Merge test_random.h into test_bitcoin.hPieter Wuille2017-06-051-1/+0
|/
* Merge #9281: Refactor: Remove using namespace <xxx> from bench/ & test/ sourcesMarcoFalke2017-01-051-2/+0
|\ | | | | | | 73f4119 Refactoring: Removed using namespace <xxx> from bench/ and test/ source files. (Karl-Johan Alm)
| * Refactoring: Removed using namespace <xxx> from bench/ and test/ source files.Karl-Johan Alm2017-01-021-2/+0
| |
* | Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
|/ | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* Introduce convenience type CTransactionRefPieter Wuille2016-11-191-1/+1
|
* Make CBlock::vtx a vector of shared_ptr<CTransaction>Pieter Wuille2016-11-191-2/+2
|
* test: Fix test_random includesMarcoFalke2016-11-071-1/+1
|
* Kill insecure_random and associated global stateWladimir J. van der Laan2016-10-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are only a few uses of `insecure_random` outside the tests. This PR replaces uses of insecure_random (and its accompanying global state) in the core code with an FastRandomContext that is automatically seeded on creation. This is meant to be used for inner loops. The FastRandomContext can be in the outer scope, or the class itself, then rand32() is used inside the loop. Useful e.g. for pushing addresses in CNode or the fee rounding, or randomization for coin selection. As a context is created per purpose, thus it gets rid of cross-thread unprotected shared usage of a single set of globals, this should also get rid of the potential race conditions. - I'd say TxMempool::check is not called enough to warrant using a special fast random context, this is switched to GetRand() (open for discussion...) - The use of `insecure_rand` in ConnectThroughProxy has been replaced by an atomic integer counter. The only goal here is to have a different credentials pair for each connection to go on a different Tor circuit, it does not need to be random nor unpredictable. - To avoid having a FastRandomContext on every CNode, the context is passed into PushAddress as appropriate. There remains an insecure_random for test usage in `test_random.h`.
* [test] Remove unused codeMarcoFalke2016-08-241-1/+0
|
* Do not shadow local variablesPavel Janík2016-06-071-2/+2
|
* Add importprunedfunds rpc callinstagibbs2016-03-231-3/+5
|
* Bump copyright headers to 2015MarcoFalke2015-12-131-1/+1
|
* Switch blocks to a constant-space Merkle root/branch algorithm.Pieter Wuille2015-11-271-1/+2
| | | | | | | | | | | This switches the Merkle tree logic for blocks to one that runs in constant (small) space. The old code is moved to tests, and a new test is added that for various combinations of block sizes, transaction positions to compute a branch for, and mutations: * Verifies that the old code and new code agree for the Merkle root. * Verifies that the old code and new code agree for the Merkle branch. * Verifies that the computed Merkle branch is valid. * Verifies that mutations don't change the Merkle root. * Verifies that mutations are correctly detected.
* Do not store Merkle branches in the wallet.Pieter Wuille2015-09-221-1/+1
| | | | | | | | | | Assume that when a wallet transaction has a valid block hash and transaction position in it, the transaction is actually there. We're already trusting wallet data in a much more fundamental way anyway. To prevent backward compatibility issues, a new record is used for storing the block locator in the wallet. Old wallets will see a wallet file synchronized up to the genesis block, and rescan automatically.
* 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.
* 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().
* Use arith_uint256 where necessaryWladimir J. van der Laan2015-01-051-3/+9
| | | | Also add conversion from/to uint256 where needed.
* Replace direct use of 0 with SetNull and IsNullWladimir J. van der Laan2015-01-051-3/+3
| | | | | | 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 references to X11 licenceMichael Ford2014-12-161-1/+1
|/
* Move CMerkleBlock and CPartialMerkleTree to their own fileMatt Corallo2014-12-051-1/+3
|
* Add CMutableTransaction and make CTransaction immutable.Pieter Wuille2014-06-211-2/+2
| | | | | In addition, introduce a cached hash inside CTransaction, to prevent recalculating it over and over again.
* 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
* Cleanup code using forward declarations.Brandon Dahler2013-11-101-2/+7
| | | | | | | | | 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.
* Add CPartialMerkleTreePieter Wuille2013-01-161-0/+98
This adds a compact representation for a subset of a merkle tree's nodes.