Commit Graph

222 Commits

Author SHA1 Message Date
Jack Grigg 06d44392be wallet: Add ANY_TADDR special string to z_sendmany
When using this special string as the from address, UTXOs from any
transparent addresses within the wallet will be used to fund the
transaction. Change outputs will be sent to a new transparent address,
as with any other spend of transparent funds.

Closes zcash/zcash#3640.
2020-08-29 01:39:30 +01:00
Kris Nuttycombe 0391809da1 Remove amqp code and Proton library depenencies & flags. 2020-07-31 13:08:18 -06:00
Homu 959f5b09d0 Auto merge of #4560 - str4d:zip-207, r=nuttycom
[ZIP 207] Funding Streams + [ZIP 214] Dev Fund Recipients

Closes #4554. Closes #4555.
2020-07-10 22:45:11 +00:00
Homu 3f4a532588 Auto merge of #4573 - LarryRuane:issue4301-CopyPreviousWitnesses, r=daira
Flush witness data to disk only when it's consistent

Closes #4301. Running this PR's code will not repair a data directory that has been affected by this problem; that requires starting zcashd with the `-rescan` or `-reindex` options.
2020-07-09 11:50:41 +00:00
Kris Nuttycombe 436dee90de Merge remote-tracking branch 'upstream/master' into zip-207 2020-07-08 15:04:32 -06:00
therealyingtong 5e4d13b49d Add RPC tests
Test that Sprout shielding is accepted before Canopy and rejected after Canopy activation
2020-07-02 00:27:14 +08:00
Jack Grigg efd04b920b Implement zip-207 and zip-214.
Add funding streams to consensus parameters.

Add funding stream payments to coinbase txns generated by the miner.
* Reduce valueBalance for shielded outputs to funding streams.
* Ensure we produce binding signatures in any case where shielded
  outputs go to either a funding stream or the miner.
2020-06-25 16:15:50 -06:00
Larry Ruane 6335944784 add python test to reproduce bug 4301 2020-06-24 09:27:11 -06:00
Wladimir J. van der Laan 4de0ac3351 test: Add test for `-debuglogfile` 2020-05-28 10:58:04 -03:00
therealyingtong 06ddf659a7 Add RPC tests for post-Heartwood rollback 2020-05-28 09:54:42 +12:00
Kris Nuttycombe 9061f8251e Merge remote-tracking branch 'upstream/master' into hotfix-v2.1.2-2-golden 2020-05-14 12:24:44 -06:00
Kris Nuttycombe 8542522732 Merge branch 'release/v2.1.1-1' into release/v2.1.2 2020-05-07 19:02:45 -06:00
Kris Nuttycombe a546caffc9 Add baseline for golden testing across network upgrade boundaries. 2020-05-07 16:34:44 -06:00
Kris Nuttycombe 5a8f6f8058 Merge remote-tracking branch 'upstream/master' into bug/4119-rewind_detection 2020-04-22 14:58:11 -06:00
Kris Nuttycombe f432ceff31 Add a test reproducing the off-by-one error. 2020-04-14 13:37:40 -06:00
Jack Grigg cb57c17eb6 test: Verify ZIP 221 logic against reference implementation 2020-04-08 08:49:01 +12:00
ptschip 8f863b2817 Enable python tests for Native Windows
1) Multiplatorm support for devnull
2) Fixed a bug in the handling of cache files
3) Deleted run-bitcoin-cli as no longer needed
2020-03-24 18:05:30 +13:00
Alfredo Garcia 461047ac99 move check_node_log framework test to a new file 2020-03-10 11:05:49 -03:00
Jack Grigg 675a9b5fd3 test: RPC test for shielded coinbase 2020-03-06 10:41:27 +13:00
Dimitris Apostolou f0003239f8
Change "protect" terminology to "shield" 2019-12-04 23:17:06 +02:00
Gregory Sanders f4d9e06a90
Added additional config option for multiple RPC users. 2019-12-04 17:18:43 +00:00
Eirik Ogilvie-Wigley 1ddc9ff231 Show time elapsed when running RPC tests 2019-10-23 15:04:14 -06:00
Eirik Ogilvie-Wigley ae9ecf09e8 DoS protection: Weighted random drop of txs if mempool full 2019-10-07 14:23:41 -06:00
Jack Grigg 8669cb692d
test: Update RPC tests to use a minimum of Sapling
The p2p_nu_peer_management and rewind_index RPC tests still start from
Sprout, because they are explicitly (and only) testing network behaviour
across network upgrades.

