Commit Graph

930 Commits

Author SHA1 Message Date
Jonas Schnelli 962ec4b5e4
[QA] add setban/listbanned/clearbanned tests 2017-03-02 13:23:03 -08:00
Daniel Kraft e940185294
Fix univalue handling of \u0000 characters.
Univalue's parsing of \u escape sequences did not handle NUL characters
correctly.  They were, effectively, dropped.  The extended test-case
fails with the old code, and is fixed with this patch.
2017-03-02 13:23:03 -08:00
Simon ebe750a882 Part of #1969. Changing min fee calculation also changes the dust threshold. 2017-02-28 11:44:07 -08:00
zkbot eaaa5f625f Auto merge of #2082 - str4d:univalue-subtree, r=bitcartel
Add UniValue as subtree

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6637
- bitcoin/bitcoin#6239
- bitcoin/bitcoin#6379
- bitcoin/bitcoin#6456
- bitcoin/bitcoin#6788
2017-02-10 07:46:58 +00:00
zkbot e51bd1b556 Auto merge of #1990 - str4d:1985-replace-json-spirit-with-univalue, r=str4d
Convert entire source tree from json_spirit to UniValue

This PR cherry-picks bitcoin/bitcoin#6121 and then migrates the Zcash-specific code to UniValue.

Also cherry-picks:
- bitcoin/bitcoin#6241
- bitcoin/bitcoin#6234

Closes #1985.
2017-02-10 05:15:53 +00:00
Wladimir J. van der Laan 2aee461930
univalue: Avoid unnecessary roundtrip through double for numbers
JSON makes no distinction between numbers and reals, and our code
doesn't need to do so either.

This removes VREAL, as well as its specific post-processing in
`UniValue::write`. Non-monetary amounts do not need to be forcibly
formatted with 8 decimals, so the extra roundtrip was unnecessary
(and potentially loses precision).

Zcash: cherry-picked from commit 7650449a6777710cf818d41862626164da0cd412
Dropped changes to qa/rpc-tests/rest.py pending addition of /rest/headers/
2017-02-10 02:19:01 +00:00
Wladimir J. van der Laan d5bf1afae9
rpc: Make ValueFromAmount always return 8 decimals
This is the format that was always returned to JSON clients.
The difference was not noticed before, because VREAL values
are post-processed by univalue.

By implementing the functionality directly it breaks the dependency
of rpcserver on utilmoneystr. FormatMoney is now only used for debugging
purposes.

To test, port over the formatting tests from util_tests.cpp to
rpc_tests.cpp.
2017-02-10 02:18:59 +00:00
Wladimir J. van der Laan fed500e2dd
rpc: Accept scientific notation for monetary amounts in JSON
Add a function `ParseFixedPoint` that parses numbers according
to the JSON number specification and returns a 64-bit integer.

Then this in `AmountFromValue`, rather than `ParseMoney`.

Also add lots of tests (thanks to @jonasschnelli for some of them).

Fixes issue #6297.
2017-02-10 02:18:58 +00:00
Wladimir J. van der Laan e76a3849c6
Changes necessary now that zero values accepted in AmountFromValue
- Add an accept test for zero amounts, and a reject test for negative
  amounts
- Remove ugly hack in `settxfee` that is no longer necessary
- Do explicit zero checks in wallet RPC functions
- Don't add a check for zero amounts in `createrawtransaction` - this
  could be seen as a feature
