Commit Graph

72 Commits

Author SHA1 Message Date
Jack Grigg 554e00e8f9
Disable Sapling features on mainnet
Also places them behind an experimental features flag on testnet
2018-08-13 14:18:18 +01:00
Jack Grigg 25d5e80cbe
Rename *SpendingKey -> *SproutSpendingKey
Also GetPaymentAddresses -> GetSproutPaymentAddresses
2018-08-03 10:10:26 +01:00
Homu 871e1726c6 Auto merge of #3340 - Eirik0:rename-merkle-typedefs, r=str4d
Rename merkle tree typedefs to include Sprout

This is to be consistent with the naming convention we have been using to distinguish Sprout/Sapling.
2018-08-01 20:48:17 -07:00
Jack Grigg 40dc060cb0
test: Update rpc_wallet_z_importexport to account for Sapling changes 2018-08-01 19:59:57 +01:00
Eirik Ogilvie-Wigley 8ea8ef9850 Rename Witnesses to include sprout or sapling 2018-08-01 10:41:36 -06:00
Jay Graber 8dd1dbcfe4 Add Sapling to rpc_wallet_z_importexport test 2018-07-29 16:15:06 -07:00
Daniel Cousens 4519a766b6
move rpc* to rpc/ 2018-07-18 11:07:16 -06:00
Jack Grigg bea879157c
Add Sapling support to z_validateaddress 2018-07-09 15:38:07 +01:00
Jack Grigg a6bbb26e08
Replace boost::array with std::array 2018-05-26 00:12:57 +12:00
Jack Grigg e5eab182b5
Use boost::variant to represent shielded addresses and keys
libzcash::PaymentAddress has been renamed to libzcash::SproutPaymentAddress,
and a new typedef boost::variant is now libzcash::PaymentAddress. Similarly
for ViewingKey and SpendingKey.

A new class InvalidEncoding is introduced as the default boost::variant
option for each address and key type; it is used during decoding instead
of boost::optional.

All address and key storage functions in the wallet have been modified to
refer specifically to the Sprout types, as they are used very precisely.
In most other cases, the more general type is leveraged as much as possible,
and we convert to the Sprout type when necessary. This will be subsequently
wrapped in, or replaced with, context-specific functions once Sapling
types are implemented.
2018-05-11 17:14:49 -04:00
Jack Grigg 93bd00a0d5
Add key_io includes to Zcash-specific code 2018-05-08 21:39:56 +01:00
Jack Grigg 472f75bc2d
Introduce wrappers around CZCSpendingKey 2018-05-08 21:39:55 +01:00
Jack Grigg 80ed13d545
Introduce wrappers around CZCPaymentAddress
This patch removes the need for the intermediary Base58 type
CZCPaymentAddress, by providing {Encode,Decode}PaymentAddress
functions that directly operate on the conversion between strings
and libzcash::PaymentAddress.
2018-05-08 21:39:55 +01:00
Homu d97bfb766b Auto merge of #3228 - str4d:3058-taddr-encoding-refactor, r=str4d
Refactor t-address encoding

Includes code cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#11117
- bitcoin/bitcoin#11259
  - Only the second commit (first is for QT code)
- bitcoin/bitcoin#11167
  - Only the first commit (the rest are not part of the t-address encoding refactor).

Part of #3058. Precursor to #3202.
2018-05-03 18:12:22 -07:00
Jack Grigg b6be3e88bb
Use CBitcoinAddress wrappers in Zcash-specific code 2018-05-03 01:13:04 +01:00
Homu 9e5398686c Auto merge of #3206 - bitcartel:3194_polymorphic_note_class, r=str4d
Update note classes to be polymorphic

Closes #3194.  Lays foundation for introduction of Sapling notes through refactoring and creation of a class hierarchy for Sprout notes.  This PR updates some tests, but otherwise is a no-op.
2018-05-02 08:07:35 -07:00
Simon 9bd8f092c6 Closes #3178 by adding verbosity level improvements to getblock RPC.
This is a follow-up commit for d0a1d833520d120bb5a2ac4cf4192047af6afe24
found in PR #3095 in order to fix nits and add a test.
2018-04-30 11:51:59 -07:00
Simon b230fe6836 Refactoring: Rename class libzcash::Note to libzcash::SproutNote. 2018-04-25 11:33:24 -07:00
Simon d72c19a662 Closes #2910. Add z_listunspent RPC call. 2018-03-28 10:38:57 -07:00
Homu bc8221da81 Auto merge of #3089 - kozyilmaz:clang, r=str4d
[macOS] Fix test/gtest bugs caught by latest clang

