1446 Commits

Author SHA1 Message Date
Jianping Wu
f5935c6a39 Fixed testnet address prefix.
Moved to testnet5.
2019-01-28 18:37:13 -08:00
Jianping Wu
5f8376e01e Fixed blockchain difficulty tests. 2019-01-26 18:15:10 -08:00
Jianping Wu
c627628f11 Skipped some miner tests (CreateNewBlock_validity) as genesis block is not available yet.
TODO: add back these test cases.
2019-01-26 17:53:16 -08:00
Jianping Wu
9ab8e8d8a0 Fixed base58 test cases.
Skipped lots of test cases since many of them are irrelevant, e.g. kevacoin only have compressed keys.
2019-01-26 17:49:29 -08:00
Jianping Wu
c6b604c418 Changed LTC to KVA.
Fixed qt test cases.
2019-01-26 16:34:11 -08:00
Jianping Wu
22cae7e612 Fixed rpc rawsign test case. 2019-01-26 15:20:05 -08:00
Jianping Wu
16ff06c5c2 Fixed script and transaction tests. 2019-01-26 00:57:32 -08:00
Jianping Wu
72d45d6a69 Fixed unit tests. 2019-01-25 21:25:48 -08:00
Jianping Wu
f80d9fed49 Set the same halving schedule as bitcoin. Increased block reward to 500. 2018-12-15 21:22:25 -08:00
Jianping Wu
9a025be151 Implemented keva_filter. 2018-12-13 10:43:54 -08:00
Jianping Wu
ceefe25a87 WIP: Keva mempool test. 2018-12-13 10:43:54 -08:00
Jianping Wu
37ea895cde Keva undo tests. 2018-12-13 10:43:54 -08:00
Jianping Wu
7f2f9e55b7 Started working on keva test case. 2018-12-13 10:43:54 -08:00
Jianping Wu
c436fe9b65 Fixed most miner tests.
Still three failures.
2018-12-13 10:43:54 -08:00
Jianping Wu
fd588c921a Fixed script test. 2018-12-13 10:43:54 -08:00
Jianping Wu
781e53a22b Fixed POW test cases. 2018-12-13 10:43:54 -08:00
Jianping Wu
e4376fdcb5 Increased total supply to: 1344000000.
Fixed subsidy test case.
2018-12-13 10:43:54 -08:00
Jianping Wu
7a994de062 First major changes to kevacoin text. 2018-12-13 10:43:53 -08:00
Jianping Wu
af0a8efb0a More kevacoin name changes. 2018-12-13 10:43:53 -08:00
Jianping Wu
2ba7b82896 Handled keva script with getAddress. 2018-12-13 10:43:53 -08:00
Jianping Wu
49de399c30 Implemented writing to DB. 2018-12-13 10:43:53 -08:00
Adrian Gallagher
defc472744
Merge remote-tracking branch 'bitcoin/0.16' into HEAD 2018-08-26 15:57:58 -07:00
Wladimir J. van der Laan
6518bcd56c
Merge #13797: [0.16] bitcoinconsensus: invalid flags should be set to bitcoinconsensus_error type, add test cases covering bitcoinconsensus error codes
1cdbea7f742fa128062009ea8ca22383bceacd1e bitcoinconsensus: invalid flags should be set to bitcoinconsensus_error type, add test cases covering bitcoinconsensus error codes (Thomas Kerin)

Pull request description:

  Backport of #13655 to 0.16