2017-02-10 02:18:57 +00:00
Wladimir J. van der Laan a5beb3a51b
Get rid of fPlus argument to FormatMoney
It's never used with any other value than false, the default.
2017-02-10 02:18:55 +00:00
Jonas Schnelli a10a6e2a0e
[Univalue] add univalue over subtree
similar to secp256k1 include and compile univalue over a subtree
2017-02-10 02:18:51 +00:00
Jack Grigg cc71666a51
unsigned int -> size_t for comparing with UniValue.size() 2017-02-10 00:53:13 +00:00
Jack Grigg 0d37ae3a59
Migrate Zcash-specific code to UniValue 2017-02-10 00:52:57 +00:00
Jonas Schnelli b60e9f230f
fix util_tests.cpp clang warnings
was introduced with #6121
2017-02-10 00:35:24 +00:00
Jonas Schnelli 6b1e42bbfa
univalue: add type check unit tests 2017-02-10 00:35:24 +00:00
Wladimir J. van der Laan 5960d70002
util: Add ParseInt64 and ParseDouble functions
Strict parsing functions for other numeric types.

- ParseInt64 analogous to ParseInt32, but for 64-bit values.
- ParseDouble for doubles.
- Make all three Parse* functions more strict (e.g. reject whitespace on
  the inside)

Also add tests.
2017-02-10 00:35:24 +00:00
Wladimir J. van der Laan ff67da37cd
Simplify RPCclient, adapt json_parse_error test
# Conflicts:
#	src/test/rpc_tests.cpp
2017-02-10 00:35:24 +00:00
Jonas Schnelli c288192b19
fix univalue json parse tests 2017-02-10 00:35:24 +00:00
Jonas Schnelli d014114d67
Remove JSON Spirit wrapper, remove JSON Spirit leftovers
- implement find_value() function for UniValue
- replace all Array/Value/Object types with UniValues, remove JSON Spirit to UniValue wrapper
- remove JSON Spirit sources
2017-02-10 00:35:24 +00:00
Jonas Schnelli 851f58f94e
remove JSON Spirit UniValue wrapper 2017-02-10 00:35:24 +00:00
Jonas Schnelli 565d26737a
fix rpc unit test, plain numbers are not JSON compatible object
UniValues read() does only read valid json.
2017-02-10 00:35:24 +00:00
Jonas Schnelli 49a5df0ef3
univalue: add support for real, fix percision and make it json_spirit compatible
- avoid breaking the API because of different number/percision handling
2017-02-10 00:35:24 +00:00
Jonas Schnelli 38fc4b7090
expicit set UniValue type to avoid empty values 2017-02-10 00:35:24 +00:00
Jonas Schnelli 9756b7bd29
extend conversion to UniValue 2017-02-10 00:35:24 +00:00
Jeff Garzik ed21d5bd4b
Convert tree to using univalue. Eliminate all json_spirit uses. 2017-02-10 00:35:24 +00:00
Jeff Garzik ec57cc0ffe
UniValue: prefer .size() to .count(), to harmonize w/ existing tree 2017-02-10 00:35:24 +00:00
Simon 6605125d4e Add comment about fix for #2026. 2017-02-09 15:17:21 -08:00
Sean Bowe 05ec7887f1 Fix use after free in transaction_tests. 2017-02-09 14:35:33 -07:00
Jack Grigg 2cc0a252ad
Add compile flag to disable compilation of mining code 2017-01-30 21:14:46 +01:00
Simon 9064d73bf8 Fixes #1497 ZCA-009 by restricting data exporting to user defined folder.
Previously the RPC interface allowed z_exportwallet, backupwallet and
dumpwallet to write data to an arbitrary filename.  ZCA-009 demonstrates
how this is vulnerable.  The resolution is to only allow data to
written when the -exportdir has been configured.  Also filenames are
restricted to alphanumeric characters.
2017-01-16 10:56:06 -08:00
Jack Grigg 6fb8d0c2d6
Skip JoinSplit verification before the last checkpoint
Part of #1749
2016-12-09 21:06:45 +13:00
zkbot a398121503 Auto merge of #1919 - ebfull:abstract-verification, r=str4d
Isolate verification to a ProofVerifier context object that allows verification behavior to be tuned by the caller.

This is an alternative foundation for #1892, i.e., #1892 will have to be changed if this PR is accepted.

