Commit graph

117 commits

Author SHA1 Message Date
Ross Nicoll bc8cca4896 Merge AuxPoW support from Namecore
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.
2018-09-19 19:22:45 +01:00
Warren Togami b506efbe74 Litecoin: Scrypt n=1024 Pow hash based upon Colin Percival's Tarnsnap (2009) Modified by Artforz, coblee, pooler, wtogami, Nikolay Belikov, Adrian Gallagher 2018-09-19 19:21:49 +01:00
Ross Nicoll 8c0468c2d2 Add Dogecoin block subsidy calculations. 2018-09-19 19:21:49 +01:00
Luke Dashjr 1b864c9820 Merge #9497 via remote-tracking branch 'origin-pull/9497/head' into 0.14.2_fixes 2017-06-05 22:58:00 +00:00
Jeremy Rubin 96c7f2c345 Add CheckQueue Tests 2017-02-16 01:37:53 -05:00
MarcoFalke 02e5308c1b
Merge #9525: test: Include tx data in EXTRA_DIST
fa29736 test: Include tx data in EXTRA_DIST (MarcoFalke)
2017-01-12 13:41:32 +01:00
MarcoFalke fa2973678e test: Include tx data in EXTRA_DIST 2017-01-12 13:13:07 +01:00
Wladimir J. van der Laan cfe41d7a60
Merge #9387: [Refactor] RAII of libevent stuff using unique ptrs with deleters
05a55a6 Added EVENT_CFLAGS to test makefile to explicitly include libevent headers. (Karl-Johan Alm)
280a559 Added some simple tests for the RAII-style events. (Karl-Johan Alm)
7f7f102 Switched bitcoin-cli.cpp to use RAII unique pointers with deleters. (Karl-Johan Alm)
e5534d2 Added std::unique_ptr<> wrappers with deleters for libevent modules. (Karl-Johan Alm)
2017-01-05 11:11:17 +01:00
Karl-Johan Alm 05a55a639b Added EVENT_CFLAGS to test makefile to explicitly include libevent headers. 2017-01-04 18:16:55 +09:00
MarcoFalke fa558be2c1 test: Include tx data in EXTRA_DIST 2016-12-27 19:16:17 +01:00
Wladimir J. van der Laan 8dfe9fcb90
Merge #9376: Remove unused test files and references
9cb6624 Fix testfile reference (BtcDrak)
23208ac Remove unused test files and references (BtcDrak)
2016-12-21 09:26:11 +01:00
Karl-Johan Alm 280a5599eb Added some simple tests for the RAII-style events. 2016-12-21 16:49:21 +09:00
BtcDrak 9cb66248dc
Fix testfile reference 2016-12-20 19:49:02 +00:00
BtcDrak 23208ac81b
Remove unused test files and references 2016-12-19 07:43:12 +00:00
Karl-Johan Alm 815f4148b2 Uses built-in byte swap if available (Apple) and if bswap_XX is undefined.
Defers to pre-defined version if found (e.g. protobuf). For protobuf case, the definitions are identical and thus include order should not affect results.
2016-12-17 12:27:00 +09:00
Wladimir J. van der Laan 5bc209c73f
Merge #9172: Resurrect pstratem's "Simple fuzzing framework"
8b15434 doc: Add bare-bones documentation for fuzzing (Wladimir J. van der Laan)
a4153e2 Simple fuzzing framework (Patrick Strateman)
2016-12-15 16:57:06 +01:00
Patrick Strateman a4153e20ec Simple fuzzing framework 2016-12-15 13:29:03 +01:00
Pieter Wuille b83264d9c7
Merge #8895: Better SigCache Implementation
67dac4e Add unit tests for the CuckooCache (Jeremy Rubin)
c9e69fb Add CuckooCache implementation and replace the sigcache map_type with it (Jeremy Rubin)
2016-12-14 18:14:02 -08:00
Jeremy Rubin 67dac4e193 Add unit tests for the CuckooCache
SQUASHME: Update Tests for other SQUASHMEs
2016-12-14 16:02:22 -05:00
Luke Dashjr b74ff5cf0c Bugfix: Correctly replace generated headers and fail cleanly
Also removes generation of headers for *.raw files in test_bitcoin (none exist anymore)
2016-11-12 07:16:28 +00:00
MarcoFalke fa8278e845 test: Fix test_random includes 2016-11-07 16:11:51 +01:00
Gregory Maxwell 2082b5574c Remove GetTotalBlocksEstimate and checkpoint tests that test nothing.
GetTotalBlocksEstimate is no longer used and it was the only thing
 the checkpoint tests were testing.

