Commit Graph

1012 Commits

Author SHA1 Message Date
Eirik Ogilvie-Wigley
4fc309f0f5 Rename Merkle Trees to include sprout or sapling 2018-08-01 10:31:09 -06:00
Homu
a11e6aaacc Auto merge of #3336 - arcalinea:expiryheight-createrawtransaction, r=bitcartel
Take expiryheight as param to createrawtransaction

Addresses #3333
2018-07-30 13:56:34 -07:00
Simon
f01c11bd0f Add tests for expiryheight parameter of RPC createrawtransaction. 2018-07-30 10:24:10 -07:00
Jay Graber
8dd1dbcfe4 Add Sapling to rpc_wallet_z_importexport test 2018-07-29 16:15:06 -07:00
Wladimir J. van der Laan
a9496b08b6 rpc: Register calls where they are defined
Split out methods to every module, apart from 'help' and 'stop' which
are implemented in rpcserver.cpp itself.

- This makes it easier to add or remove RPC commands - no longer everything that includes
    rpcserver.h has to be rebuilt when there's a change there.
- Cleans up `rpc/server.h` by getting rid of the huge cluttered list of function definitions.
- Removes most of the bitcoin-specific code from rpcserver.cpp and .h.

Continues #7307 for the non-wallet.
2018-07-18 11:07:18 -06:00
Daniel Cousens
4519a766b6 move rpc* to rpc/ 2018-07-18 11:07:16 -06:00
Jonas Schnelli
34aca1b03c [RPC, Wallet] Move RPC dispatch table registration to wallet/ code
Allow extending the rpc dispatch table by appending commands when server is not running.
2018-07-18 11:07:15 -06:00
Jack Grigg
bea879157c Add Sapling support to z_validateaddress 2018-07-09 15:38:07 +01:00
Jay Graber
2173767365 Add crypted keystore sapling add key 2018-07-05 15:00:00 -07:00
Homu
9acfa0067f Auto merge of #3258 - Eirik0:3056-anchor-test-cases, r=str4d
Add tests for sapling anchors

Closes #3253
2018-06-19 09:28:20 -07:00
Eirik Ogilvie-Wigley
762ee0e896 Rename typename 2018-06-19 10:07:00 -06:00
Eirik Ogilvie-Wigley
115b26cb27 Add BOOST_TEST_CONTEXT to distinguish sprout v. sapling 2018-06-19 10:06:21 -06:00
Homu
2ebde5860e Auto merge of #3326 - str4d:3058-sapling-addresses, r=str4d
Sapling address encodings

This PR enables Sapling keys and addresses to be passed in anywhere Sprout keys
and addresses are used. Doing so will cause crashes until those places are updated
with Sapling support.

Includes code cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#11167
  - Only the `ConvertBits()` function.
- bitcoin/bitcoin#11630

Closes #3058.
2018-06-19 05:12:50 -07:00
Homu
4e3ff06507 Auto merge of #3320 - str4d:macos-tests, r=bitcartel
Fix MacOS tests

Includes code cherry-picked from upstream PR bitcoin/bitcoin#8270.
2018-06-18 19:00:56 -07:00
Jay Graber
052d640cb0 Add json test vectors for Sapling key components. 2018-06-13 10:38:32 -07:00
Jack Grigg
69aa0d8f28 Use CChainParams::Bech32HRP() in zs_address_test 2018-06-12 18:38:36 +12:00
Ariel Gabizon
e1a3461cc2 Improve/Fix variable names
ZCProof was too general. pubKeyHash was actually the JoinSplit pubkey
itself.
2018-06-09 20:27:35 -07:00
Jack Grigg
bec3e62bc1 Implement encoding and decoding of Sapling keys and addresses 2018-06-07 17:28:50 +12:00
Jack Grigg
c8511dfc07 Fix bech32::Encode() error handling
Previously, an input with invalid characters would result in out-of-bounds
reads, potentially exposing up to 224 bytes of memory following the location of
the CHARSET constant. This commit fixes the function to return an empty string,
which is what was originally documented as happening.
2018-06-07 17:19:44 +12:00
Pieter Wuille
6a2cc8ddc0 Simplify Base32 and Base64 conversions 2018-06-07 17:19:43 +12:00
Pieter Wuille
ac70f76c5d Generalize ConvertBits 2018-06-07 17:19:34 +12:00
Jack Grigg
6b759fb092 ConvertBits() - convert from one power-of-2 number base to another.
Function extracted from upstream:
  PR bitcoin/bitcoin#11167
  Commit c091b99379b97cb314c9fa123beabdbc324cf7a4
