Commit Graph

969 Commits

Author SHA1 Message Date
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
Sean Bowe
28d20bdb11 Rename NullifierType to ShieldedType. 2018-05-07 13:46:06 -06:00
Sean Bowe
2f23a656fb Add regression tests and test vectors for Sapling merkle tree 2018-05-07 13:46:06 -06: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
Homu
c7f5d5ce1c Auto merge of #3227 - str4d:3191-nullifier-macos-fix, r=str4d
Fix -Wstring-plus-int warning on clang
2018-05-03 14:36:39 -07:00
Jack Grigg
b6be3e88bb Use CBitcoinAddress wrappers in Zcash-specific code 2018-05-03 01:13:04 +01:00
Pieter Wuille
07444da1db Introduce wrappers around CBitcoinAddress
This patch removes the need for the intermediary Base58 type
CBitcoinAddress, by providing {Encode,Decode,IsValid}Destination
function that directly operate on the conversion between strings
and CTxDestination.
2018-05-03 01:12:57 +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
Homu
53fa6f1315 Auto merge of #3179 - bitcartel:backport_transaction_details_in_getblock_v2bitcartel, r=str4d
Add improvements to getblock RPC output

Includes and supercedes #3095. Includes code cherry-picked from bitcoin/bitcoin#8704.
2018-05-01 10:19:10 -07:00
Homu
0a8d0c25e8 Auto merge of #3220 - Eirik0:3209-fix-CheckTransaction, r=str4d
Implement consensus rules about the number of Spend and Output Descriptions in a transaction

Closes #3209.
Part of #3065.
2018-05-01 07:09:52 -07:00
Jack Grigg
1f9dfbb9f0 Fix -Wstring-plus-int warning on clang 2018-05-01 14:55:47 +01: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
Marshall Gaucher
b300118002 Merge pull request #2813 from str4d/2074-uacomment
Implement uacomment config parameter
2018-04-30 09:12:38 -06:00
Eirik Ogilvie-Wigley
812098256f Coinbase transactions can not have shielded spend or output 2018-04-26 15:53:26 -06:00
Eirik Ogilvie-Wigley
4b4662b06d Make sure transactions have non-empty outputs 2018-04-26 15:24:59 -06:00
Sean Bowe
6679855147 Check that duplicate Sapling nullifiers don't exist within a transaction. 2018-04-25 17:10:34 -06:00
Simon
b230fe6836 Refactoring: Rename class libzcash::Note to libzcash::SproutNote. 2018-04-25 11:33:24 -07:00
Eirik Ogilvie-Wigley
9669920f75 Rename nullifier caches and maps to indicate sprout nullifiers 2018-04-25 11:26:38 -06:00
Eirik Ogilvie-Wigley
cab341e1a8 Add sapling nullifiers to db and mempool 2018-04-24 17:16:43 -06:00
Eirik Ogilvie-Wigley
708c87f16d Add enum for nullifier type 2018-04-24 09:57:14 -06:00
Eirik Ogilvie-Wigley
685e936c31 Add sapling nullifier set 2018-04-24 09:57:14 -06:00
Jack Grigg
b1608eed82 Add a constant for Overwinter's transaction version 2018-04-23 20:39:04 +01:00
Homu
5821bb0a4d Auto merge of #3185 - ebfull:sapling-testnet-params, r=str4d
Load Sapling testnet parameters into memory

This PR depends on https://github.com/zcash/librustzcash/pull/4.

The parameters are not loaded into memory if `zcashd` is configured as a mainnet node -- this is something we can change in the weeks before `2.0.0`.
2018-04-20 01:28:13 -07:00
Homu
0753a0e8a9 Auto merge of #3180 - str4d:transaction-serialization, r=ebfull
Upstream serialization improvements

Cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#5264
- bitcoin/bitcoin#6914
- bitcoin/bitcoin#6215
- bitcoin/bitcoin#8068
  - Only the `COMPACTSIZE` wrapper commit
- bitcoin/bitcoin#8658
- bitcoin/bitcoin#8708
  - Only the serializer variadics commit