Since checkpoints are on their way out it makes more sense to remove
 the test file than to cook up a new pointless test.
2016-11-02 01:49:45 +00:00
Luke Dashjr f4dffdd6bf Add MIT license to Makefiles 2016-09-21 22:35:12 +00:00
Patrick Strateman 9578333ec4 Remove rpc_wallet_tests.cpp 2016-08-07 19:30:20 -07:00
Wladimir J. van der Laan 042c323922
Merge #8275: Remove bad chain alert partition check
ab8be98 Remove bad chain alert partition check (BtcDrak)
2016-07-06 07:35:54 +02:00
Matt Corallo e3b2222144 Add some blockencodings tests 2016-06-19 01:34:57 -07:00
BtcDrak ab8be98fdb Remove bad chain alert partition check
As per meeting 2016-03-31
https://bitcoincore.org/en/meetings/2016/03/31/#bad-chain-alerts

The partition checker was producing huge number of false-positives
and was disabled in 0.12.1 on the understanding it would either be
fixed in 0.13 or removed entirely from master if not.
2016-06-14 12:26:59 +01:00
Wladimir J. van der Laan fde0ac403c
Merge #8133: build: Finish up out-of-tree changes
d1a3d57 bulid: fix "make translate" when out-of-tree (Cory Fields)
340012d build: add temporary fix for "bad magic number" error in out-of-tree builds (Cory Fields)
142ffc7 travis: use out-of-tree build (Cory Fields)
92e37a3 build: fix out-of-tree 'make deploy' for osx (Cory Fields)
ab95d5d build: a few ugly hacks to get the rpc tests working out-of-tree (Cory Fields)
fc4ad0c build: more out-of-tree fixups (Cory Fields)
0cb0f26 build: out-of-tree fixups (Cory Fields)
2016-06-10 10:05:57 +02:00
Jonas Schnelli 86efa30ae3
[Bitcoin-Tx] fix missing test fixtures, fix 32bit atoi issue 2016-06-07 21:07:47 +02:00
Cory Fields 340012d9c9 build: add temporary fix for "bad magic number" error in out-of-tree builds
This was caused by an pyc files hanging around from previous
python2 invocations, when the matching .py missing from that path.

This should not be a problem with python3's tagged caches.
2016-06-03 14:48:21 -04:00
Pieter Wuille b89ef13114
Merge #7689: Replace OpenSSL AES with ctaes-based version
723779c build: Enumerate ctaes rather than globbing (Cory Fields)
34ed64a crypter: add tests for crypter (Cory Fields)
0a36b9a crypter: shuffle Makefile so that crypto can be used by the wallet (Cory Fields)
976f9ec crypter: add a BytesToKey clone to replace the use of openssl (Cory Fields)
9049cde crypter: hook up the new aes cbc classes (Cory Fields)
fb96831 crypter: constify encrypt/decrypt (Cory Fields)
1c391a5 crypter: fix the stored initialization vector size (Cory Fields)
daa3841 crypto: add aes cbc tests (Cory Fields)
27a212d crypto: add AES 128/256 CBC classes (Cory Fields)
6bec172 Add ctaes-based constant time AES implementation (Pieter Wuille)
a545127 Squashed 'src/crypto/ctaes/' content from commit cd3c3ac (Pieter Wuille)
2016-06-01 18:22:34 +02:00
Pieter Wuille 5c3f8ddcaa
Merge #7696: Fix de-serialization bug where AddrMan is left corrupted
1475ecf Fix de-serialization bug where AddrMan is corrupted after exception * CAddrDB modified so that when de-serialization code throws an exception Addrman is reset to a clean state * CAddrDB modified to make unit tests possible * Regression test created to ensure bug is fixed * StartNode modifed to clear adrman if CAddrDB::Read returns an error code. (EthanHeilman)
2016-05-17 10:53:00 +02:00
Cory Fields 34ed64a404 crypter: add tests for crypter
Verify that results correct (match known values), consistent (encrypt->decrypt
matches the original), and compatible with the previous openssl implementation.