The mempool_tx_input_limit test is removed because the flag has been
ignored since Sapling activation, and will be removed at some point in
the near future.
2019-08-22 17:26:54 +01:00
Eirik Ogilvie-Wigley 94f642c80a Enable shorter block times rpc test 2019-08-16 13:21:33 -06:00
Homu 5fd1f5afc0 Auto merge of #3972 - LarryRuane:3708-getblockhashesrpc, r=str4d
3708 getblockhashesrpc

Part of #3708
2019-08-09 08:00:17 -07:00
Homu 2528af69ff Auto merge of #4025 - bitcartel:shorter_block_target_interval_zip208, r=daira
Implement ZIP 208: Shorter Block Target Spacing

Closes #3690.
2019-08-09 02:35:30 -07:00
Larry Ruane 2e505df351 add timestampindex related RPC getblockhashes 2019-08-08 14:35:07 -06:00
Larry Ruane 86b23f37ad add spentindex RPC for bitcore block explorer 2019-08-07 14:23:42 -06:00
Homu c68511b876 Auto merge of #3926 - LarryRuane:3708-getaddressrpcs, r=str4d
add addressindex RPC for bitcore block explorer

Addresses #3708
2019-08-01 05:43:29 -07:00
Homu 2300b911f8 Auto merge of #4035 - Eirik0:use-committransaction, r=str4d
Use CommitTransaction

This enables `-walletbroadcast` to correctly control transactions created with `z_*` APIs. It also addresses some TODOs in the code and consolidates some repeated logic.

Closes #4077 (because `CommitTransaction` calls `KeepKey` on the transparent change address).
2019-08-01 03:04:06 -07:00
Larry Ruane 68e174e22b add addressindex related RPCs 2019-07-31 10:31:16 -06:00
Jack Grigg 6bc69c39cb
test: Check for change t-addr reuse in z_sendmany 2019-07-31 12:11:14 +01:00
Eirik Ogilvie-Wigley 07851670b4 Temporarily disable test 2019-07-29 15:04:34 -06:00
Eirik Ogilvie-Wigley a63ec6e717 Shorter block times rpc test 2019-07-25 12:49:15 -06:00
Daira Hopwood bc909a7a7f Replace http with https: in links to the MIT license.
Also change MIT/X11 to just MIT, since no distinction was intended.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2019-07-18 15:26:01 +01:00
Larry Ruane f381d4e085 add spentindex to getrawtransaction RPC results 2019-06-11 10:29:51 -06:00
Eirik0 a8055cfe10 Fix z_mergetoaddress sending from ANY_SPROUT/ANY_SAPLING when the wallet contains both note types 2019-06-10 13:21:25 -06:00
Eirik0 81a45d6984 Add rpc to enable and disable Sprout to Sapling migration 2019-04-24 11:31:14 -06:00
Simon d6b47948bf Add qa test for experimental feature: -developersetpoolsizezero 2019-04-23 15:05:15 -07:00
Simon cc1ab2db55 For ZEC-013. Don't propagate txs which are expiring soon in p2p messages.
When responding to "mempool" message, do not include the txid of an
expiring soon transaction in the "inv" message reply.
When responding to "getdata" message, do not reply with a "tx" message
for a transaction which is expiring soon.
2018-11-17 09:02:00 -08:00
Eirik Ogilvie-Wigley e0c491c073 Extend Sprout mergetoaddress rpc test to also work for Sapling 2018-11-16 18:14:57 -07:00
Simon 56765e24cb Add test to verify final sapling root in block header is updated. 2018-10-10 17:30:58 -07:00
Homu c2bb0ec67f Auto merge of #3517 - mdr0id:3388_persist_wallet, r=str4d
Sapling support for persisting wallet to disk

Closes #3388. Closes #3061.
2018-10-08 09:53:34 -07:00
mdr0id 2fcf06077f
Persist Sapling key material in the wallet to disk 2018-10-06 00:01:14 +01:00
mdr0id 87ae893d75
Revert "wallet: Comment out HDSeed and CHDChain persistence to disk"
This reverts commit b7f9a7ae02.
2018-10-05 17:46:43 +01:00
Homu 625797a037 Auto merge of #3518 - str4d:3216-z_shieldcoinbase, r=str4d
Add Sapling support to z_shieldcoinbase