2018-06-07 16:42:01 +12:00
Homu
80338c07e5 Auto merge of #3237 - str4d:std-array, r=str4d
Replace boost::array with std::array
2018-06-06 19:36:57 -07:00
Matthew King
d28d3d20de Use portable #! in python scripts (/usr/bin/env) 2018-06-05 21:56:13 +12:00
Eirik Ogilvie-Wigley
c61ed9acfb Fix parsing parameters in getnetworksolps 2018-06-04 16:45:12 -06:00
Jack Grigg
a6bbb26e08 Replace boost::array with std::array 2018-05-26 00:12:57 +12:00
Sean Bowe
8f5429a13a Update merkle tree and pedersen hash tests to account for new encoding 2018-05-18 13:26:39 -06:00
Eirik Ogilvie-Wigley
3182b4abc3 Add tests for sapling anchors 2018-05-16 10:31:53 -06:00
Sean Bowe
b7a6c32178 Integrate Groth16 verification and proving. 2018-05-14 16:26:23 -06: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
Homu
1942f7a42b Auto merge of #3242 - str4d:3058-key-encoding-refactor, r=str4d
Key encoding refactor

Includes code cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#11372
  - Only the first three commits (the fourth commit depends on #2390)

Part of #3058.
2018-05-11 12:21:29 -07:00
Homu
f0daf3915f Auto merge of #3233 - str4d:3164-sapling-sighash, r=str4d
ZIP 243: Sapling SignatureHash

Closes #3164.
2018-05-08 16:59:33 -07:00
Jack Grigg
93bd00a0d5 Add key_io includes to Zcash-specific code 2018-05-08 21:39:56 +01:00
Pieter Wuille
3d31e09cbb Split key_io (address/key encodings) off from base58 2018-05-08 21:39:56 +01:00
Pieter Wuille
3e60c9fabd Stop using CBase58Data for ext keys 2018-05-08 21:39:55 +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
Pieter Wuille
f146029b0a Replace CBitcoinSecret with {Encode,Decode}Secret 2018-05-08 21:39:54 +01:00
Homu
b1d2a69908 Auto merge of #3202 - str4d:3058-sapling-bech32, r=str4d
Bech32 encoding support

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#8578
- bitcoin/bitcoin#11167
  - Only the second and third commits (first is in #3228, fourth depends on #2390, later ones are SegWit-specific).
- bitcoin/bitcoin#12757
  - Only the change to `src/bech32.h`

Part of #3058.
2018-05-08 09:08:37 -07:00
Jack Grigg
50284985e9 Update sighash tests 2018-05-08 11:45:41 +01:00
Sean Bowe
40bfb9e5b9 Swap bit endianness of test vectors 2018-05-07 18:57:04 -06:00
Sean Bowe
f6f97dfb1c Fix miner tests 2018-05-07 14:37:46 -06:00
Sean Bowe
8c57bbac15 Fix broken error messages. 2018-05-07 14:37:46 -06:00
Sean Bowe
673a0a79b3 Adjust tests to handle Sapling anchor cache 2018-05-07 14:37:46 -06:00
Sean Bowe
c643ff0b51 Add support for PopAnchor(.., SPROUT/SAPLING) 2018-05-07 14:37:46 -06:00
Sean Bowe
18322f074c Introduce support for GetBestAnchor(SAPLING). 2018-05-07 13:46:06 -06:00
Sean Bowe
2bd59e1473 Rename PushAnchor to PushSproutAnchor. 2018-05-07 13:46:06 -06:00
Sean Bowe
008f4ee8e7 Rename GetAnchorAt to GetSproutAnchorAt. 2018-05-07 13:46:06 -06:00
Sean Bowe
08f0728884 Rename hashAnchor to hashSproutAnchor. 2018-05-07 13:46:06 -06:00
Sean Bowe
d455828fdc Specifically describe anchors as Sprout anchors. 2018-05-07 13:46:06 -06:00