Tree-SHA512: b62e185f2aa957f09255090e59f96c039f47a5623d68b6fef8d1dd831c6d3135b039be5cfad0f823687ff2a5143d24e34bd83fefcc9ba5b68f43054cbd9d909d
2018-07-30 17:04:07 +02:00
Thomas Kerin
1cdbea7f74 bitcoinconsensus: invalid flags should be set to bitcoinconsensus_error type, add test cases covering bitcoinconsensus error codes
Github-Pull: #13655
Rebased-From: 417b6c1d2990ffc78c029442e027797d724a101f
2018-07-29 21:08:45 +00:00
Adrian Gallagher
ad3c330972
Merge remote-tracking branch 'bitcoin/0.16' into HEAD 2018-07-23 16:53:43 -07:00
practicalswift
e15e3a9ddd Remove boost dependency (boost/assign/std/vector.hpp)
Github-Pull: #13545
Rebased-From: 962d8eed5bdbe62b9926f01cb85bdce9d435d3d6
2018-07-13 11:50:25 -04:00
practicalswift
10621995ed Fix incorrect tests
Github-Pull: #13545
Rebased-From: c6fd0df4efcd9f75c43ff527fd57fe43bc47a474
2018-07-13 11:50:25 -04:00
Bernhard M. Wiedemann
170b309981 Make tests pass after 2020
also test that 64 bit integers are properly handled

Github-Pull: #13061
Rebased-From: 3ee4be10500710fc8e9b03acf974fd81224c05c4
2018-07-12 10:27:29 -04:00
Adrian Gallagher
8203195e2e
Litecoin: GetPoWHash for validation block tests 2018-06-17 18:56:31 -07:00
Adrian Gallagher
4c20019d30
Merge remote-tracking branch 'bitcoin/0.16' 2018-06-17 18:55:26 -07:00
Luke Dashjr
18b0c69e2f
Bugfix: Include <memory> for std::unique_ptr
GitHub-Pull: #12859
Rebased-From: a5bca13
2018-06-13 16:07:44 +08:00
Johnson Lau
1fffc2b346 Add transaction tests for constant scriptCode
Tests showing that CONST_SCRIPTCODE is applied only to non-segwit transactions

Github-Pull: #11423
Rebased-From: 0f8719bb035187076eeac025e2c786feb0f452d7
2018-05-24 14:03:01 -04:00
Johnson Lau
d353dd121b Add constant scriptCode policy in non-segwit scripts
This disables OP_CODESEPARATOR in non-segwit scripts (even in an unexecuted branch), and makes a positive FindAndDelete result invalid. This ensures that the scriptCode serialized in SignatureHash() is always the same as the script passing to the EvalScript.

Github-Pull: #11423
Rebased-From: 9dabfe49c066301ef75bcfcb089fd308366127c4
2018-05-24 14:03:01 -04:00
Jesse Cohen
d6c3a08c48 Add unit tests for signals generated by ProcessNewBlock()
After a recent bug discovered in callback ordering in MainSignals,
this test checks invariants in ordering of
BlockConnected / BlockDisconnected / UpdatedChainTip signals

Github-Pull: #13023
Rebased-From: dd435ad40267f5c50ff17533c696f9302829a6a6
2018-05-24 13:56:00 -04:00
Xinxi Wang
3f8b8a6c5f
Litecoin: M prefix added for script addresses 2018-03-15 16:47:12 -07:00
Adrian Gallagher
32ee7c79ae
Litecoin: Fix tests 2018-03-15 15:57:27 -07:00
Romano
08f2538862
Litecoin: Enable support for SSE2 instructions in scrypt via configure --enable-sse2 (#362) 2018-03-15 15:25:42 -07:00
Adrian Gallagher
a74a01e617
Litecoin: Branding 2018-03-15 15:25:31 -07:00
Adrian Gallagher
fee6799b12
Litecoin: Protocol and default settings
0) Adjust BIP30 enforcement values

1) Reduce amount that peers can adjust our time to eliminate an attack vector. Thanks to
coblee for this fix.

2) Zeitgeist2 patch - thanks to Lolcust and ArtForz. This fixes an issue where a
51% attack can change difficulty at will. Go back the full period unless it's the
first retarget after genesis.

3) Avoid overflow in CalculateNextWorkRequired(). Thanks to pooler for the overflow fix.

4) Zeitgeist2 bool fshift bnNew.bits(). Thanks to romanornr for this path.

