Commit Graph

222 Commits

Author SHA1 Message Date
Jack Grigg fd49f78042 wallet: Check spent shielded notes in CWalletTx::IsFromMe
The "IsFromMe" logic was implemented in several places in the Bitcoin
Core wallet. We had correctly updated CWallet::IsFromMe(CTransaction)
(which was used in most places in the wallet) to check for shielded
notes being spent, but did not notice that CWalletTx::IsFromMe also
needed this check.

This bug has existed since before Zcash launched. It went unnoticed
because CWalletTx::IsFromMe was previously only called from code
used to either create purely-transparent transactions, or provide
informational output on non-critical RPC methods.

Closes zcash/zcash#5325.
2021-09-28 02:51:04 +01:00
Jack Grigg 9476f5d7ef ProcessGetData: Respond to MSG_WTX requests 2021-09-10 21:46:05 +01:00
Wladimir J. van der Laan d9cb6b89b0 test: Add basic test for `reject` code
Extend P2P test framework to make it possible to expect reject
codes for transactions and blocks.

(cherry picked from commit bitcoin/bitcoin@20411903d7)
2021-08-13 16:49:46 +01:00
Jack Grigg 2d0a8f1f3a test: Check for valid hashBlockCommitments construction post-NU5 2021-06-18 01:05:04 +01:00
Jack Grigg c592bf7da0 python: Use UTF-8 encodings for opened files 2021-04-14 13:19:33 +12:00
Suhas Daftuar a0ca4116c1 Add RPC test for -maxuploadtarget 2021-02-17 19:23:38 +00:00
Alfredo Garcia 77db54764a split wallet.py tests 2020-12-29 14:42:46 -03:00
Daira Hopwood 5e84362702 Reduce the default fee for z_* operations, and the "low fee penalty" threshold for mempool limiting, to 1000 zatoshis.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-12-18 12:37:03 -07:00
Dimitris Apostolou f459e43dc9
Update links 2020-12-13 11:24:44 +02:00
Jack Grigg a7370b112e test: Run shielding-heavy RPC tests in serial 2020-12-02 13:52:08 +00:00
Jack Grigg 3a91bcfac5 test: Silence pyflakes unused import warning
rpc-tests.py trial-imports zmq to determine whether it is available.
2020-12-02 01:01:50 +00:00
MarcoFalke 01449d8a3d qa: Set correct path for binaries in rpc tests 2020-11-21 03:03:58 +00:00
John Newbery bc644280bf Add exclude option to rpc-tests.py 2020-11-21 03:03:58 +00:00
John Newbery 4f4f8d5ad7 Various review markups for rpc-tests.py improvements 2020-11-21 03:03:15 +00:00
John Newbery 6aad43b63f Refactor rpc-tests.py
- add main()
- remove global variables
2020-11-21 03:03:15 +00:00
John Newbery cc099b3b7b Improve rpc-tests.py arguments
A few miscellaneous improvements to rpc-tests.py command line arguments:

 - make all arguments start with double dash for consistency
 - improve help text and output
 - add nozmq argument to explicitly exclude the ZMQ tests
 - change 'parallel' to 'jobs'