Tests fail with latest clang on macOS (clang-900.0.39.2)

```
test/rpc_wallet_tests.cpp:1064:26: error: implicit conversion from 'double' to 'CAmount' (aka 'long long') changes value from 123.456 to 123 [-Werror,-Wliteral-conversion]
test/rpc_wallet_tests.cpp:1071:18: error: implicit conversion from 'double' to 'CAmount' (aka 'long long') changes value from 1.111 to 1 [-Werror,-Wliteral-conversion]
gtest/test_deprecation.cpp:28:1: error: control reaches end of non-void function [-Werror,-Wreturn-type]
```

Part of #2246.
2018-03-15 17:21:23 -07:00
Jack Grigg 6e9c7629af
Implement z_mergetoaddress for combining UTXOs and notes
Closes #2493.
2018-02-22 13:23:18 +00:00
Simon 072099d788 Implementation of Overwinter transaction format ZIP 202. 2018-02-16 10:10:15 -08:00
kozyilmaz bf69507cb5 Fix test/gtest bugs caught by latest macOS clang 2017-12-21 12:35:16 +03:00
Homu 6f9f09dfb0 Auto merge of #2670 - arielgabizon:lowmemprover, r=daira
Low memory prover

This PR integrates @ebfull 's low memory changes:  https://github.com/zcash/zcash/pull/2243/commits
on top of @str4d 's work bringing in libsnark as a subtree
4699d0eb36
2017-11-06 04:22:20 -08:00
Jack Grigg bef1b5ce1b
Fix NPE in rpc_wallet_tests 2017-11-05 12:02:21 -05:00
Simon c5dabd2b66 Closes #2639. Adds optional limit parameter with a default value of 50.
The new parameter is to satisfy the principle of least astonishment
by providing a sensible default for the maximum number of transparent
inputs to shield.  If users do not configure -mempooltxinputlimit
it is possible for them to create transactions with hundreds of
inputs which suffer from mining delay, due to the current state of
the network where some miners have configured -mempooltxinputlimit
as a way to deal with the problem of quadratic hashing.
2017-11-01 10:40:24 -07:00
Simon 06c19063bb Implement RPC shield_coinbase #2448. 2017-09-21 15:04:12 -07:00
Simon b639bb1eef Fixes #2519. When sending from a zaddr, minconf cannot be zero. 2017-07-11 11:29:43 -07:00
zkbot 6344719817 Auto merge of #2052 - str4d:2032-z_importkey-partial-rescan, r=bitcartel
Usability improvements for z_importkey

- Add height parameter to z_importkey to reduce rescan range
- Change semantics of rescan parameter, so users can explicitly force a rescan
  for existing keys.

Closes #2032
2017-03-24 03:47:11 +00:00
Jack Grigg 33589401ba
Require that z_importkey height parameter be in valid range 2017-03-24 16:07:53 +13:00
Simon 7d3b152897 Closes #2186. RPC getblock now accepts height or hash. 2017-03-23 19:25:04 -07:00
Jack Grigg a31ba7a0cb
Usability improvements for z_importkey
- Add height parameter to z_importkey to reduce rescan range
- Change semantics of rescan parameter, so users can explicitly force a rescan
  for existing keys.

Closes #2032
2017-03-16 19:34:41 +13:00
Matt Corallo 3d8013a01b
Add fundrawtransaction RPC method 2017-03-02 13:23:03 -08: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 0d37ae3a59
Migrate Zcash-specific code to UniValue 2017-02-10 00:52:57 +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
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
Simon af53da0225 Closes #1903. Add fee parameter to z_sendmany. 2016-11-30 14:23:35 -08:00
Simon 4e16a7249c Closes #1746. Add rpc call z_validateaddress to validate zaddrs. 2016-10-31 20:05:48 -07:00
Jack Grigg d8e06e3f58
Add test that encryptwallet is disabled 2016-10-20 14:45:44 -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
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
Jack Grigg f92f004714 Fix zkey test 2016-10-04 11:05:57 -07:00
Jack Grigg ee64b5e726 Re-encode hard-coded addresses in tests 2016-10-03 23:53:14 -07:00
Simon 82bd9ee81b Fix comment and formatting per review 2016-09-29 22:07:38 -07:00
Simon 73699ceaf6 Add support for spending keys to the encrypted wallet. 2016-09-29 20:17:30 -07:00
Simon da5e7e5185 Formatting and updated test per review. 2016-09-08 21:46:15 -07:00