5) SegWit ContextualCheckBlockHeader adjustment and extra coverage.

6) Reject peer proto version below 70002. Thanks to wtogami for this patch.

7) Send final alert message to nodes warning about removal of the alert system. Thanks to coblee for this patch.

8) Adjust default settings for Litecoin.
2018-03-04 18:13:23 -08:00
Wladimir J. van der Laan
01f931b928
test: Add missing signal.h header
util_tests.cpp needs to include the signal.h header on FreeBSD.

Reported by denis2342 on IRC.

Github-Pull: #12447
Rebased-From: dd7e42cbb4390788705031ffa0bc893d26f0597e
Tree-SHA512: 10ead029bb59f5d69e37b5679c710f22d64051de26e1ec8342eec4e4dec4d76249e16dff78d192972bcb8d139d99c7555a7cb2fe43b2b911103eab6d6f943b79
2018-02-27 10:49:44 +01:00
Adrian Gallagher
e838c27971
Litecoin: Fix various tests 2018-02-26 18:57:17 -08:00
shaolinfry
4b588c670c
Litecoin: Add scrypt N=1024 PoW 2018-02-26 18:57:17 -08:00
Wladimir J. van der Laan
4d54e7ad41
test: Add unit test for LockDirectory
Add a unit test for LockDirectory, introduced in #11281.

Github-Pull: #12422
Rebased-From: 1d4cbd26e4220982f7f2f60e447199d6f62ae254
Tree-SHA512: 8186f4b22c65153e30ec1e0b68be20fd59d34e1fe565d99f3b5a302780125953b867fb14c37144de3fd7baf5751df94bf3901eebbb7b820491ca452706d4e205
2018-02-15 22:38:10 +01:00
Wladimir J. van der Laan
44080a90a2
Merge #12118: Sort mempool by min(feerate, ancestor_feerate)
0a22a52 Use mempool's ancestor sort in transaction selection (Suhas Daftuar)
7abfa53 Add test for new ancestor feerate sort behavior (Suhas Daftuar)
9a51319 Sort mempool by min(feerate, ancestor_feerate) (Suhas Daftuar)
6773f92 Refactor CompareTxMemPoolEntryByDescendantScore (Suhas Daftuar)

Pull request description:

  This more closely approximates the desirability of a given transaction for
  mining, and should result in less re-sorting when transactions get removed from
  the mempool after being mined.

  I measured this as approximately a 5% speedup in removeForBlock.

Tree-SHA512: ffa36b567c5dfe3e8908c545a459b6a5ec0de26e7dc81b1050dd235cac9046564b4409a3f8c5ba97bd8b30526e8fec8f78480a912e317979467f32305c3dd37b
2018-01-15 15:36:35 +01:00
Wladimir J. van der Laan
9501dc27b3
Merge #12127: Remove unused mempool index
8e617e3 Remove unused mempool index (Suhas Daftuar)

Pull request description:

  We haven't used the "mining_score" index since 0.12, so remove it.

Tree-SHA512: ae37b8663194986eaeecfc2bbeca7ecb4ae6f0d8384515fa218cbc939a580d4b9f7f997c5297c3f1b3c3a0651edb092f373ac9a4808aaec30d38cb99d5f3ed70
2018-01-15 09:57:24 +01:00
Suhas Daftuar
7abfa538b5 Add test for new ancestor feerate sort behavior 2018-01-12 12:40:55 -05:00
MarcoFalke
0910cbe4ef
Merge #12082: Adding test case for SINGLE|ANYONECANPAY hash type in tx_valid.json
18be3ab139 Adding test case for SINGLE|ANYONECANPAY hash type in tx_valid.json (Chris Stewart)

Pull request description:

  We are missing a test vector for SINGLE|ANYONECANPAY inside of tx_valid.json. This addresses the issue #12060