Also check that failed encrypts/decrypts fail the exact same way as openssl.
2016-05-13 10:23:04 +02:00
EthanHeilman 1475ecf611 Fix de-serialization bug where AddrMan is corrupted after exception
* CAddrDB modified so that when de-serialization code throws an exception Addrman is reset to a clean state
* CAddrDB modified to make unit tests possible
* Regression test created to ensure bug is fixed
* StartNode modifed to clear adrman if CAddrDB::Read returns an error code.
2016-05-04 18:55:01 -04:00
Wladimir J. van der Laan f4eae2d910 test: Create test fixture for wallet
Removes all the `#ifdef ENABLE_WALLET` from `test_bitcoin` by
making the wallet tests use their own fixture.
2016-04-18 14:57:42 +02:00
Wladimir J. van der Laan de39c95c24 test: move accounting_tests and rpc_wallet_tests to wallet/test
Move the two other wallet tests to where they belong.
2016-04-18 14:04:40 +02:00
Pieter Wuille dde46d3ae1 Merge script_valid and script_invalid tests 2016-04-05 16:11:47 +02:00
Wladimir J. van der Laan 5131005e5b
Merge #7723: build: python 3 compatibility
18f05c7 build: python 3 compatibility (Wladimir J. van der Laan)
2016-03-29 17:22:46 +02:00
Wladimir J. van der Laan 18f05c765c build: python 3 compatibility
Ubuntu 16.04 "xenial xerus" does not come with Python 2.x by default.
It is possible to install a python-2.7 package, but this has its own
problem: no `python` or `python2` symlink (see #7717).

This fixes the following scripts to work with python 3:
- `make check` (bctest,py, bitcoin-util-test.py)
- `make translate` (extract_strings_qt.py)
- `make symbols-check` (symbol-check.py)
- `make security-check` (security-check.py)

Explicitly call the python commands using $(PYTHON) instead
of relying on the interpreter line at the top of the scripts.
2016-03-29 17:20:16 +02:00
Wladimir J. van der Laan 29b2be6ad7
Merge #7692: Remove p2p alert system
cfd519e Add release note documentation (BtcDrak)
6601ce5 protocol.h/cpp: Removes NetMsgType::ALERT (Thomas Kerin)
ad72104 Formatting (BtcDrak)
1b77471 Remove alert keys (BtcDrak)
01fdfef Remove `-alerts` option (BtcDrak)
9206634 Update alert notification and GUI (BtcDrak)
bbb9d1d Remove p2p alert handling (BtcDrak)
2016-03-21 13:41:05 +01:00
Wladimir J. van der Laan ddfd79659e
Merge #7705: [amount] Add tests and make GetFee() monotonic
fad13b1 [amount] Preempt issues with negative fee rates (MarcoFalke)
faf756a [amount] Make GetFee() monotonic (MarcoFalke)
fab6880 [qa] Add amount tests (MarcoFalke)
2016-03-21 12:40:31 +01:00
BtcDrak bbb9d1d123 Remove p2p alert handling 2016-03-18 19:33:59 +00:00
MarcoFalke fab6880494 [qa] Add amount tests 2016-03-17 16:59:37 +01:00
Pieter Wuille 732e774c06 Versionbits tests 2016-03-15 16:54:38 +01:00
Mustafa 2fdaa25529 Move GetTempPath() to testutil. 2016-03-11 15:04:05 +00:00
Wladimir J. van der Laan acf5983502 tests: Remove May15 test
This test is no longer relevant.

It was introduced in 8c222dca4f to check
the switch to 1MB blocks after the BDB too-many-locks issue back in
2013. The switching code has been long since removed.

It also needs a specific data file that is hard to find. I've verified
in #6320 that it still passes, however I think there is zero reason to
keep it.

Closes #6320.
2016-02-09 16:23:52 +01:00
Wladimir J. van der Laan 152a8216cc
Merge #7349: Build against system UniValue when available
42407ed build-unix: Update UniValue build conditions (Luke Dashjr)
cdcad9f LDADD dependency order shuffling (Luke Dashjr)
62f7f2e Bugfix: Always include univalue in DIST_SUBDIRS (Luke Dashjr)
2356515 Change default configure option --with-system-univalue to "no" (Luke Dashjr)
5d3b29b doc: Add UniValue to build instructions (Luke Dashjr)
ab22705 Build against system UniValue when available (Luke Dashjr)
2adf7e2 Bugfix: The var is LIBUNIVALUE,not LIBBITCOIN_UNIVALUE (Luke Dashjr)
2016-02-04 17:43:19 +01:00
Wladimir J. van der Laan fd13fe7ca0
Merge #7091: Consensus build package
cf82d05 Build: Consensus: Make libbitcoinconsensus_la_SOURCES fully dynamic and dependend on both crypto and consensus packages (Jorge Timón)
4feadec Build: Libconsensus: Move libconsensus-ready files to the consensus package (Jorge Timón)
a3d5eec Build: Consensus: Move consensus files from common to its own module/package (Jorge Timón)
2016-02-02 19:02:22 +01:00
Luke Dashjr ab22705a7b Build against system UniValue when available 2016-01-15 04:34:06 +00:00
Jorge Timón a3d5eec546 Build: Consensus: Move consensus files from common to its own module/package 2015-12-08 06:30:14 +01:00