Commit Graph

14474 Commits

Author SHA1 Message Date
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
MarcoFalke db27db2e43 [qa] keypool: DRY: Use test framework 2020-11-21 02:33:27 +00:00
MarcoFalke fa44509d6c [qa] keypool: Fix white space to prepare transition to test framework 2020-11-21 02:33:27 +00:00
MarcoFalke 01c36295c4 [qa] Extend README.md 2020-11-21 02:33:27 +00:00
MarcoFalke 80b2274ddf [qa] Split README.md to /qa and /qa/rpc-tests
+ Update with new -help message
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
Wladimir J. van der Laan 5832635532 build: don't distribute tests_config.py
This file is dynamically generated by configure based on the platform,
it doesn't belong in the distribution archive.

Fixes #6929.
2020-11-21 02:33:27 +00:00
MarcoFalke 760e500811 [rpc-tests] Check return code 2020-11-20 03:32:53 +00:00
MarcoFalke 6aa4f19e87 [rpc-tests] fundrawtransaction: Update fee after minRelayTxFee increase
Zcash: Added floor, since our minRelayTxFee is actually lower.
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
MarcoFalke 8e58eddab1 [doc] trivial: fix markdown syntax in qa/rpc-tests/README.md 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
Daniel Kraft 95d1f887ca Fix crash when mining with empty keypool.
Since the introduction of the ScriptForMining callback, the mining
functions (setgenerate and generate) crash with an assertion failure
(due to a NULL pointer script returned) if the keypool is empty.  Fix
this by giving a proper error.

Zcash: Adapted to our MinerAddress type.

Co-authored-by: Jack Grigg <jack@electriccoin.co>
2020-11-20 03:30:37 +00:00
Homu 877212414a Auto merge of #4745 - nathan-at-least:autoconf-require-prog, r=str4d
configure.ac: Introduce macros to simplify requiring tools.

## what

Introduce two `ZC_REQUIRE_(PROG|TOOL)` macros that are like `AC_PATH_(PROG|TOOL)` except they immediately error out if the target program is not detected.

Then require almost all programs, except for two known optional cases: three programs required only if `--with-lcov` is given, and then `ccache` which has exceptional logic (The equivalent of "--enable-ccache=auto" by default, with explicit 'yes' or 'no' possible, each with different detection needs.)

## why

Provide early explicit errors for build misconfigurations. Hopefully this should never hit our "standard official flow" which relies on the `./zcutil/build.sh` path, though it may come into play for anyone experimenting with the build system or altering dependencies.

### background motivation

While prototyping a nix build system I didn't provide the `cargo` program to the `zcashd` build process. `./configure` happily exited with a success value, but the build system was instantiated with the `CARGO` make / shell variable set to the empty string, which lead to a strange command execution where a long command of `… $CARGO build …` became `…  build …`, so bash looked for a program named `build`. I spent a bit too long looking for where "build" was defined in our dependencies. 😆
2020-11-20 01:03:29 +00:00
Nate Wilcox da081de356 configure.ac: Introduce macros to simplify requiring tools. 2020-11-20 00:59:43 +00:00
Homu bf70e357cf Auto merge of #4553 - oxarbitrage:issue4356, r=daira
Return address in z_importviewingkey error

Closes https://github.com/zcash/zcash/issues/4536.
2020-11-19 17:49:58 +00:00
Kris Nuttycombe 9a5f9bf5ee
Merge branch 'master' into issue4356 2020-11-19 07:22:39 -07:00
Homu 10b09d483e Auto merge of #4793 - str4d:faster-rpc-tests, r=str4d
test: Use default shielded address in RPC tests where the type is irrelevant

This means we are running these tests against the recommended functionality,
and that these RPC tests will now use the faster Sapling addresses.
2020-11-19 14:15:08 +00:00
Homu 949fdca3a6 Auto merge of #4873 - str4d:rpc-test-blocks, r=str4d
Enable mininodes to construct blocks in RPC tests

Includes changes to disable difficulty adjustment on regtest, cherry-picked from:
- bitcoin/bitcoin#6853
- bitcoin/bitcoin#13046

The ZIP 143/243 logic is ported from https://github.com/zcash-hackworks/zcash-test-vectors
2020-11-18 15:11:49 +00:00
Homu 2cc836680a Auto merge of #4843 - furszy:2020_improving_sendmany_redudant_loops_first_round, r=daira
Improving asyncOp_sendmany redundancies (first round)

Work over async sendmany operation flow. Specifically on the utxo finding, utxo selection, total amount calculation and the tx inputs appending process.  Removed several unneeded for loops over the entire utxo set, re structuring and cleaning the flow.
2020-11-18 13:54:13 +00:00
Jack Grigg 044ff5716e test: Re-enable regtest difficulty adjustment for unit tests that use it 2020-11-18 12:17:57 +00:00
Homu e3974db2d3 Auto merge of #4870 - mdr0id:canopy_smoke_tests_update, r=str4d
Update expected fails for  Sprout txns flows on Canopy