Part of #3216.
2018-10-05 03:33:16 -07:00
Jack Grigg 5f91a95641
Add Sapling support to z_shieldcoinbase
Part of #3216.
2018-10-03 12:16:18 +01:00
Jay Graber 011f9a02ef Add rpc test for sprout txs z_listunspent 2018-09-28 15:19:10 -07:00
Larry Ruane e4f0d6a8de Sapling support for z_listreceivedbyaddress 2018-09-27 16:59:29 -06:00
Simon 18f8abb62d Closes #3534. Do not use APPROX_RELEASE_HEIGHT to get consensus branch
id when in regtest mode.

Co-authored-by: Larry Ruane <larryruane@gmail.com>
2018-09-21 11:10:15 -07:00
Homu 36243f41f1 Auto merge of #3520 - Eirik0:3327-sign-offline, r=bitcartel
Fix signing raw transactions with unsynced offline nodes

This PR address the issue in two different ways:

- In `signrawtransaction` we determine the consensus branch ID (which we then later use to construct the transaction) using the chain height. We now also consider the `APPROX_RELEASE_HEIGHT` as this is a better estimation than 0 for the height of the chain if we are unsynced. (This in and of itself solves the Overwinter signing issue).
- We have added an additional parameter to `signrawtransaction` to allow manually overriding the consensus branch ID that zcashd determines we are on. This allows users to work around corner cases where the first strategy is still insufficient.

Closes #3327.
2018-09-19 15:02:52 -07:00
Homu 25c3f903c1 Auto merge of #3491 - Eirik0:3218-sapling-import-export-wallet, r=str4d
Add Sapling support to z_importwallet and z_exportwallet

Includes code adapted from upstream PR https://github.com/bitcoin/bitcoin/pull/8323

Closes #3218.
2018-09-19 12:15:48 -07:00
Eirik Ogilvie-Wigley 19697025c6 Add test for signing raw transactions offline 2018-09-17 10:27:37 -06:00
Eirik Ogilvie-Wigley 5e360fb29f Add sapling spending keys to z_exportwallet 2018-09-14 15:07:15 -06:00
Jack Grigg 8e057ad9ee
qa: Test both Overwinter and Sapling peer management 2018-09-12 12:15:37 +01:00
Jack Grigg b7f9a7ae02
wallet: Comment out HDSeed and CHDChain persistence to disk
Sapling keys generated from the seed are not yet persisted, so we don't
want to persist the seed or chain state either, otherwise the wallet
could end up in an inconsistent state.

Some tests are temporarily disabled because commenting out HDSeed
persistence breaks invariants inside CCryptoKeyStore.

Revert this commit during the PR for #3388.
2018-09-03 10:45:37 +01:00
Jack Grigg e54c4d2ca1
rpcwallet: Add Sapling support to z_sendmany 2018-08-27 11:36:14 +01:00
Jack Grigg eec85c4388
Add Sapling support to z_getnewaddress and z_listaddresses 2018-07-30 16:24:20 +01:00
Eirik Ogilvie-Wigley 0646f749f9 Add change indicator for notes 2018-07-16 14:49:29 -06:00
Jack Grigg b77e46fe01
Add RPC test for -enforcenodebloom 2018-04-05 01:30:38 +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
James O'Beirne 79272bfaf9
Add tests for gettxoutsetinfo, CLevelDBBatch, CLevelDBIterator
Thanks @dexX7.
2018-04-03 20:40:54 +01:00
Jack Grigg fe87fd2b36
Add RPC test of RewindBlockIndex 2018-04-03 10:58:27 +01: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
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 6e9c7629af
Implement z_mergetoaddress for combining UTXOs and notes
Closes #2493.
2018-02-22 13:23:18 +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
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
Jay Graber 73b220cb0f Add rpc test that exercises z_importkey 2017-12-15 10:15:50 -08:00
Simon 45232b1961 Add payment disclosure as experimental feature. 2017-11-14 13:29:05 -08:00
Jack Grigg f8ef223ce3
Un-indent RPC test output in test runner
The indentation caused the test stdout to be buffered and only printed at the
end of the test, which makes it harder to diagnose hanging tests.
2017-10-05 15:18:58 +01:00
Homu f34c60de37 Auto merge of #2615 - bitcartel:2448_shield_coinbase, r=bitcartel
Add RPC command shield_coinbase #2448.

