Commit Graph

358 Commits

Author SHA1 Message Date
tomFlowee 639a57d957 [Refactor] primitives/BlockHeader -> BlockHeaderFields
This avoids a naming conflict with a p2p class BlockHeader.

Notice that the block data structures are mostly still private API, they
are in the utils dir but headers are not installed, nobody has needed
them so far.
2021-11-02 11:05:14 +01:00
tomFlowee 50af3dc02c [Refactor] rename FastBlock.{h|cpp} -> Block.* 2021-11-02 10:24:58 +01:00
tomFlowee 6ff0e7c0de [Refactor] FastBlock -> Block 2021-11-02 10:18:24 +01:00
tomFlowee dce57fd8ea [Refactor] rename block.{h|cpp} -> MutableBlock.* 2021-11-02 10:13:23 +01:00
tomFlowee 406dc46671 [Refactor] move CBlockLocator to libs/server
Its not needed anywhere outside the apps.
2021-11-02 09:59:13 +01:00
tomFlowee 4689cc6a92 [Refactor] CBlock -> MutableBlock 2021-11-02 09:36:09 +01:00
tomFlowee 64d901d760 Refactor; CBlockHeader -> BlockHeader 2021-11-02 09:28:35 +01:00
tomFlowee 851d147dcd Add way to go from seed to mnemonic. 2021-10-27 19:14:09 +02:00
tomFlowee 4252e859e7 Remove obsolete (and untested) code. 2021-10-13 17:06:58 +02:00
tomFlowee c264641cbe Provide hierarchically deterministic wallet parts
This introduces a Mnemonic class for BIP39 (seed words)
validation as well as a HDMasterKey class with provides the
BIP32 & BIP43 support.

All tests went into the apputils unit test.
2021-10-13 17:03:02 +02:00
tomFlowee 919d6ffbc5 Make test less fragile.
This avoids depending on Qt CoW not hitting on returning it.
Also fix open() in release builds.
2021-08-09 21:26:07 +02:00
tomFlowee ae78dd0bb8 Update email address 2021-06-20 22:44:44 +02:00
tomFlowee 460d4be807 Add new method Blockchain::blockHeightAtTime() 2021-05-28 14:52:27 +02:00
tomFlowee d1fa3fa4a9 [P2P] Allow static loading of blockheaders
This adds a unit test for the Blockchain class in the p2p lib and this
introduces the functionality to have a blockchain pre-shipped with an
app.
2021-05-27 19:08:46 +02:00
tomFlowee f9a0050220 Update TransactionBuilder / signature type handling
The choice between Schnorr and ECDSA signatures is now per input instead
of once choice for the entire transaction.
2021-05-04 16:57:55 +02:00
tomFlowee 76fde4a94c Make the test go back to ECDSA style signatures. 2021-04-19 17:07:02 +02:00
tomFlowee c58586516d Allow for longer mock-chains of blocks.
In RegTest we have a much shorter cycle of halving, take this into
account when building blocks.
2021-04-19 17:06:15 +02:00
tomFlowee f163e942a7 Add Schnorr unit tests 2021-04-19 16:28:54 +02:00
tomFlowee 6682a4a5b2 Rename CKey::Sign() -> signECDSA() 2021-04-19 15:45:02 +02:00
tomFlowee fcb648916d Make pubkey follow coding styleguide 2021-04-19 14:48:18 +02:00
tomFlowee 178bdf8b74 Add new unit test
This test tests the new Mining::SubmitBlock feature.
We also test the GetBlock with the new FilterOnScriptType feature.

