Commit Graph

621 Commits

Author SHA1 Message Date
Simon f01c11bd0f Add tests for expiryheight parameter of RPC createrawtransaction. 2018-07-30 10:24:10 -07:00
Jack Grigg eec85c4388
Add Sapling support to z_getnewaddress and z_listaddresses 2018-07-30 16:24:20 +01:00
Larry Ruane cb3a815b29 Add call to sync_all() after (z_sendmany, wait) 2018-07-20 12:00:41 -06:00
Daniel Cousens 4b184205e3
rpc: update inline comments to refer to new file paths 2018-07-18 11:07:17 -06:00
Homu b9bd5ab42c Auto merge of #3354 - leto:absurd_fee_bug, r=bitcartel
Fix absurd fee bug reported in #3281, with tests

This was ported from the Hush `absurd_fee_bug` PR: https://github.com/MyHush/hush/pull/136

Tests executed with `./qa/pull-tester/rpc-tests.sh wallet` and pass on Ubuntu 16.04. Some tests were added for previously untested behavior as well.

Closes #3281.
2018-07-17 15:03:08 -07:00
Simon 0b6eeac330 Update and fix per review comments, the test for absurd fee. 2018-07-17 13:00:42 -07:00
Homu 13b41a6760 Auto merge of #3156 - Eirik0:2935-change-indicator, r=bitcartel
Add change indicator

This adds to the json returned when calling z_listreceivedbyaddress and z_listuspent an additional field entitiled 'change' which will be either true or false depending on whether or not the note was change from another transaction.
2018-07-17 11:41:03 -07:00
Eirik Ogilvie-Wigley 62d707d1fd Fix test broken by change indicator 2018-07-16 14:50:06 -06:00
Eirik Ogilvie-Wigley 0646f749f9 Add change indicator for notes 2018-07-16 14:49:29 -06:00
Homu f649bb36c5 Auto merge of #3303 - LarryRuane:2807-rpc-test-round-fees, r=bitcartel
(rpc-test) accurately account for fee without rounding error

Fix for #2807, this test compares balances after doing key exports and imports, and expects these balances to be equal. But they are not exactly equal due to transaction fees, so the test makes them "equal" by rounding a value that has had fees taken out up to the nearest hundredth of a unit (which is much more than the default fee). This obviously is somewhat sloppy. It also converts a balance to float, which really should never be used due to loss of precision (use Decimal instead).

This change makes the test accurately account for the fee using precise comparisons, and removes the use of float. This test doesn't depend on the default fee (0.0001) but instead sets the fee (to that value). This way, if the default fee changes in the future, this test will continue to run. While testing these changes, I set the fee to various values (up to the max, 0.0190), and the test still passes.
2018-06-22 14:01:48 -07:00
Simon a4ff089b2a Fix pyflakes error in test zkey_import_export. 2018-06-22 11:34:21 -07:00
Duke Leto e5aa9f617b Fix absurd fee bug reported in #3281, with tests 2018-06-22 05:20:45 +00: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
Jack Grigg 341a22ad90
Skip ELF-only sec-hard checks on non-ELF binaries 2018-06-07 18:49:15 +12:00
Jack Grigg c7e64754dc
Add MacOS support to no-dot-so test 2018-06-05 22:32:13 +12:00
Eirik Ogilvie-Wigley 25c13ef702 Add hashFinalSaplingRoot to getblocktemplate 2018-06-01 15:47:30 -06:00
Larry Ruane fff031688e (rpc-test) accurately account for fee without rounding error 2018-05-24 11:29:14 -04:00
Homu 386a9b35c0 Auto merge of #3238 - str4d:3199-mempool-sapling-activation, r=str4d
Update mempool_nu_activation RPC test to exercise both Overwinter and Sapling

