Commit Graph

357 Commits

Author SHA1 Message Date
TomZ e0b3a14daa Import unit tests 2018-11-08 10:53:16 +01:00
TomZ 7b76d177e8 Remove chain obfuscation misfeature. 2018-11-02 20:42:45 +01:00
TomZ d8dfec2c26 Make test a bit more stable 2018-10-22 13:08:35 +02:00
TomZ e50384f421 Make invalidateblock work a bit better 2018-10-22 00:08:11 +02:00
TomZ 90f635e8ec Add a test for a cornercase of appendHeader and fix it. 2018-10-21 20:38:34 +02:00
TomZ fdd693541e Make the UTXO have some limits "configurable"
This change makes the limits be static variables, which means they are
only settable once for a process. The only usecase so far is to use much
smaller limits in testing situations.
2018-10-21 13:21:24 +02:00
TomZ 82d2651d4f Fix copy/paste error and add some more sanity checks
Also fix insert() usage in unit test to not hit that new assert
2018-10-13 21:33:17 +02:00
TomZ 6b20196529 Fix regression in py tests, caches work again 2018-10-12 23:13:42 +02:00
TomZ 5e91b276d3 Fix off-by one that made unit tests fail on 1-core dockers. 2018-10-11 21:45:40 +02:00
TomZ ab08bfa914 Fixlets in unit test setup 2018-10-11 17:36:36 +02:00
TomZ 91f9c5128a Make sure we specify type to avoid regressions 2018-10-11 16:27:04 +02:00
TomZ 145a67cd92 Update rpc tests to flowee changes 2018-10-11 16:26:50 +02:00
TomZ ef89fbc2ef Follow change in parsing of -regtest
Flowee changed in that regtest has to be given on the commandline
allowing different config files for different chains.
So pass the regtest on the commandline.
2018-10-11 16:26:42 +02:00
TomZ 1b8c1a586f Allow API server to be disabled via option 2018-10-11 16:26:36 +02:00
TomZ be1c403586 port unit test and add benchmark 2018-10-08 22:30:21 +02:00
TomZ a2928b91eb Simplify
On all mature operating systems and filesystems creation of a 1GB file
will not actually use that data, only when we start using blocks does
the disk space get used.
As such this is a premature optimization that Core added and I ported to
Flowee which this commit removes.

Additionally, increase the block file size to 1GiB
2018-10-05 20:49:44 +02:00
TomZ 9aec9e5eeb Merge branch 'master' into UnspentOutputDB 2018-09-24 21:25:34 +02:00
TomZ eb725209e1 Make the doublespend unit test more stable. 2018-09-24 21:23:27 +02:00
TomZ 13c2a64f56 Identify another usecase of utxo rollback and fix
Including unit test
2018-09-20 21:55:07 +02:00
TomZ 4a52fd62ca Add test for duplicate inputs.
This failed on Bitcoin Core (with a crash), best way to show we don't
crash is to write a passing unit test.
2018-09-19 21:39:13 +02:00
TomZ 523bf6d694 Fix and test merge conflicts 2018-08-15 20:38:28 +02:00
TomZ 82a670787e Merge branch 'master' into UnspentOutputDB
Conflicts:
	testing/prevector/test_prevector.cpp
	testing/test/test_bitcoin.cpp
	testing/utxo/test_utxo.cpp
2018-08-15 20:30:45 +02:00
Tom Zander 69e7cd89f8 Merge branch 'master' into 'master'
Add CuckooCache

See merge request FloweeTheHub/thehub!6
2018-08-15 18:22:22 +00:00
TomZ 9117309f6d Add 'make check' target 2018-08-14 22:44:00 +02:00
TomZ 7df238b281 Refactor tests a little
Duplicate the test_bitcoin file into the common dir,
I hope to remove the original in future.
Make the common dir a new static lib and create a new
qtestlib based unit test out of the old doublespend unit test.
2018-08-14 22:44:00 +02:00
TomZ a982b6b3b4 Avoid duplication 2018-08-14 17:00:29 +02:00
TomZ 98d58df63d Move utxo tests over to be qtestlib too 2018-08-14 15:53:00 +02:00
TomZ c182d809fb Make logging now be tuned for qtestlib
as the boost testlib is too erretic and gives us bugs, make the common
framework support qtestlib instead
2018-08-14 15:53:00 +02:00
TomZ ce63d5165f Move prevector to its own test since its slow (16s) 2018-08-14 15:53:00 +02:00
DesWurstes 20ea0c1156 Add tests
https://github.com/bitcoin/bitcoin/pull/9480 and https://github.com/bitcoin/bitcoin/pull/10128 but doesn't have the newest tests
2018-08-11 12:57:33 +03:00
DesWurstes f61e8f698e Add CuckooCache
100% of code from https://github.com/bitcoin/bitcoin/pull/8895/commits/c9e69fb
2018-08-10 11:05:22 +03:00
TomZ d58352080e Add another UODB rollback unit test and fix 2018-08-04 17:28:08 +02:00
TomZ 0bfa3cbb85 Introduce rollback() on UnspentOutputDB
together with blockFinished() as 'commit' this introduces the ability
to modify the in-memory utxo which can be rolled-back with ease.