I think this is a safer approach because it allows us to isolate verification behavior to a single object. This will come in handy when @arielgabizon finishes the batching code.
2016-12-09 06:22:53 +00:00
zkbot cdbd851417 Auto merge of #1928 - ebfull:fix-anchor-cache-bug, r=str4d
Fix anchor cache bug

Fixes #1912.

If an anchor is removed from the cache, but didn't exist in it beforehand, it will insert a blank tree. If it's reinserted in a child cache, when the child cache flushes it will mark the treestate as entered but won't bring the valid tree with it.

Thankfully, we assert when connecting blocks so that this inconsistency won't cause us to build on a blank tree after a reorg.
2016-12-08 21:22:23 +00:00
Sean Bowe 08de001a25 Regression test. 2016-12-06 12:54:53 -07:00
Sean Bowe bc59f53722 Isolate verification to a `ProofVerifier` context object that allows verification behavior to be tuned by the caller. 2016-12-05 12:40:06 -07:00
Simon af53da0225 Closes #1903. Add fee parameter to z_sendmany. 2016-11-30 14:23:35 -08:00
Sean Bowe f398a94766 Anchors and nullifiers should always be inherited from the parent cache. 2016-11-17 11:43:54 -07:00
Sean Bowe d92bea9888 Add tests for witness `element` and tree `last` methods. Strengthen testing by inserting a different commitment into the tree at each step. 2016-11-14 10:13:06 -07:00
Simon 4e16a7249c Closes #1746. Add rpc call z_validateaddress to validate zaddrs. 2016-10-31 20:05:48 -07:00
Jack Grigg 657bde55ef
Update tests for new genesis blocks
Miner tests have been commented out, and will be regenerated after launch.
2016-10-28 02:56:15 -07:00
Jack Grigg ab32254909
Update tests for new genesis blocks 2016-10-27 02:45:21 -07:00
Jack Grigg 2f5d62fe32
Remove Founders' Reward override from #1398 2016-10-26 21:05:17 -07:00
zkbot 30d3d2dfd4 Auto merge of #1603 - str4d:1556-reject-old-block-versions, r=daira
Reject block versions lower than 4

Includes parts of #1554
Closes #1556
2016-10-22 14:32:40 -04:00
Jack Grigg f4f1b4b097
Update sighash tests for new consensus rule 2016-10-22 11:09:07 -05:00
Daira Hopwood 789914e7b0 Update comments in chainparams.cpp.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-10-22 13:46:22 +01:00
Jack Grigg 86d2c90468
Update tests for new genesis blocks 2016-10-22 00:52:58 -05:00
Jack Grigg 8c54e34a68
Use tromp's solver to regenerate miner tests
When using, comment out tromp's solver in miner.cpp to avoid linker errors.
2016-10-22 00:52:56 -05:00
zkbot 7ccbcca62c Auto merge of #1591 - bitcartel:upstream_7933_fix_out_of_memory_deserializing_utxo, r=daira
Upstream: fix out of memory problem when deserializing utxo

bitcoin/bitcoin#7933
2016-10-21 23:32:51 -04:00
zkbot 10ad093bbb Auto merge of #1567 - str4d:rename-binaries, r=daira
Rename binaries

This ensures that our installs don't clash with existing Bitcoin binaries and libraries.

Closes #1563 and #1565
2016-10-21 20:48:11 -04:00
Simon 43f0769cf6 Fix build problem with coins_tests 2016-10-20 23:50:19 -07:00
Pieter Wuille abd22bb674 Add tests for CCoins deserialization 2016-10-20 22:59:50 -07:00
zkbot c99a1c7e4f Auto merge of #1566 - daira:1557.make-v2-txns-standard, r=ageis
1557.make v2 txns standard

Make v2 transactions standard. This also corrects a rule about admitting large orphan transactions into the mempool, to account for v2-specific fields. ref #1557
2016-10-21 01:10:37 -04:00
zkbot f90526579b Auto merge of #1569 - str4d:1552-disable-wallet-encryption, r=daira
Disable wallet encryption