- bitcoin/bitcoin#9039
- bitcoin/bitcoin#9125
  - Only the first two commits (the last two block on other upstream PRs)

Part of #2074.
2018-04-18 19:08:34 -07:00
Sean Bowe
acfcdb94b9 Load Sapling testnet parameters into memory. 2018-04-17 15:04:46 -06:00
Pieter Wuille
242f1421db Get rid of nType and nVersion
Remove the nType and nVersion as parameters to all serialization methods
and functions. There is only one place where it's read and has an impact
(in CAddress), and even there it does not impact any of the recursively
invoked serializers.

Instead, the few places that need nType or nVersion are changed to read
it directly from the stream object, through GetType() and GetVersion()
methods which are added to all stream classes.
2018-04-17 13:09:28 +01:00
Homu
0066c317b4 Auto merge of #3160 - bitcartel:3134_least_authority_issue_e, r=daira
Closes #3134 - Least Authority Issue E

CTxMemPool::check() does nothing when turned on, due to overflow.
2018-04-16 11:25:43 -07:00
Pieter Wuille
b8a6579366 Make GetSerializeSize a wrapper on top of CSizeComputer
Given that in default GetSerializeSize implementations created by
ADD_SERIALIZE_METHODS we're already using CSizeComputer(), get rid
of the specialized GetSerializeSize methods everywhere, and just use
CSizeComputer. This removes a lot of code which isn't actually used
anywhere.

For CCompactSize and CVarInt this actually removes a more efficient
size computing algorithm, which is brought back in a later commit.
2018-04-16 07:38:38 -06:00
Cory Fields
d1c9ef8606 serialization: teach serializers variadics
Also add a variadic CDataStream ctor for ease-of-use.
2018-04-16 07:38:37 -06:00
Jonas Schnelli
6cbe2c482c add bip32 pubkey serialization
CExtPubKey should be serializable like CPubKey
2018-04-16 07:38:36 -06:00
Pieter Wuille
29a8ade782 Prevector type 2018-04-16 07:38:36 -06:00
mruddy
690d38f0f8 Resolve issue bitcoin/bitcoin#3166.
These changes decode valid SIGHASH types on signatures in assembly (asm) representations of scriptSig scripts.
This squashed commit incorporates substantial helpful feedback from jtimon, laanwj, and sipa.
2018-04-16 07:38:36 -06:00
Homu
1594c845f5 Auto merge of #3157 - bitcartel:2966_extend_sprout_tests_part_2, r=str4d
Part of #2966, extending Sprout tests to other epochs

This continues the work started in PR #3109.
2018-04-14 16:36:30 -07:00
MarcoFalke
3c1db17064 [uacomment] Sanitize per BIP-0014
* SanitizeString() can be requested to be more strict
* Throw error when SanitizeString() changes uacomments
* Fix tests
2018-04-13 07:41:50 -06:00
Jack Grigg
ee6220c0ed [Bitcoin-Tx] Adjust util-test test cases for Zcash 2018-04-12 19:36:48 -06:00
Jonas Schnelli
f11fb32967 [Bitcoin-Tx] Add tests for sequence number support 2018-04-12 18:10:04 -06:00
Simon
a0c977ca61 Closes #3134 - Least Authority Issue E
CTxMemPool::check() does nothing when turned on, due to overflow.
2018-04-10 20:45:36 -07:00
Simon
61624ed05d Part of #2966, extending Sprout tests to other epochs.
This continues the work started in PR #3109.
2018-04-09 16:17:30 -07:00
Jack Grigg
8a22734ec1 test: Check return value of snprintf 2018-04-04 19:18:23 +01:00
Simon
7cc423522f Bump MIT Licence copyright header. 2018-04-04 10:16:06 -07:00
Simon
2742b20833 Use range based for loop
Instead of iterating over 0 .. 1 and then deciding on an actual desired
value, use a range based for loop for the desired value.

Adapted from d0413c670b4e5dc79d5cc1bc35571fca745c9a24
Authored-by: René Nyffenegger <mail@renenyffenegger.ch>
2018-04-04 09:57:59 -07:00