Closes #3199.
2018-05-16 13:52:40 -07:00
Eirik Ogilvie-Wigley a81b36d267 Add more options when asserting in RPC tests 2018-05-04 09:38:36 -06:00
Jack Grigg 11aa594440
Remove obsolete CreateJoinSplit and GenerateParams binaries 2018-05-03 13:18:03 +01:00
Jack Grigg 2c34c1cbff
Update mempool_nu_activation RPC test to exercise both Overwinter and Sapling
Closes #3199.
2018-05-03 01:07:41 +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
Homu 68cf6f3c2d Auto merge of #3074 - arcalinea:2983_tx_expiry_test_dependent, r=str4d
Add test for dependent txs to mempool_tx_expiry.py

Closes #2983

Also replaced absolute blockheight check with a relative height check.
2018-04-23 15:50:16 -07:00
Jay Graber 7dc0f84788 Add test for dependent txs to mempool_tx_expiry.py 2018-04-18 06:34:09 -07: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
Jonas Schnelli 216e94fb24
[RPC] createrawtransaction: add option to set the sequence number per input 2018-04-12 18:10:04 -06:00
Jack Grigg 3fe2f3d143
Update -enforcenodebloom RPC test with filterclear vs filteradd 2018-04-05 01:30:38 +01:00
Jack Grigg b77e46fe01
Add RPC test for -enforcenodebloom 2018-04-05 01:30:38 +01:00
Jack Grigg 10e97b8f00
test: Add missing Overwinter fields to mininode's CTransaction 2018-04-04 22:49:49 +01:00
Daira Hopwood 473a113241 Don't increase banscore if the transaction only just expired.
Author: Jack Grigg <str4d@z.cash>
2018-04-04 01:29:47 +01:00
Daira Hopwood a0ea82301a Test that receiving an expired transaction does not increase the peer's ban score. 2018-04-04 00:01:49 +01:00
Daira Hopwood 697140ede5 Add support for Overwinter v3 transactions to mininode framework. 2018-04-04 00:01:23 +01:00
Jack Grigg 26cdb83add
Update blockchain.py RPC test for Zcash 2018-04-03 20:40:54 +01:00
Pieter Wuille f95bf4c417
Fix chainstate serialized_size computation 2018-04-03 20:40:54 +01:00
James O'Beirne 79272bfaf9
Add tests for gettxoutsetinfo, CLevelDBBatch, CLevelDBIterator
Thanks @dexX7.
2018-04-03 20:40:54 +01:00
Homu 3055fd5508 Auto merge of #3136 - str4d:2937-z_importviewingkey-startheight, r=daira
Fix z_importviewingkey startHeight parameter

Closes #2937.

Co-authored-by: Tomas M <tomas@slax.org>
2018-04-03 09:41:09 -07:00
Homu 3a47b9bcfd Auto merge of #3132 - str4d:2898-rewind-block-index, r=daira
When rewinding, remove insufficiently-validated blocks

If a block is insufficiently-validated against a particular branch ID, then we
cannot guarantee that even the block header will be valid under the actual
consensus rules the node will want to apply. Instead require that the blocks are
completely re-validated, by removing them from the block index (which is
equivalent to reducing their validity to BLOCK_VALID_UNKNOWN).

Closes #3100.
2018-04-03 04:37:21 -07:00
Jack Grigg fe87fd2b36
Add RPC test of RewindBlockIndex 2018-04-03 10:58:27 +01:00
Homu ca981fd442 Auto merge of #3080 - leto:jsindex, r=bitcartel
Return JoinSplit and JoinSplitOutput indexes in z_listreceivedbyaddress

This implements a feature request by @nathan-at-least in https://github.com/zcash/zcash/issues/2932 and I wanted to ask for feedback about the exact form of the data returned before updating tests and docs.
2018-04-03 00:30:11 -07:00
Jack Grigg 28915c30ca
Fix z_importviewingkey startHeight parameter
Closes #2937.
2018-04-03 02:43:52 +01:00
Jonathan "Duke" Leto afdd64c6ae Add tests for new JoinSplit keys returned by z_listreceivedbyaddress 2018-04-02 13:23:00 -07:00
Homu 347804fe73 Auto merge of #3106 - braddmiller:3046-mergetoaddress-concurrent, r=str4d
Add Note Locking to z_mergetoaddress