Updating smoke test for Canopy consensus
2020-11-18 11:52:29 +00:00
Jack Grigg a7f9365fb8 test: Set hashFinalSaplingRoot default correctly in create_block 2020-11-18 11:12:09 +00:00
Jack Grigg 030a685392 test: Fix SignatureHash RPC test helper
- Check validity of inIdx.
- ZIP 143 and 243 support.
2020-11-18 11:11:54 +00:00
Jack Grigg bbed3ecc3c test: Remove FindAndDelete from RPC test framework 2020-11-17 18:48:32 +00:00
Jack Grigg 8bc0a591a0 Revert "remove SignatureHash from python rpc tests"
This reverts commit 910ff448d6.
2020-11-17 18:48:32 +00:00
Jesse Cohen aead91419e [doc][trivial] no retargeting in regtest mode 2020-11-17 18:48:32 +00:00
Eric Lombrozo 03f1d38e04 Added fPowNoRetargeting field to Consensus::Params that disables nBits recalculation.
Zcash: Moved conditional into GetNextWorkRequired(), as we had rewritten
CalculateNextWorkRequired() to not have the necessary information. This
means that CalculateNextWorkRequired() will in unit tests calculate what
regtest would use were the new field not set; this is irrelevant, as only
GetNextWorkRequired() is used directly in consensus rules.
2020-11-17 18:48:32 +00:00
Homu 20dd32fe9b Auto merge of #4871 - rex4539:typos, r=str4d
Fix typo
2020-11-17 14:55:24 +00:00
Dimitris Apostolou 31e220a316
Fix typo 2020-11-17 16:33:31 +02:00
mdr0id 4dc94c954f Update expected fails for Sprout txns flows on Canopy 2020-11-16 15:57:49 -08:00
Homu 33fdb1b4bc Auto merge of #4868 - daira:clean-removes-lib, r=str4d
Windows cross-build generates .lib files, which should be ignored by git and removed by clean

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-11-16 21:34:08 +00:00
Homu 6d856869e9 Auto merge of #4869 - zcash:release-v4.1.1, r=nuttycom
Release v4.1.1

Optimize release build
----------------------
The release build now sets CLAGS/CXXFLAGS to use the -O3 optimization
option, which turns on more optimization flags than the previously used
-O1. This produces a faster build, addressing a performance regression in
v4.1.0.

Correctly report Founders' Reward amount in `getblocktemplate`
--------------------------------------------------------------
This release correctly returns the `foundersreward` field from `getblocktemplate`
output pre-Canopy and removes the field post-Canopy. (The Founders' Reward will
expire exactly as Canopy activates, as specified in [ZIP 207](https://zips.z.cash/zip-0207).)
To obtain information about funding stream amounts, use `getblocksubsidy HEIGHT`,
passing in the height returned by the `getblocktemplate` API.
2020-11-16 18:45:38 +00:00
Kris Nuttycombe 251405491b Add notable changes to release notes for v4.1.1 2020-11-16 10:26:11 -07:00
Kris Nuttycombe 7ec8a9c5f4 make-release.py: Updated release notes and changelog for 4.1.1. 2020-11-16 10:23:40 -07:00
Kris Nuttycombe 092829cf5b make-release.py: Updated manpages for 4.1.1. 2020-11-16 10:23:40 -07:00
Kris Nuttycombe 142328b067 make-release.py: Versioning changes for 4.1.1. 2020-11-16 10:07:07 -07:00
Daira Hopwood f6fc97f35e Windows cross-build generates .lib files, which should be ignored by git and removed by clean.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-11-16 11:03:22 +00:00
Homu 9248cd743b Auto merge of #4864 - daira:go-faster, r=daira
Set release CFLAGS/CXXFLAGS to use -O3.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-11-14 08:15:23 +00:00
Homu 61ebef4095 Auto merge of #4865 - nuttycom:fix/shielded_coinbase_fr_rpc_fields, r=str4d
Correctly report founder's reward amount in getblocktemplate prior to Canopy

Previously this would return incorrect results in the case that the
miner reward was sent to a shielded address. Post-Canopy, the
foundersreward field is removed; this information should be obtained
from getblocksubsidy instead.
2020-11-14 04:24:14 +00:00
Kris Nuttycombe c8a90d9b98
Update getblocktemplate documentation.
Co-authored-by: str4d <thestr4d@gmail.com>
2020-11-13 17:09:29 -07:00
Kris Nuttycombe 1a89167944 Document how to get block subsidy information in getblocktemplate. 2020-11-13 16:36:36 -07:00
Kris Nuttycombe d107cf13b6 Correctly report founder's reward amount in getblocktemplate prior to Canopy
Previously this would return incorrect results in the case that the
miner reward was sent to a shielded address. Post-Canopy, the
foundersreward field is removed; this information should be obtained
from getblocksubsidy instead.
2020-11-13 16:25:37 -07:00
Daira Hopwood a0a87ab413 Set release CFLAGS/CXXFLAGS to use -O3.
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2020-11-13 22:39:17 +00:00