Some new helper methods in the messageBuilder and FastBlock are also
used and tested.
2021-03-24 21:00:26 +01:00
tomFlowee 0a1f0f8c52 Split 'API' tests into separate executables.
The test starts to become long to run and using the one main.cpp
hack we had removes our ability to select one test to run, so lets
go back to one executable per class.
2021-03-24 19:08:25 +01:00
tomFlowee 9d6ba33cc0 Add and test service to receive all double spend proofs. 2021-03-18 11:07:50 +01:00
tomFlowee d15a89dc99 Avoid duplication 2021-03-17 21:07:25 +01:00
tomFlowee 7406cd6ecf Remove dead code (xor of stream). 2021-03-16 19:34:33 +01:00
tomFlowee 45dd785f39 Follow whole-script sizelimit.
Also add unit test for the op_return limits.
2021-03-13 16:52:04 +01:00
tomFlowee a9d3c2ee92 Support change to allow multiple op_returns 2021-03-13 14:02:38 +01:00
tomFlowee a7fd89c360 Make sure we record the lack of fee info. 2021-03-10 20:11:04 +01:00
tomFlowee 376a4ef9b5 Make block validation create a block metadata object.
This also changes the raw pointers to unique pointers for undo data.
2021-03-10 20:11:04 +01:00
tomFlowee 2395764bde Start new class BlockMetaData 2021-03-10 20:11:04 +01:00
tomFlowee 018a855e03 Avoid confusion.
People all over the Internet, including on the BCH spec, seem confused
about these enum values. They think they are opcodes.
So lets be clear and rename them to the thing they are. Placeholders or
a return-code.
2021-03-06 14:50:40 +01:00
tomFlowee c114c9dc74 Add an extra unit test. Tests CBlockIndex 2021-02-19 13:43:56 +01:00
tomFlowee 29082a1066 Follow coding guide; lowercase method names 2021-02-19 13:43:56 +01:00
tomFlowee ddfae7ed76 Add block-height fuzzing 2021-02-16 19:30:11 +01:00
tomFlowee f22b65e93e Fix test-instability
Avoid tests failing due to timing issues.
2021-02-16 19:13:05 +01:00
tomFlowee 58d7c3b4fb Add fuzzing test for transaction fetching.
This test just requests a transaction for each offset in block in
sequence, meaning that our question is incorrect most of the time.
2021-02-16 19:03:44 +01:00
tomFlowee efa23bd2db Extend Live::GetTransaction to search on address too
This allows API users to search the mempool on address or on txid.

This also adds a new unit test testing this functionality
2021-02-11 15:21:54 +01:00
tomFlowee 94ae61132b Promote 'interpreter' to the utils lib.
Being able to parse bitcoin-script is useful for users other than
the hub, using the flowee shared libraries they can now do so.
2021-01-21 15:47:46 +01:00
tomFlowee 7b0949031f Rename CHashWriter::GetHash to finalizeHash()
as the expected behavior of 'get*' is a const method, it is harmful to
name a method such when it actually alters the state of the method such
that subsequent calls will produce a different result.
2021-01-20 22:51:48 +01:00
tomFlowee 235df9c5f0 Add loading of DSProof from a constbuffer. 2021-01-20 21:35:20 +01:00
tomFlowee defd3950f0 Remove CAmount typedef
The CAmount name is not helpful as its just an int64_t and not a
class, like the name implies. There were a handful of places where
it was passed in as const-ref, as a good example of this actually
creating sub-par code.
2021-01-20 19:59:35 +01:00
tomFlowee 30e28acdd5 Remove unused code.
Move the MutableTransactionSignatureChecker class out of the header and
thereby remove the need to include transaction.h in the header.

This checker was never used in any app, just in the unit tests.

This also fixes includes around.
2021-01-20 18:22:34 +01:00
tomFlowee b836134081 Fix a source of test instability
Especially seen in the block-validation tests, we sometimes delete
the validation engine while some other threads are still doing stuff
with the not surprising effect that we may cause crashes or asserts
to get hit.

This change makes us wait instead.
2021-01-20 15:59:45 +01:00
tomFlowee 407dd2f2ab Simplify messageparser.
Remove some unused methods and complexity.
2021-01-06 19:37:27 +01:00
tomFlowee 3fe98afce9 Minor cleanup
This removes some unused includes from common headers and dead code
from some C++ files.
2021-01-05 22:05:25 +01:00
tomFlowee 3299795fc2 Add test for GetMempoolInfo 2020-12-24 22:45:21 +01:00
tomFlowee 63aebe14a1 minor fixlets 2020-12-24 14:15:48 +01:00
tomFlowee 56ea5579f1 BlackboxTest: printing of debug lines
Reuse the feature of TestBasic to make the logger prefix the test
function we are currently in.
2020-12-24 12:54:04 +01:00
tomFlowee afce2134fd Fix include 2020-12-24 12:52:48 +01:00
tomFlowee edc255d308 Fix test
This test hardcoded a date now a couple of days in the past, which
made the test fail.

Set the date to be far in the future.
2020-12-17 10:42:15 +01:00