aboutsummaryrefslogtreecommitdiff
path: root/src/test/test_bitcoin.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge AuxPoW support from NamecoreRoss Nicoll2019-07-131-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes are as below: Wrap CBlockHeader::nVersion into a new class (CBlockVersion). This allows to take care of interpreting the field into a base version, auxpow flag and the chain ID. Update getauxblock.py for new 'generate' RPC call. Add 'auxpow' to block JSON. Accept auxpow as PoW verification. Add unit tests for auxpow verification. Add check for memory-layout of CBlockVersion. Weaken auxpow chain ID checks for the testnet. Allow Params() to overrule when to check the auxpow chain ID and for legacy blocks. Use this to disable the checks on testnet. Introduce CPureBlockHeader. Split the block header part that is used by auxpow and the "real" block header (that uses auxpow) to resolve the cyclic dependency between the two. Differentiate between uint256 and arith_uint256. This change was done upstream, modify the auxpow code. Add missing lock in auxpow_tests. Fix REST header check for auxpow headers. Those can be longer, thus take that into account. Also perform the check actually on an auxpow header. Correctly set the coinbase for getauxblock results. Call IncrementExtraNonce in getauxblock so that the coinbase is actually initialised with the stuff it should be. (BIP30 block height and COINBASE_FLAGS.) Implement getauxblock plus regression test. Turn auxpow test into FIXTURE test. This allows using of the Params() calls. Move CMerkleTx code to auxpow.cpp. Otherwise we get linker errors when building without wallet. Fix rebase with BIP66. Update the code to handle BIP66's nVersion=3. Enforce that auxpow parent blocks have no auxpow block version. This is for compatibility with namecoind. See also https://github.com/namecoin/namecoin/pull/199. Move auxpow-related parameters to Consensus::Params.
* Replace test data with Dogecoin valuesRoss Nicoll2019-04-031-3/+3
| | | | | | | | | | | | | | | | | | | | Replace test data with Dogecoin equivalents in the folowing tests: * base58 * bip32 * keys * miner * pow * wallet Replace RPC and deterministic signatures in unit tests with Dogecoin values. While conventionally I'd use an alternative implementation for these, as RFC 6979 compliant signature generation isn't terribly common, and there's no reason to suspect we've modified this code, I'm going to assert that it's good enough to test that the code doesn't provide different values. Disabled Bitcoin PoW tests, but left code in place to simplify later merges. These are replaced by the Dogecoin PoW tests.
* Update copyright headers to 2018DrahtBot2018-07-271-1/+1
|
* Use common SetDataDir method to create temp directory in tests.winder2018-07-111-1/+5
|
* Add unit tests for signals generated by ProcessNewBlock()Jesse Cohen2018-05-161-0/+3
| | | | | | After a recent bug discovered in callback ordering in MainSignals, this test checks invariants in ordering of BlockConnected / BlockDisconnected / UpdatedChainTip signals
* tests: Avoid copies of CTransactionMarcoFalke2018-04-111-3/+3
|
* Bugfix: Include <memory> for std::unique_ptrLuke Dashjr2018-04-021-0/+2
|
* 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-
* Use unique_ptr for pcoinscatcher/pcoinsdbview/pcoinsTip/pblocktreepracticalswift2017-11-091-1/+0
| | | | | | | | * pcoinscatcher (CCoinsViewErrorCatcher) * pcoinsdbview (CCoinsViewDB) * pcoinsTip (CCoinsViewCache) * pblocktree (CBlockTreeDB) * Remove variables shadowing pcoinsdbview
* Add CConnmanTest to mutate g_connman in testsJoão Barbosa2017-11-021-0/+6
|
* Add tests for CMerkleBlock usage with txids specifiedJames O'Beirne2017-09-201-1/+4
|
* net: use an interface class rather than signals for message processingCory Fields2017-09-061-0/+2
| | | | | Drop boost signals in favor of a stateful class. This will allow the message processing loop to actually move to net_processing in a future step.
* Declare single-argument (non-converting) constructors "explicit"practicalswift2017-08-161-2/+2
| | | | In order to avoid unintended implicit conversions.
* Give CMainSignals a reference to the global schedulerMatt Corallo2017-07-071-0/+2
| | | | ...so that it can run some signals in the background later
* [tests] Remove unused function InsecureRandBytes(size_t len)practicalswift2017-06-081-1/+0
|
* scripted-diff: Use new naming style for insecure_rand* functionsPieter Wuille2017-06-071-7/+7
| | | | | | | | | | | | -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-
* Add various insecure_rand wrappers for testsPieter Wuille2017-06-051-4/+6
|
* Merge test_random.h into test_bitcoin.hPieter Wuille2017-06-051-0/+19
|
* Replace uses of boost::filesystem with fsWladimir J. van der Laan2017-04-031-1/+1
| | | | | | | | | Step two in abstracting away boost::filesystem. To repeat this, simply run: ``` git ls-files \*.cpp \*.h | xargs sed -i 's/boost::filesystem/fs/g' ```
* Replace includes of boost/filesystem.h with fs.hWladimir J. van der Laan2017-04-031-1/+1
| | | | This is step one in abstracting the use of boost::filesystem.
* [test] Remove priority from testsAlex Morcos2017-03-031-6/+3
| | | | Remove all coin age priority functionality from unit tests and RPC tests.
* Remove member variable hadNoDependencies from CTxMemPoolEntryAlex Morcos2017-01-041-3/+1
| | | | Fee estimation can just check its own mapMemPoolTxs to determine the same information. Note that now fee estimation for block processing must happen before those transactions are removed, but this shoudl be a speedup.
* Increment MIT Licence copyright header year on files modified in 2016isle29832016-12-311-1/+1
| | | | | | Edited via: $ contrib/devtools/copyright_header.py update .
* Make CBlock::vtx a vector of shared_ptr<CTransaction>Pieter Wuille2016-11-191-2/+2
|
* net: Create CConnman to encapsulate p2p connectionsCory Fields2016-09-081-0/+2
|
* BIP141: Other consensus critical limits, and BIP145Pieter Wuille2016-06-221-3/+3
| | | | Includes changes by Suhas Daftuar, Luke-jr, and mruddy.
* Add TestMemPoolEntryHelper::FromTx version for CTransactionMatt Corallo2016-06-191-0/+1
|
* test: Create test fixture for walletWladimir J. van der Laan2016-04-181-2/+1
| | | | | Removes all the `#ifdef ENABLE_WALLET` from `test_bitcoin` by making the wallet tests use their own fixture.
* Add LockPointsAlex Morcos2016-03-161-1/+3
| | | | Obtain LockPoints to store in CTxMemPoolEntry and during a reorg, evaluate whether they are still valid and if not, recalculate them.
* Add missing copyright headersMarcoFalke2016-01-051-0/+4
|
* Store the total sig op count of a tx.Alex Morcos2015-12-011-3/+5
| | | | Store sum of legacy and P2SH sig op counts. This is calculated in AcceptToMemory pool and storing it saves redoing the expensive calculation in block template creation.
* Track coinbase spends in CTxMemPoolEntrySuhas Daftuar2015-11-301-1/+3
| | | | This allows us to optimize CTxMemPool::removeForReorg.
* Implement helper class for CTxMemPoolEntry constructorAlex Morcos2015-11-161-0/+25
| | | | This is only for unit tests.
* Switch to libsecp256k1-based validation for ECDSAPieter Wuille2015-11-151-0/+3
|
* Chainparams: Replace CBaseChainParams::Network enum with string constants ↵Jorge Timón2015-10-201-2/+2
| | | | (suggested by Wladimir)
* Unit test doublespends in new blocksGavin Andresen2015-07-271-2/+26
| | | | | | | As suggested by Greg Maxwell-- unit test to make sure a block with a double-spend in it doesn't pass validation if half of the double-spend is already in the memory pool (so full-blown transaction validation is skipped) when the block is received.
* tests: add a BasicTestingSetup and apply to all testsWladimir J. van der Laan2015-03-121-1/+13
| | | | | | | | 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.
* Reinitialize state in between individual unit tests.Pieter Wuille2015-03-031-0/+18
This changes the TestingSetup fixture to be per-unit-test rather than global. Most tests don't need it, so it's only invoked in a few.