2020-11-21 03:03:15 +00:00
John Newbery 389b70cafe Use argparse in rpc_tests.py
This commit replaces the roll-your-own argument parsing in rpc_tests.py
with Python's standard library argparse.
2020-11-21 03:03:15 +00:00
John Newbery 41c2bc1e05 Use configparser in rpc-tests.py
Remove the use of wildcard imports in rpc-tests.py and replace with
configparser.
2020-11-21 03:03:15 +00:00
Alex Morcos 2eab4f7503 remove obsolete run-bitcoind-for-test.sh 2020-11-21 03:03:15 +00:00
Alex Morcos 3accdb2fc7 Reorder RPC tests for running time 2020-11-21 03:03:15 +00:00
MarcoFalke 8b3c39ea80 [qa] rpc-tests: Apply random offset to portseed
This helps to skip over resources, which are blocked by regtest bitcoind
zombie nodes
2020-11-21 03:03:15 +00:00
MarcoFalke d014a30566 [qa] pull-tester: Only print output when failed 2020-11-21 03:03:15 +00:00
MarcoFalke bcbf03ebe9 [qa] Refactor RPCTestHandler to prevent TimeoutExpired 2020-11-21 03:03:15 +00:00
MarcoFalke 4500a75346 [qa] pull-tester: Don't mute zmq ImportError
Zcash: We didn't backport the mute, so this is just conflict removal.
2020-11-21 03:02:41 +00:00
MarcoFalke e4d1dcc753 [qa] Remove unused code 2020-11-21 03:02:41 +00:00
MarcoFalke b25a63593e [qa] Use single cache dir for chains 2020-11-21 03:02:41 +00:00
MarcoFalke 7366e81375 [qa] pull-tester: Start longest test first 2020-11-21 02:34:47 +00:00
MarcoFalke fd7689ff07 [qa] pull-tester: Fix assertion and check for run_parallel 2020-11-21 02:34:47 +00:00
Cory Fields ecf9d8eb2b build: a few ugly hacks to get the rpc tests working out-of-tree
- Link pull-tester/rpc-tests.py to the build dir
- Add the build-dir's config to the python path so that tests can find it
- The tests themselves are in srcdir
- Clean up __pycache__ in 'make clean'
2020-11-21 02:34:47 +00:00
MarcoFalke 5a12bc9d83 [qa] Add option --portseed to test_framework 2020-11-21 02:33:27 +00:00
MarcoFalke cbe91ea855 [qa] pull-tester: Run rpc test in parallel 2020-11-21 02:33:27 +00:00
MarcoFalke 0d8a62925a [qa] pull-tester: Adjust comment 2020-11-21 02:33:27 +00:00
MarcoFalke 08256c9ec6 [qa] Refactor test_framework and pull tester
* log to stdout
* increase range for p2p and rpc ports
* UPPERCASE_CONSTANTS
* Stop nodes on CTRL+C
2020-11-21 02:33:27 +00:00
MarcoFalke 15721275d0 [qa] Switch to py3
Zcash: We already did this, so most of the backported changes are
ancillary (license header updates and style), but a few are relevant.
2020-11-21 02:33:27 +00:00
MarcoFalke d362b632bf [qa] rpc-tests: Fix link in comment and label error msg 2020-11-21 02:33:27 +00:00
MarcoFalke cc44368315 [qa] pull-tester: Exit early when no tests are run 2020-11-21 02:33:27 +00:00
MarcoFalke e7a6c49c00 [qa] pull-tester: Don't mute zmq ImportError 2020-11-21 02:33:27 +00:00
MarcoFalke 65a6249d41 [qa] Use python2/3 syntax 2020-11-21 02:33:27 +00:00
Elliot Olds 845b31a760 Check if zmq is installed in tests, update docs
If ZMQ is enabled, check whether it's installed before running ZMQ tests.
If it isn't, disable ZMQ and print a warning.

Also add dependency info to test docs, so users know ZMQ is required
before running tests, and so they know how to install it.

When following the build instructions before this change then trying
to run the RPC tests, a unix user would get an error when python
tried to import zmq.

There may be other dependencies that should be added to the docs,
particularly ones for non-unix systems. This is the only unlisted
dependency I encountered using linux.
2020-11-21 02:33:27 +00:00
Wladimir J. van der Laan 239857d7d9 test: don't override BITCOIND and BITCOINCLI if they're set
In rpc-tests.py, don't override BITCOIND and BITCOINCLI if they're
already set. Makes it possible to run the tests with either another tree
or the GUI.
2020-11-21 02:33:27 +00:00
MarcoFalke fb1f76f330 [qa] pull-tester: Cleanup (run keypool, tidy stdout)
* Run keypool (takes 6 seconds)
* Print duration of each rpc test
* Structure output (bold, new lines)
2020-11-21 02:33:27 +00:00
Suhas Daftuar 800bf0a45f Remove unmaintained example test script_test.py 2020-11-21 02:33:27 +00:00
James O'Beirne eaf4dfe280 Add basic coverage reporting for RPC tests
Thanks to @MarcoFalke @dexX7 @laanwj for review.

Zcash: Just the --coverage flag for rpc-tests.py, as we backported the
rest of the coverage backend in zcash/zcash#4411.
2020-11-21 02:33:27 +00:00
MarcoFalke 760e500811 [rpc-tests] Check return code 2020-11-20 03:32:53 +00:00
James O'Beirne 480f1bf43e Add tests for gettxoutsetinfo, CLevelDBBatch, CLevelDBIterator
Thanks @dexX7.

Zcash: Rest of this commit was cherry-picked in zcash/zcash#2598.
2020-11-20 03:32:53 +00:00
Jeff Garzik 6618580194 qa/pull-tester/rpc-tests.py: chmod 0755
Fix file mode to be executable.

Include dummy whitespace change to force git to change mode.
2020-11-20 03:32:53 +00:00
ptschip 772d780730 Migrated rpc-tests.sh to all python rpc-tests.py
1) created rpc-tests.py
2) deleted rpc-tests.sh
3) travis.yml points to rpc-tests.py
4) Modified Makefile.am
5) Updated README.md
6) Added tests_config.py and deleted tests-config.sh
7) Modified configure.ac with script to set correct path in tests_config.py

Zcash: Migrated our test list over, and other necessary modifications.
The UI changes were not migrated.
2020-11-20 03:32:53 +00:00
Casey Rodarmor 4761c9f2bc Add p2p-fullblocktest.py
Zcash: Includes pyflakes changes.
2020-11-20 03:32:53 +00:00
Homu c9672a49c2 Auto merge of #4696 - str4d:3640-z_sendmany-any-taddr, r=str4d
wallet: Add ANY_TADDR special string to z_sendmany

When using this special string as the from address, non-coinbase 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-09-22 18:09:58 +00:00
Alfredo Garcia 6a7cfdea54 allow wallet file to be outside datadir 2020-09-04 14:50:17 +01:00