Tree-SHA512: e3526113477dbf575c4a844cf489dcfa2c037c6d928af6f97413edc1a8d29cdf2143da96471cdfd3de08bf5ed178117ed67926fd70fd42ca391ac0bb0d08f3fd
2018-01-11 12:36:45 -05:00
Jonas Schnelli
d889c036cd
Merge #11403: SegWit wallet support
b224a47a1 Add address_types test (Pieter Wuille)
7ee54fd7c Support downgrading after recovered keypool witness keys (Pieter Wuille)
940a21932 SegWit wallet support (Pieter Wuille)
f37c64e47 Implicitly know about P2WPKH redeemscripts (Pieter Wuille)
57273f2b3 [test] Serialize CTransaction with witness by default (Pieter Wuille)
cf2c0b6f5 Support P2WPKH and P2SH-P2WPKH in dumpprivkey (Pieter Wuille)
37c03d3e0 Support P2WPKH addresses in create/addmultisig (Pieter Wuille)
3eaa003c8 Extend validateaddress information for P2SH-embedded witness (Pieter Wuille)
30a27dc5b Expose method to find key for a single-key destination (Pieter Wuille)
985c79552 Improve witness destination types and use them more (Pieter Wuille)
cbe197470 [refactor] GetAccount{PubKey,Address} -> GetAccountDestination (Pieter Wuille)
0c8ea6380 Abstract out IsSolvable from Witnessifier (Pieter Wuille)

Pull request description:

  This implements a minimum viable implementation of SegWit wallet support, based on top of #11389, and includes part of the functionality from #11089.

  Two new configuration options are added:
  * `-addresstype`, with options `legacy`, `p2sh`, and `bech32`. It controls what kind of addresses are produced by `getnewaddress`, `getaccountaddress`, and `createmultisigaddress`.
  * `-changetype`, with the same options, and by default equal to `-addresstype`, that controls what kind of change is used.

  All wallet private and public keys can be used for any type of address. Support for address types dependent on different derivation paths will need a major overhaul of how our internal detection of outputs work. I expect that that will happen for a next major version.

  The above also applies to imported keys, as having a distinction there but not for normal operations is a disaster for testing, and probably for comprehension of users. This has some ugly effects, like needing to associate the provided label to `importprivkey` with each style address for the corresponding key.

  To deal with witness outputs requiring a corresponding redeemscript in wallet, three approaches are used:
  * All SegWit addresses created through `getnewaddress` or multisig RPCs explicitly get their redeemscripts added to the wallet file. This means that downgrading after creating a witness address will work, as long as the wallet file is up to date.
  * All SegWit keys in the wallet get an _implicit_ redeemscript added, without it being written to the file. This means recovery of an old backup will work, as long as you use new software.
  * All keypool keys that are seen used in transactions explicitly get their redeemscripts added to the wallet files. This means that downgrading after recovering from a backup that includes a witness address will work.

  These approaches correspond to solutions 3a, 1a, and 5a respectively from https://gist.github.com/sipa/125cfa1615946d0c3f3eec2ad7f250a2. As argued there, there is no full solution for dealing with the case where you both downgrade and restore a backup, so that's also not implemented.

  `dumpwallet`, `importwallet`, `importmulti`, `signmessage` and `verifymessage` don't work with SegWit addresses yet. They're remaining TODOs, for this PR or a follow-up. Because of that, several tests unexpectedly run with `-addresstype=legacy` for now.

Tree-SHA512: d425dbe517c0422061ab8dacdc3a6ae47da071450932ed992c79559d922dff7b2574a31a8c94feccd3761c1dffb6422c50055e6dca8e3cf94a169bc95e39e959
2018-01-10 20:55:41 -10:00
Pieter Wuille
f37c64e477 Implicitly know about P2WPKH redeemscripts
Make CKeyStore automatically known about the redeemscripts necessary for P2SH-P2WPKH
(and due to the extra checks in IsMine, also P2WPKH) spending.
2018-01-09 15:35:27 -08:00
Suhas Daftuar
8e617e3708 Remove unused mempool index 2018-01-09 08:59:21 -05:00