Shield transparent coinbase funds by sending to a shielded z address. Closes #2448.
2017-09-22 12:04:31 -07:00
Simon 06c19063bb Implement RPC shield_coinbase #2448. 2017-09-21 15:04:12 -07:00
Nathan Wilcox d29b6b042f key_import_export rpc-test: verify that UTXO view co-evolves for nodes sharing a key. 2017-09-18 15:30:42 +09:00
Homu 59de56eeca Auto merge of #2342 - bitcartel:1081__mempoolpatch, r=str4d
Add ability for node to reject tx from mempool by number of tx inputs

Implement short-term solution described in #2343 so that users can respond promptly to critical short-term problems caused by quadratic validation scaling, such as the getblocktemplate latency, block propagation latency, and mempool size inflation issues described in #2333.
2017-06-21 14:42:13 -07:00
Jack Grigg 4ef014151d
Additional testing of -mempooltxinputlimit 2017-06-20 15:58:46 +12:00
Daira Hopwood 4a785b0a5b Repair tests for strict DER signatures.
While we're at it, repair a similar test for CLTV, and make the repaired RPC tests run by default.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-06-19 16:32:15 +01:00
Simon 99eb947a98 Add AMQP 1.0 support via Apache Qpid Proton C++ API 0.17.0 2017-03-25 08:51:40 -07:00
Wladimir J. van der Laan 56215c77d8
Fix crash in validateaddress with -disablewallet
Fix a null pointer dereference in validateaddress with -disablewallet. Also add a regression testcase.
2017-03-02 13:26:34 -08:00
Jonas Schnelli 5bfd954fc6
[QA] remove rawtransactions.py from the extended test list
rawtransactions.py is already in the standard test list
2017-03-02 13:23:03 -08:00
mruddy 81ae51c883
add tests for the decodescript rpc. add mention of the rpc regression tests to the testing seciton of the main readme. 2017-03-02 13:23:03 -08:00
Wladimir J. van der Laan bf890b6518
test: Move reindex test to standard tests
This test finishes very quickly, so it should be part of the default set
of tests in rpc-tests.
2017-03-02 13:23:03 -08:00
Jonas Schnelli 788d8e6a6f
fundrawtransaction tests 2017-03-02 13:23:03 -08:00
Jonas Schnelli 2ab237a088
add RPC tests for setban & disconnectnode 2017-03-02 13:23:03 -08:00
zkbot 6ee75b3b7b Auto merge of #2014 - arcalinea:test-prioritisetransaction, r=arcalinea
Test prioritisetransaction

After talking with @str4d about #1884 , I wrote a test for prioritisetransaction. It uses small blocks (11kb), and checks whether a transaction makes it into the next block after being prioritized by that node.

Should this be improved with a larger number of txs in the mempool, or by testing over multiple runs?

As for getblocktemplate(), it seems to return the prioritized transaction within the block size set by the node (about 50 txs fit in an 11kb block), but the block "sizelimit" it displays is set at 2 MB in `rpcmining.cpp` line 690:
```
result.push_back(Pair("sizelimit", (int64_t)MAX_BLOCK_SIZE));
```

This was quite confusing, I didn't think the `-blockmaxsize` parameter I was setting was working for awhile.
2017-03-02 06:47:04 +00:00
Jay Graber cc64e2ccc8 Add rpc test for prioritisetransaction 2017-02-12 11:01:45 -08:00
Jonas Schnelli 9bbc220641
fix rpc-tests.sh
`${testScripts[@]}` now does split up `testscript --agument` in two elements pushed to the array (`testscript` and `--agument`).
2017-02-09 11:53:51 +00:00
Cory Fields cce7754eb8
Depends: Add ZeroMQ package 2017-02-08 22:10:42 +00:00
zkbot 0edb3c0f16 Auto merge of #1978 - str4d:1941-scan-whole-chain-on-zkey-import, r=ebfull
Scan the whole chain whenever a z-key is imported

Closes #1941.
2017-01-20 00:02:12 +00:00
Sean Bowe 620c0e2845 Add test for z_importkey rescanning from beginning of chain. 2017-01-19 16:59:29 -07:00
Jack Grigg 9847bc870d
Create empty zcash.conf during coverage checks
Fixes regression caused by #2013.
2017-01-18 12:11:50 +01:00
Simon 2d931e905b Fixes #1823. Witness anchors for input notes no longer cross block boundaries. 2016-12-03 00:22:42 -08:00