Closes #1552
2016-10-20 17:01:51 -04:00
Jack Grigg d8e06e3f58
Add test that encryptwallet is disabled 2016-10-20 14:45:44 -05:00
Jack Grigg 66a89c08df
Rename bitcoin-tx to zcash-tx
Closes #1565
2016-10-18 16:45:43 -05:00
Jack Grigg 08d6b02d5e
Rename libbitcoinconsensus to libzcashconsensus
Closes #1563
2016-10-18 16:45:37 -05:00
Daira Hopwood 71cc1b58a1 Add tests for IsStandardTx applied to v2 transactions.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-10-18 19:37:55 +01:00
Jack Grigg 3774c944f8
Refactor test code to better test JSDescription::Randomized() 2016-10-18 12:44:56 -05:00
Jack Grigg 7f0aa74666
Implement static method for creating a randomized JSDescription 2016-10-18 10:41:00 -05:00
zkbot 3fceaca3a1 Auto merge of #1506 - bitcartel:master_1478_fix_testnet3_test_issue, r=bitcartel
Stop some wallet tests creating ~/.zcash/testnet3 folder by setting -datadir environment

Closes #1478
2016-10-14 17:03:11 -04:00
Simon 6be367ea6d Fix test so that the encrypted wallet is output to the test_bitcoin -datadir folder. 2016-10-14 12:44:22 -07:00
zkbot 8eb672251b Auto merge of #1513 - bitcartel:master_1491_fix_help_message_rpc_z_importkey, r=daira
Fixes #1491 by updating help message for rpc call z_importkey
2016-10-13 19:05:08 -04:00
Simon 5bd677f5c6 Rename client identifier from Satoshi to MagicBean (closes #1481) 2016-10-12 10:50:05 -07:00
Simon e346a0b3f8 Add tests to verify that all z_* rpc calls return an error if there are too many input parameters. 2016-10-12 10:15:12 -07:00
Jack Grigg b6f100cf86
Update tests for account deprecation 2016-10-10 10:47:30 -05:00
zkbot b4526f4d22 Auto merge of #1458 - str4d:1386-remove-findanddelete-and-codeseparator, r=ageis
Remove FindAndDelete and disable OP_CODESEPARATOR

Closes #1386
2016-10-04 21:51:29 -04:00
zkbot 1f4515a8c0 Auto merge of #1477 - zcash:812.change-address-prefixes.0, r=str4d
Update address prefixes

Closes #812 and #1450
2016-10-04 18:59:20 -04:00
Daira Hopwood 9418345fe6 Repair bitcoin-util-test.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-10-04 22:56:33 +01:00
Jack Grigg f92f004714 Fix zkey test 2016-10-04 11:05:57 -07:00
zkbot 4cfbe798bf Auto merge of #1429 - str4d:867-update-dependencies, r=str4d
Update all dependencies

Also re-enables disabled compiler warnings.

Closes #867, #944, #1241, #1255, #1348.
2016-10-04 03:48:42 -04:00
Jack Grigg ee64b5e726 Re-encode hard-coded addresses in tests 2016-10-03 23:53:14 -07:00
Daira Hopwood fbad4cac24 Reencode keys in JSON test data. refs #812
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-10-03 23:53:14 -07:00
Jack Grigg a4f2555b35 Mark previously-valid test data as invalid 2016-10-03 20:09:18 -07:00
zkbot efe18f2e9b Auto merge of #1374 - str4d:1106-alert-safe-mode, r=str4d
Enable high-priority alerts to put the RPC into safe mode

This reverts the changes in 986b5e257e and adds a priority check.

Continuation of #1337
Closes #1106
2016-10-03 17:36:59 -04:00
zkbot fa632c1c91 Auto merge of #1468 - str4d:1138-change-versioning-scheme, r=str4d
Change versioning scheme

Closes #1138
2016-10-02 19:29:38 -04:00
Daira Hopwood 0fafbd5d0a Repair FormatSubVersion tests. refs #1138
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-10-02 16:44:56 +01:00
Simon 2d6e97ecc5 Add field fMinerTestModeForFoundersRewardScript to chainparams 2016-09-30 18:31:51 -07:00
Jack Grigg 7f01e437a6 Remove OP_CODESEPARATOR from tests 2016-10-01 01:17:32 +13:00
Simon 82bd9ee81b Fix comment and formatting per review 2016-09-29 22:07:38 -07:00
Jack Grigg 6567a7b534 Add tests for alerts enabling RPC safe mode 2016-09-30 17:47:28 +13:00
Simon 73699ceaf6 Add support for spending keys to the encrypted wallet. 2016-09-29 20:17:30 -07:00
Jack Grigg 017abaf694 Assert that new OpenSSL allocators succeed 2016-09-29 17:58:29 +13:00
Jack Grigg fa318aa9fe Upgrade OpenSSL to 1.1.0b
Closes #1348
2016-09-29 12:34:09 +13:00
Daira Hopwood 05e2db116d Remove FindAndDelete. refs #1386
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2016-09-27 00:48:30 +01:00
Simon da5e7e5185 Formatting and updated test per review. 2016-09-08 21:46:15 -07:00
Simon e883ffef91 Add test for calling RPC z_getbalance, z_gettotalbalance, z_listreceivedbyaddress with invalid parameters. 2016-09-08 21:46:15 -07:00
Simon 7b79275eba Add tests to try and improve coverage of perform_joinsplit. 2016-09-08 21:46:14 -07:00
Simon cff6f0ac46 Add friend class for testing private members of AsyncRPCOperation_sendmany. 2016-09-08 21:46:14 -07:00
Simon fc4b127ed3 Add tests for async queue and rpc commands: z_getoperationstatus, z_getoperationresult, z_listoperationids, z_sendmany 2016-09-08 21:46:14 -07:00
Simon b922924d14 Add test for AsyncRPCQueue and AsyncRPCOperation. 2016-09-08 21:46:14 -07:00
zkbot 2271d3feda Auto merge of #1338 - str4d:147-tweak-difficulty-adjustment-algorithm, r=ebfull
Tweaks to difficulty adjustment algorithm

This PR changes the difficulty algorithm to adjust from the average difficulty over the
block window instead of from the last difficulty. It also removes the special rules for the
testnet, which are incompatible with difficulty averaging.

Closes #147 again.
2016-09-08 02:21:13 +00:00
Jack Grigg 4b37cfd5b8 Remove unnecessary method 2016-09-08 12:22:08 +12:00
Simon 805344dcf4 Refactor: replace calls to GetTxid() with GetHash() 2016-09-07 15:12:09 -07:00
Simon a64f681f2c Remove #1144 from input data of script_tests.
Revert script_invalid.json to commit df1609f.
Revert script_valid.json to commit 1c54757.
2016-09-07 15:12:09 -07:00
Simon 5316bd3560 Remove #1144 from bloom_tests by reverting to commit 5012190. 2016-09-07 15:12:09 -07:00
Sean Bowe a4b00373ab Fix transaction test in test_bitcoin. 2016-09-07 13:55:31 -06:00
Jack Grigg 4a749674a8 Update tests for new genesis blocks 2016-09-07 21:05:12 +12:00
Jack Grigg 8f3ec042af Expand bounds on difficulty adjustment 2016-09-06 13:13:23 +12:00
Jack Grigg cb708a99a5 Add comments explaining changed semantics of pow_tests 2016-09-06 11:33:59 +12:00
zkbot 485ace0a1b Auto merge of #1311 - ebfull:cleanup-pp, r=ebfull
Deallocate the public parameters during Shutdown.

This also has it deallocated in `GenerateParams` and `test_bitcoin`. The virtual destructor probably isn't necessary but I added it just in case we need it some other time.
2016-09-02 03:03:45 +00:00
Simon 5d50130bc9 Closes #1315. RPC getblocksubsidy height parameter is now optional and
a test has been added to verify parameter input and results.
2016-08-30 15:11:07 -07:00
Sean Bowe 7ee82c4361 Deallocate the public parameters during Shutdown. 2016-08-26 16:55:43 -06:00
Simon 4b2e557181 Fix comments. 2016-08-24 11:19:34 -07:00
Simon badb9a9c2f Add test coverage for RPC call z_getnewaddress. 2016-08-24 11:19:34 -07:00
Simon 60f762a549 Added wallet rpc tests to cover:
z_importwallet, z_exportwallet
z_importkey, z_exportkey
z_listaddresses
2016-08-24 11:19:34 -07:00
zkbot cd9d373987 Auto merge of #1260 - str4d:1175-byte-array-manipulation, r=ebfull
Update Equihash implementation to match the Zcash spec

Closes #1175
2016-08-24 03:01:13 +00:00
Sean Bowe f0dab51cf3 Implement zkSNARK compression. 2016-08-22 00:36:12 -06:00
zkbot 365845216b Auto merge of #1268 - ThisIsNotOfficialCodeItsJustForks:t1130-upgrade-libsodium, r=ebfull
Upgrade libsodium for AVX2-detection bugfix.

Upgrades libsodium to bring in an AVX2-detection bugfix (to help with #1130).
2016-08-22 02:34:30 +00:00
Taylor Hornby 2902ac7ce8 Use libsodium's s < L check, instead checking that libsodium checks that. 2016-08-18 16:38:20 -06:00
Jack Grigg 5be6abbf84 Store the Equihash solution in minimal representation in the block header
The genesis blocks and miner tests have been regenerated, because changing the
block header serialisation format changes the block hash, and thus validity.

The Equihash solutions have been removed from the bloom test inputs for
simplicity (block validity is not checked there; only a valid serialisation is
necessary).
2016-08-16 16:02:39 +12:00
Jack Grigg caa0348f04 Update Equihash hash generation to match the Zcash spec
Changes:

- floor(512/n)*n/8 bytes of BLAKE2b output is split between floor(512/n)
  adjacent indices, instead of using one hash call per index.

- Parameters with n/(k+1) mod 8 != 0 will expand the BLAKE2b output to byte
  boundaries for colliding, instead of using a longer output and clearing bits.

- The genesis blocks have been regenerated.

- The test vectors have been regenerated.

- The Equihash inputs for the cancellation tests were modified to ensure that
  valid solutions were available to exercise the full solver.
2016-08-16 11:02:04 +12:00
Sean Bowe f5e5707d4c Change memo field size and relocate `ciphertexts` field of JoinSplit description. 2016-08-15 09:39:14 -06:00
Jack Grigg a23507d086 Update tests to account for new Equihash parameters 2016-08-06 17:33:23 +12:00
zkbot 95277e0311 Auto merge of #1144 - bitcartel:zc.v0.11.2.z7_tx_malleability_gettxid, r=bitcartel
A fix for transaction malleability

This PR fixes transaction malleability by not including the sigscript of transaction inputs and joinsplit sigs when hashing the txid.

This PR supercedes PR #1101 which was a minimal solution based on a new serialization flag.

This PR introduces GetTxid() to distinguish between getting a transaction id and the double sha256 hash.

The key changes are:
- Adding GetTxid() method to CTransaction which makes a copy of the transaction, clearing out the sigscript and joinsplitsig fields, before hashing.
- Verifying that every call to GetHash() actually wants a txid, and replacing with GetTxid().
- Renaming GetHash() to GetSerializeHash()
  - Rationale: In future, upstream code we want to merge will use GetHash() but we don't know the intent.  We should check to see if the intent is to receive a txid (most likely) in which case we replace with GetTxid(), or if upstream actually wants a double hash of the transaction we can use GetSerializeHash().
- Updated genesis data in chainparams.cpp

Note that coinbase transactions are excluded as they need the sigscript hashed to help avoid duplicate txids per BIP34:
  - This modification is related to a question from @ebfull on PR #1101 - "Can we think of a way this change allows us to construct two transactions with the same txid which can simultaneously appear in the blockchain? My guess is it would be possible to construct a coinbase transaction of such a form... this surely breaks invariants."

This PR Passes all tests in test_bitcoin (test data was updated in bloom_tests, miner_tests and script_tests).
2016-08-05 19:31:52 +00:00
Simon 0ccb650b5a Update genesis block hashes and test data. 2016-07-27 00:55:48 -07:00
Simon 2481bab2b8 Revert "Set nLockTime in CreateNewBlock() so coinbase txs do not have the same txid."
This reverts commit 29306269f4.
2016-07-27 00:41:26 -07:00
Jack Grigg 51eb5273f5 Equihash: Pass each obtained solution to a callback for immediate checking
Closes #1143
2016-07-27 19:15:49 +12:00
Simon 29306269f4 Set nLockTime in CreateNewBlock() so coinbase txs do not have the same txid.
Update test data in miner_tests.
2016-07-26 17:13:03 -07:00
Simon 10d2c57c0d Replace calls to GetHash() with GetTxid() for transaction objects.
Where the caller intends to receive a transaction id and not a double
SHA256 hash.
2016-07-26 17:13:03 -07:00
Simon 3574c9251f Updated test data for script_tests by uncommenting UPDATE_JSON_TESTS flag. 2016-07-26 17:09:27 -07:00
Simon b742003ee9 Update block and tx data used in bloom filter tests. 2016-07-26 17:09:27 -07:00
Simon 2b9130cd1f Update precomputed equihash solutions used in test. 2016-07-26 17:09:27 -07:00
Jack Grigg 2dbabb1159 Make Equihash solvers cancellable
The miner only cancels the solver when chainActive.Tip() changes.

Closes #1055
2016-07-20 19:17:02 +12:00
zkbot e117ff7651 Auto merge of #1048 - str4d:collect-all-valid-equihash-solns, r=ebfull
Collect all permutations of final solutions

This fixes a small bug where if there was a three-way (or more) collision in the final step, one or more valid solutions would be left out.
2016-07-20 03:54:30 +00:00
Taylor Hornby 838e3c753f Fix the tests that the SIGHASH_SINGLE bugfix breaks. 2016-07-19 16:36:37 -06:00
Taylor Hornby 67f0243533 Remove in-band error signalling from SignatureHash, fixing the SIGHASH_SINGLE bug. 2016-07-19 16:36:35 -06:00
Jack Grigg c6365f4d80 Add test case that requires the fix 2016-07-19 23:33:28 +12:00
zkbot d20d866d89 Auto merge of #1105 - bitcartel:zc.v0.11.2.z6_issue_424, r=ebfull
New private/public key pairs for broadcasting alert messages

Implements #424

Fixes and integrates method of sending alerts as described by upstream here:
- https://gist.github.com/laanwj/0e689cfa37b52bcbbb44

To send an alert:
- Copy private keys into alertkeys.h.
- Modify alert parameters and message found in sendalert.cpp
- Build and run to send the alert e.g. ./zcashd -printtoconsole -sendalert

Tested and verified with local nodes on alpha 6 testnet.
2016-07-18 21:09:46 +00:00
Sean Bowe 22de160219 Fixes for indentation and local variable names. 2016-07-18 10:07:29 -06:00
Sean Bowe 28173cd0de Remove more usage of `serial`. 2016-07-18 10:06:18 -06:00
Sean Bowe 9e511dbbdd Rename CSerialsCacheEntry. 2016-07-18 10:06:18 -06:00
Sean Bowe 1d184d53e1 Rename cacheSerials to cacheNullifiers and fix tests. 2016-07-18 10:06:18 -06:00
Sean Bowe b7e4abd6f7 Rename some usage of 'pour'. 2016-07-18 10:06:18 -06:00
Sean Bowe bb64be52fe Rename mapSerials to mapNullifiers. 2016-07-18 10:06:18 -06:00
Sean Bowe d889a287ae Rename CSerialsMap to CNullifiersMap. 2016-07-18 10:06:18 -06:00
Sean Bowe d90e46ba8d Renaming SetSerial to SetNullifier. 2016-07-18 10:06:18 -06:00
Sean Bowe 616f8d05af Rename GetSerial to GetNullifier. 2016-07-18 10:06:18 -06:00
Sean Bowe ee964faf3d Rename HavePourRequirements to HaveJoinSplitRequirements. 2016-07-18 10:06:18 -06:00
Sean Bowe bfeaf0049a Rename JSDescription's `serials` to `nullifiers`. 2016-07-18 10:06:18 -06:00
Sean Bowe 8675d94b63 Rename vpour to vjoinsplit. 2016-07-18 10:06:18 -06:00
Sean Bowe a8c68ffe99 Rename CPourTx to JSDescription. 2016-07-18 10:06:18 -06:00
Simon 939aaeb620 New alert test data generated for new alert key pair.
Added test fixture to create new test data.
Added instructions for developer.
2016-07-17 12:36:26 -07:00
zkbot fc127fc2db Auto merge of #1051 - ThisIsNotOfficialCodeItsJustForks:t863-mock-coverage-of-checktransaction, r=ebfull
Add mock test coverage of CheckTransaction

Closes #863.
2016-07-14 18:43:07 +00:00
Taylor Hornby c9c4611d9a Rename zerocash to zcash in some places. 2016-07-11 19:27:52 -06:00
zkbot 6caacc892e Auto merge of #1058 - ebfull:coin-cache, r=ebfull
Flush to disk more consistently by accounting memory usage of serials/anchors in cache.

Closes #626.

It's important that this at least *approximates* the memory usage, so that we flush the cache to disk as expected. It's okay that we overestimate. The serials are stored in keys in the `boost::unordered_map`, so we can simply use that map's `DynamicMemoryUsage`. The anchors are another story.
2016-07-11 17:23:19 +00:00
Sean Bowe ffcd1c57cc Update tests with cache usage computations 2016-07-10 20:53:33 -06:00
Sean Bowe 3cb927661e Remove the mainnet checkpoints. 2016-06-29 14:21:03 -06:00
Taylor Hornby 948d4e6c10 Split JoinSplit proof verification out of CheckTransaction. 2016-06-23 16:35:31 -06:00
zkbot 62a2d12672 Auto merge of #1026 - ebfull:address-serialization, r=ebfull
Zcash address encoding

We need to encode Zcash addresses so they aren't as large and unweildy. We're using Base58Check just like upstream does, and to ensure the first character is "z" in our addresses we must use two bytes for the version string. Two bytes gives us an extra character for free, so this PR targets the beginning of addresses to have "zc".

```
$ ./src/zcash-cli zcrawkeygen
{
    "zcaddress" : "tnvaj4ZbZG83tj4RwZcFeLgJoSt8nw1ZvSCG8EMyowAsXTQgJPat77Y43BVdVCrwrbLy7GG9msJDYdn5hmreHmkXAkX17hb",
    "zcsecretkey" : "SKzkxCRWvscKnroSFyhCqhY332KcDMH4LLNdK2TsSvbmr3CGAB8B",
    "zcviewingkey" : "10aa74046f31cbe5eaa8965d1e104853234c3d6c6e45f9c497ca3a025d159755"
}
```

This PR also encodes the spending keys with a prefix that targets "SK". The spec needs to be updated with these changes.

Testnet addresses will start with "tn".

Closes #572
2016-06-16 18:52:30 +00:00
zkbot 1178df0883 Auto merge of #1004 - str4d:931-difficulty-algorithm, r=ebfull
Implement new difficulty algorithm

Closes #931. Closes #696.
2016-06-15 23:26:49 +00:00