This allows us to "modify" the utxo while validating a block in an
optimistic manner and only spend extra resources doing a rollback
should the block end up not being Ok.
2018-07-29 18:03:49 +02:00
TomZ 1600086ede Updates to and start using the UnspentOutputDB
The new UnspentOutputDatabase classes are only very loosly a database, we
purely register and store unspent outputs there. But unline a DB we don't
allow modification (just insert and delete).

This replaces the coin-db (which was based on leveldb) and as first goal
this gives us a higher level of stability. The level-database was known
to give corruption issues.

Notice that users will need to do a manual reindex on first update.
2018-07-23 19:49:32 +02:00
TomZ 4fef523fa2 don't run disabled tests 2018-06-28 23:18:08 +02:00
TomZ e13730a042 Make backwards compatible 2018-06-24 13:01:39 +02:00
TomZ 500b16d6e1 Make compile when no wallet is compiled in 2018-06-23 20:38:09 +02:00
TomZ fccad43c16 Remove obsolete '-debug=' style arguments to the unit tests. 2018-06-12 23:26:20 +02:00
TomZ c368c6ef77 Create new UTXO database library
The old was based on levelDB which has scalability issues and stability
issues. (most often cited problem is corrupted database..)

This unspent output database I wrote is based on the idea that we need
never actually update any rows, which makes most old fashioned databases
a bad fit.
All we do is create rows and we forget rows. So lets design a DB to fit
that pattern.
2018-05-09 10:48:16 +02:00
TomZ d1a90340da Add testing decoration to the old tests 2018-05-09 10:48:16 +02:00
TomZ 438f9d4f1b Add generic testing decorator
This integrates unit tests into the logging system
so I can see the unit test we are currently in reflected in the log-
line.
2018-05-09 10:48:16 +02:00
TomZ 47deac575c use test_flowee dir instead of test_bitcoin 2018-05-09 10:31:01 +02:00
TomZ 062ef05a77 May Hardfork; import opcodes changes. 2018-04-16 14:42:35 +02:00
TomZ e87a45b508 May hardfork; datacarrier size max is 220 2018-04-16 11:12:08 +02:00
TomZ 096d5af5b8 Remove old options
Remove no longer useful options;
* chain (sorry, supporting the btc chain just doesn't seem worth it)
* initiatecashconnections, we only allow Cash connections now.
* flexiblehandshake, same for incoming. Reject non-cash ones.
2018-04-15 22:35:34 +02:00
TomZ 8cdd0b78e4 Fix cornercases in integers handing of CMF
The compact-message-format has numberic limits that were not
being managed well.

This unit test makes sure we keep the limits at;

Negative number is 0x7FFFFFFF (aka INT_MIN)
Positive number max is 0xFFFFFFFFFFFFFFFF (aka ULONG_LONG_MAX)

The inconsistent limits is because the API. We use ints for negative
numbers and unsigned-longs for larger numbers.
This keeps the API simpler for the common cases.
2018-04-04 17:27:16 +02:00
TomZ 3cdc7acf17 Detect and notify listeners on douple spend 2018-03-25 18:38:51 +02:00
TomZ b3ce448221 Minor update; show more detail when needed. 2018-03-23 18:31:00 +01:00
TomZ b04096f8dc [blackbox-tests] Follow updates in the client. 2018-03-12 22:03:37 +01:00
TomZ 33fe0fccb5 Cleanup ValidationInterface
Get rid of the weird boost signals setup
Move it to a new library 'interfaces' which is
for stuff that has no dependencies and can avoid
creating inter-library or cicular dependencies.
2018-02-16 12:37:13 +01:00