Adds note locking to `z_mergetoaddress` allowing it to be invoked multiple times before previous `z_mergetoaddress` operations have finished.

Reference issue [#3046](https://github.com/zcash/zcash/issues/3046)

Co-authored-by: Eirik Ogilvie-Wigley <eirik@z.cash>
2018-03-30 14:29:17 -07:00
Homu 72f14060bc Auto merge of #3098 - str4d:2343-overwinter-disable-mempooltxinputlimit, r=str4d
Ignore -mempooltxinputlimit once Overwinter activates

Overwinter changes the SignatureHash function to solve the quadratic hashing problem, so this option will no longer be needed.
2018-03-30 08:33:58 -07:00
Brad Miller 4e6400bc00 Implement note locking for z_mergetoaddress
Co-authored-by: Eirik Ogilvie-Wigley <eirik@z.cash>
2018-03-29 15:48:34 -06:00
Jack Grigg 9666cc912a Test calling z_mergetoaddress to merge notes while a note merge is ongoing 2018-03-29 15:38:26 -06:00
Homu 5bdce01848 Auto merge of #2913 - bitcartel:2910_z_listunspent, r=bitcartel
Closes #2910. Add z_listunspent RPC call.

Have tested on network.  Opening up for review.
2018-03-28 10:40:49 -07:00
Simon d72c19a662 Closes #2910. Add z_listunspent RPC call. 2018-03-28 10:38:57 -07:00
Jack Grigg 31afbcc5c9
Ignore -mempooltxinputlimit once Overwinter activates 2018-03-28 14:25:42 +02:00
Homu 99b6f76355 Auto merge of #3111 - bitcartel:3110_high_fee_error_reporting, r=bitcartel
Closes #3110.  Ensure user can see error message about absurdly high fees.
2018-03-27 10:33:52 -07:00
Simon 8b15afd315 Closes #3110. Ensure user can see error message about absurdly high fees. 2018-03-27 10:23:24 -07:00
Jack Grigg b466c1c90c
cleanup: Ensure code is pyflakes-clean for CI 2018-03-27 02:47:57 +02:00
Homu 64de921747 Auto merge of #3091 - bitcartel:cache_invalidation_qa, r=str4d
Closes #1988. Add qa test for cache invalidation bug found in v1.0.0 to v1.0.3.
2018-03-20 11:28:08 -07:00
Homu 70e2522306 Auto merge of #3090 - bitcartel:3084_log_expired_txid, r=bitcartel
Closes #3084.  Log txid when removing expired transactions from mempool.
2018-03-19 14:59:30 -07:00
Jack Grigg b7caaf954b
test: Move wait_and_assert_operationid_status debug output before asserts
Otherwise we don't see them for failed tests :)
2018-03-19 14:00:18 +01:00
Simon b740a99079 Remove local function wait_and_assert_operationid_status which is
now defined in the test framework for shared usage.
2018-03-16 17:16:22 -07:00
Simon 2f761371d2 Add qa test for cache invalidation bug found in v1.0.0 to v1.0.3. 2018-03-16 15:18:34 -07:00
Simon a510b4752d Enable mempool logging in tx expiry QA test. 2018-03-16 11:45:45 -07:00
Daira Hopwood b4353db5d6 pyflakes cleanups to RPC tests after Overwinter PRs.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2018-03-12 14:15:25 +00:00
Jonathan "Duke" Leto 4db8717431 Fix outdated comment about starting balance of nodes 2018-02-28 14:29:05 -08:00
Jonathan "Duke" Leto 48cecf2ad9 Regtest mining does have a founders reward, a single address t2FwcEhFdNXuFMv1tcYwaBJtYVtMj8b1uTg 2018-02-28 14:28:22 -08:00
Jonathan "Duke" Leto 62fee1296f Update awkward wording about blocks as per @daira 2018-02-28 14:17:28 -08:00
Jonathan "Duke" Leto d8399efc03 This library seems to not be used at all and all comments mentioning it are ghosts 2018-02-28 14:13:07 -08:00
Jonathan "Duke" Leto 427e5fae3f Fix references to Bitcoin in RPC tests readme 2018-02-26 10:47:59 -08:00
Homu a418756ef4 Auto merge of #2874 - arcalinea:tx_block_expiry, r=arcalinea
Transaction expiry height

Implements ZIP 203.

- Only applies after Overwinter blockheight.

Closes #754.
2018-02-23 18:37:48 -08:00
Simon b6e5cc7d27 Add python qa test overwinter_peer_management. 2018-02-23 14:22:43 -08:00
Jay Graber 5943f227da Add mempool_tx_expiry.py test 2018-02-23 00:12:10 -08:00
Homu c5904fb2a4 Auto merge of #2797 - str4d:2493-active-merging, r=bitcartel
Implement z_mergetoaddress for combining UTXOs and notes

Closes #2493.
2018-02-22 20:59:51 -08:00
Jack Grigg 15ced9b153
wallet_mergetoaddress: Add additional syncs to prevent race conditions 2018-02-23 04:28:04 +00:00
Simon e6cd2a8356
Closes #2964. z_sendmany once again makes v1 tx for taddr to taddr.
In accordance with the Zcash protocol spec.
2018-02-22 15:43:42 +00:00
Jack Grigg 4c3d2b3bbe
Check upgrade status in wallet_overwintertx RPC test 2018-02-22 13:44:40 +00:00
Jack Grigg 553a5c1ab2
Gate z_mergetoaddress as an experimental feature 2018-02-22 13:23:25 +00:00
Jack Grigg 6e9c7629af
Implement z_mergetoaddress for combining UTXOs and notes
Closes #2493.
2018-02-22 13:23:18 +00:00
Jack Grigg ed9aa2b62a
Add branch IDs for current and next block to getblockchaininfo
Closes #2974.
2018-02-21 21:18:03 +00:00
Homu d4d2844829 Auto merge of #2463 - str4d:713-rollback-limit, r=str4d
Implement roll-back limit for reorganisation

Part of  #2905. Closes #713.
2018-02-20 15:17:22 -08:00
Jack Grigg 818b94f94f
Make number of inputs configurable in validatelargetx test 2018-02-20 04:22:22 +00:00
Homu 49274558c6 Auto merge of #2940 - str4d:nu-activation-mempool-expiry, r=str4d
Mempool improvements, branch ID awareness

Whenever the local chain tip is updated, transactions in the mempool which commit to an
unmineable branch ID (for example, just before a network upgrade activates, where the
next block will have a different branch ID) will be removed.

Includes commits cherry-picked from the following upstream PRs:

- bitcoin/bitcoin#6654
  - Only the mempool index change.
- bitcoin/bitcoin#6776
- bitcoin/bitcoin#7020
- bitcoin/bitcoin#6915

Part of #2074.
2018-02-19 19:00:30 -08:00
Jack Grigg 34a64fe0a2
Remove mempool transactions which commit to an unmineable branch ID 2018-02-20 02:57:44 +00:00
Matt Corallo b0f8c83f95
Add failing test checking timelocked-txn removal during reorg 2018-02-20 02:57:40 +00:00
Jack Grigg 57e6ecda5a
Implement roll-back limit for reorganisation
Closes #713.
2018-02-19 16:32:42 +00:00
Simon 072099d788 Implementation of Overwinter transaction format ZIP 202. 2018-02-16 10:10:15 -08:00
Jack Grigg 9e8f1d09ca
zkey_import_export: Synchronize mempools before mining
Resolves a race condition that caused the RPC test to intermittently fail.

Closes #2892.
2018-01-22 21:10:57 +00:00
Jack Grigg 44e5b42751
Check chainValueZat when checking value pool monitoring 2018-01-03 23:41:53 +01:00
Jack Grigg 5d9cf8ae23
Fix pyflakes warnings in zkey_import_export RPC test 2017-12-21 18:19:42 +00:00
Homu 1683c2d5bf Auto merge of #2143 - str4d:1997-viewing-keys, r=str4d
Implement incoming viewing keys

Closes #1997.
2017-12-20 14:11:05 -08:00
Jack Grigg 44e37656bf
Add watch-only support to Zcash RPC methods
Balance totals do not include spends linked to viewing key addresses, as
nullifiers cannot be calculated and therefore spends cannot be detected.
2017-12-20 00:46:37 +00:00
Homu c1b0db70e5 Auto merge of #2779 - arcalinea:2515_test_zimportkey, r=str4d
Add RPC test that exercises z_importkey

Part of #2515.
2017-12-18 08:32:28 -08:00
Homu efda4bafef Auto merge of #2796 - per-gron:less-verbose-tests, r=daira
Less verbose tests

Fixes #2453 and deduplicates some related code.
2017-12-17 00:22:38 -08:00
Per Grön d4ab94a6d9 Print result of RPC call in test only when PYTHON_DEBUG is set 2017-12-16 19:24:25 +01:00
Per Grön 8993edfb77 Deduplicate test utility method wait_and_assert_operationid_status
Strictly speaking this is not a true deduplication; the test output will be
slightly different (due to inconsistent print statements) but I think this is
close enough.
2017-12-16 19:24:25 +01:00
Homu 7888624f74 Auto merge of #2795 - str4d:2351-sprout-circuit-value, r=str4d
Track net value entering and exiting the Sprout circuit

Delta values will be stored for new blocks; old blocks can be filled in by
re-indexing. The net value currently in the Sprout circuit is only calculated
when delta values for all previous blocks are present.

Part of #2351.
2017-12-16 02:09:40 -08:00
Homu f44a4cea42 Auto merge of #2790 - bitcartel:2746_payment_disclosure_prefix, r=str4d
Closes #2746. Payment disclosure blobs now use 'zpd:' prefix.
2017-12-15 10:31:58 -08:00
Jay Graber 73b220cb0f Add rpc test that exercises z_importkey 2017-12-15 10:15:50 -08:00
Jack Grigg e319633435
Add Sprout value pool to getblock and getblockchaininfo 2017-12-14 22:06:15 +00:00
Simon 61345ae703 Closes #2746. Payment disclosure blobs now use 'zpd:' prefix. 2017-12-07 10:11:43 -08:00
Homu 019c4bddc8 Auto merge of #2741 - bitcartel:stop_dumpwallet_overwriting, r=str4d
Prevent RPC calls dumpwallet and z_exportwallet from overwriting an existing file

Closes #2740
2017-12-04 09:41:52 -08:00
Simon 159aa37fc0 Closes #2759. Fixes broken pipe error with QA test wallet.py. 2017-11-22 00:02:52 -08:00
Simon ba1dbb3040 RPC dumpwallet and z_exportwallet updated to no longer allow
overwriting an existing file.
2017-11-16 22:29:37 -08:00
Simon 45232b1961 Add payment disclosure as experimental feature. 2017-11-14 13:29:05 -08:00
Simon 337bca8125 Fix an issue where qa test wallet_shieldcoinbase could hang.
The mempool was not synced so a block could be generated and not
clear out the mempool.  This would then cause subsequent code
which expected the mempool of all nodes to be empty to hang.
2017-11-03 00:39:23 -07:00
Homu 3775ac5250 Auto merge of #2692 - bitcartel:2639_enable_z_shieldcoinbase, r=str4d
Closes #2639. z_shieldcoinbase is now supported, no longer experimental.

This reverts commit 5023af7bd5.
2017-11-02 00:18:40 -07:00