zcash/qa/rpc-tests
Kris Nuttycombe 646ab61713 Disable macos CI runners.
At this point, we are not going to take the time to enable tier-3
platforms. Users desiring to use these platforms should migrate to
zebrad instead.
2024-08-27 09:30:00 -06:00
..
cache Add persistent example of corrupted Orchard wallet state post v5.6.0 2023-06-21 12:42:24 -06:00
golden Add constants & configuration for NU6. 2024-08-07 15:15:56 -06:00
test_framework Disable macos CI runners. 2024-08-27 09:30:00 -06:00
.gitignore Document the Sprout cache used for RPC tests 2023-05-11 11:22:33 -06:00
README.md [qa] Split README.md to /qa and /qa/rpc-tests 2020-11-21 02:33:27 +00:00
addressindex.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
bip65-cltv-p2p.py Ensure that `create_coinbase` can work on regtest after various 2024-08-21 11:28:36 +01:00
bipdersig-p2p.py Ensure that `create_coinbase` can work on regtest after various 2024-08-21 11:28:36 +01:00
blockchain.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
coinbase_funding_streams.py Change constant names for funding streams added in NU6 to match ZIP 214. 2024-08-26 22:26:37 +01:00
converttex.py Apply suggestions from code review 2024-05-16 13:40:55 -06:00
create_cache.py scripted-diff: Add 2020-2022 copyright headers for files added/modified in 2020 2022-05-11 17:32:39 -06:00
decodescript.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
disablewallet.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
errors.py Better error for “wrong number of params” in RPC 2023-05-18 19:53:30 -06:00
feature_logging.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
feature_walletfile.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
feature_zip221.py Fix finalorchardroot serialization 2022-09-22 18:20:42 -06:00
feature_zip239.py Disable macos CI runners. 2024-08-27 09:30:00 -06:00
feature_zip244_blockcommitments.py Fix bugs in testnet Orchard circuit 2021-09-28 22:56:37 +01:00
finalorchardroot.py rust: Migrate to `zcash_primitives 0.14.0` 2024-03-25 13:27:45 -06:00
finalsaplingroot.py rust: Migrate to `zcash_primitives 0.14.0` 2024-03-25 13:27:45 -06:00
forknotify.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
framework.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
fundrawtransaction.py Fix some messages, comments, and documentation that: 2023-04-17 18:49:45 +01:00
getblocktemplate.py Update Python code to work, and avoid deprecation warnings, on Python 3.12. 2024-08-20 13:21:46 +01:00
getblocktemplate_longpoll.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
getblocktemplate_proposals.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
getchaintips.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
getmininginfo.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
getrawtransaction_insight.py Disable previously-deprecated features by default 2023-01-05 22:32:19 +00:00
hardforkdetection.py python: Explicitly set encoding to utf8 when opening text files 2020-11-09 23:06:21 +00:00
httpbasics.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
invalidateblock.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
invalidblockrequest.py Ensure that `create_coinbase` can work on regtest after various 2024-08-21 11:28:36 +01:00
invalidtxrequest.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
key_import_export.py Disable previously-deprecated features by default 2023-01-05 22:32:19 +00:00
keypool.py Fix typos 2024-04-11 13:26:47 -06:00
listtransactions.py Disable previously-deprecated features by default 2023-01-05 22:32:19 +00:00
maxblocksinflight.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
maxuploadtarget.py Add a clock for testing with an offset from the system clock. 2022-07-14 16:33:54 -06:00
mempool_limit.py Change ZIP 401 mempool limiting to use constants decided in zcash/zips#565. 2023-04-16 23:04:57 +01:00
mempool_nu_activation.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
mempool_packages.py test: Set `-limitdescendantcount` to match viable iteration limit 2023-06-23 16:34:46 +00:00
mempool_reorg.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
mempool_resurrect_test.py Rename DEFAULT_FEE to LEGACY_DEFAULT_FEE in C++ code and RPC tests. 2023-04-26 02:09:16 +01:00
mempool_spendcoinbase.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
mempool_tx_expiry.py Rename DEFAULT_FEE to LEGACY_DEFAULT_FEE in C++ code and RPC tests. 2023-04-26 02:09:16 +01:00
mergetoaddress_helper.py Strengthen AllowRevealedSenders 2023-06-02 18:40:18 -06:00
mergetoaddress_mixednotes.py Update z_mergetoaddress to use WalletTxBuilder 2023-04-19 22:26:42 -06:00
mergetoaddress_sapling.py Support UA destinations in `z_mergetoaddress` 2023-04-24 18:11:26 -06:00
mergetoaddress_ua_nu5.py test: Fix copyright years in new RPC tests 2023-04-25 11:59:38 +01:00
mergetoaddress_ua_sapling.py test: Fix copyright years in new RPC tests 2023-04-25 11:59:38 +01:00
merkle_blocks.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
mining_shielded_coinbase.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
multi_rpc.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
nodehandling.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
nuparams.py Add `getblocksubsidy` checks to `nuparams` test. 2023-06-21 11:42:45 -06:00
orchard_reorg.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
p2p-acceptblock.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
p2p-fullblocktest.py Ensure that `create_coinbase` can work on regtest after various 2024-08-21 11:28:36 +01:00
p2p_node_bloom.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
p2p_nu_peer_management.py Standard py2 to py3 updates 2020-02-09 08:14:21 -08:00
p2p_txexpiringsoon.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
p2p_txexpiry_dos.py Disable previously-deprecated features by default 2023-01-05 22:32:19 +00:00
post_heartwood_rollback.py [qa] Remove hardcoded "4 nodes" from test_framework 2020-11-21 02:34:47 +00:00
prioritisetransaction.py Transactions paying less than the ZIP 317 conventional fee to the extent 2023-05-18 19:13:45 +01:00
proxy_test.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
pruning.py Fix some messages, comments, and documentation that: 2023-04-17 18:49:45 +01:00
rawtransactions.py Fix some messages, comments, and documentation that: 2023-04-17 18:49:45 +01:00
receivedby.py Fix typos 2022-11-25 23:09:48 +02:00
regtest_signrawtransaction.py Rename DEFAULT_FEE to LEGACY_DEFAULT_FEE in C++ code and RPC tests. 2023-04-26 02:09:16 +01:00
reindex.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
remove_sprout_shielding.py Update z_mergetoaddress to use WalletTxBuilder 2023-04-19 22:26:42 -06:00
reorg_limit.py test: Adjust some Zcash RPC tests to work with parallel runner 2020-11-21 03:03:58 +00:00
rest.py Disable previously-deprecated features by default 2023-01-05 22:32:19 +00:00
rewind_index.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
rpcbind_test.py Correct the documentation of `-rpcconnect` in the example `zcash.conf`. 2023-04-09 15:21:33 +01:00
sapling_rewind_check.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
shorter_block_times.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
show_help.py Transactions paying less than the ZIP 317 conventional fee to the extent 2023-05-18 19:13:45 +01:00
signrawtransaction_offline.py Rename DEFAULT_FEE to LEGACY_DEFAULT_FEE in C++ code and RPC tests. 2023-04-26 02:09:16 +01:00
signrawtransactions.py Replace setup_clean_chain with cache_behavior in rpc test init. 2022-07-18 09:00:34 -06:00
spentindex.py Disable previously-deprecated features by default 2023-01-05 22:32:19 +00:00
sprout_sapling_migration.py Rename DEFAULT_FEE to LEGACY_DEFAULT_FEE in C++ code and RPC tests. 2023-04-26 02:09:16 +01:00
threeofthreerestore.py Disable previously-deprecated features by default 2023-01-05 22:32:19 +00:00
timestampindex.py update to py3 conventions, update range to return list for py3 2020-02-09 08:14:21 -08:00
turnstile.py Use __func__ for substitution in `ConnectBlock` error messages. 2024-08-21 03:54:23 +01:00
tx_expiry_helper.py ProcessGetData: Respond to MSG_WTX requests 2021-09-10 21:46:05 +01:00
txn_doublespend.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
upgrade_golden.py Make use of the 'filter' option to `tarfile.extractall` conditional on 2024-08-21 02:12:35 +01:00
wallet.py Repair some RPC tests. 2023-04-19 22:48:46 +01:00
wallet_1941.py Rename DEFAULT_FEE to LEGACY_DEFAULT_FEE in C++ code and RPC tests. 2023-04-26 02:09:16 +01:00
wallet_accounts.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
wallet_addresses.py Disable previously-deprecated features by default 2023-01-05 22:32:19 +00:00
wallet_anchorfork.py Rename DEFAULT_FEE to LEGACY_DEFAULT_FEE in C++ code and RPC tests. 2023-04-26 02:09:16 +01:00
wallet_broadcast.py Disable previously-deprecated features by default 2023-01-05 22:32:19 +00:00
wallet_changeaddresses.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
wallet_changeindicator.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
wallet_db_flush.py fix pyflakes CI errors 2020-07-02 14:32:48 -06:00
wallet_deprecation.py Work around one of the race conditions in the `wallet_deprecation` test. 2024-08-21 02:12:40 +01:00
wallet_doublespend.py Merge pull request #6404 from sellout/clarify-doublespend-test 2023-05-23 13:50:59 +01:00
wallet_golden_5_6_0.py Update wallet_golden_5_6_0 test to fail due to Orchard wallet parsing errors. 2023-06-21 12:42:24 -06:00
wallet_import_export.py Disable previously-deprecated features by default 2023-01-05 22:32:19 +00:00
wallet_isfromme.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
wallet_listnotes.py Rename DEFAULT_FEE to LEGACY_DEFAULT_FEE in C++ code and RPC tests. 2023-04-26 02:09:16 +01:00
wallet_listreceived.py wallet_listreceived.py: fix an assertion message and remove unnecessary use of LEGACY_DEFAULT_FEE. 2023-06-08 10:23:45 +01:00
wallet_listunspent.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
wallet_nullifiers.py Rename DEFAULT_FEE to LEGACY_DEFAULT_FEE in C++ code and RPC tests. 2023-04-26 02:09:16 +01:00
wallet_orchard.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
wallet_orchard_change.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
wallet_orchard_init.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
wallet_orchard_persistence.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
wallet_orchard_reindex.py Try to reduce the incidence of some RPC test race conditions. 2024-08-21 23:45:59 +01:00
wallet_overwintertx.py Rename DEFAULT_FEE to LEGACY_DEFAULT_FEE in C++ code and RPC tests. 2023-04-26 02:09:16 +01:00
wallet_parsing_amounts.py Adjust wallet absurd fee check for ZIP 317 2023-04-13 19:16:09 -06:00
wallet_persistence.py Fix tests that failed due to the minimum relay fee being enforced. 2023-04-17 18:49:45 +01:00
wallet_sapling.py Rename DEFAULT_FEE to LEGACY_DEFAULT_FEE in C++ code and RPC tests. 2023-04-26 02:09:16 +01:00
wallet_sendmany_any_taddr.py Improve handling of UAs as account proxies 2023-06-05 22:33:49 +01:00
wallet_shieldcoinbase.py Strengthen AllowRevealedSenders 2023-06-02 18:40:18 -06:00
wallet_shieldcoinbase_sapling.py allow UA as z_shieldcoinbase destination 2022-02-03 08:31:26 -07:00
wallet_shieldcoinbase_ua_nu5.py Disable previously-deprecated features by default 2023-01-05 22:32:19 +00:00
wallet_shieldcoinbase_ua_sapling.py Disable previously-deprecated features by default 2023-01-05 22:32:19 +00:00
wallet_shieldingcoinbase.py Update Python code to work, and avoid deprecation warnings, on Python 3.12. 2024-08-20 13:21:46 +01:00
wallet_tarnished_5_6_0.py Add a test demonstrating inability to spend from the tarnished state. 2023-06-21 12:42:24 -06:00
wallet_treestate.py Rename DEFAULT_FEE to LEGACY_DEFAULT_FEE in C++ code and RPC tests. 2023-04-26 02:09:16 +01:00
wallet_unified_change.py Rename DEFAULT_FEE to LEGACY_DEFAULT_FEE in C++ code and RPC tests. 2023-04-26 02:09:16 +01:00
wallet_z_sendmany.py Improve handling of UAs as account proxies 2023-06-05 22:33:49 +01:00
wallet_zero_value.py Disable previously-deprecated features by default 2023-01-05 22:32:19 +00:00
walletbackup.py Disable previously-deprecated features by default 2023-01-05 22:32:19 +00:00
zapwallettxes.py Try to reduce the incidence of some RPC test race conditions. 2024-08-21 23:45:59 +01:00
zkey_import_export.py Rename DEFAULT_FEE to LEGACY_DEFAULT_FEE in C++ code and RPC tests. 2023-04-26 02:09:16 +01:00
zmq_test.py Disable previously-deprecated features by default 2023-01-05 22:32:19 +00:00

README.md

Regression tests

test_framework/test_framework.py

Base class for RPC regression tests.

test_framework/util.py

Generally useful functions.

test_framework/mininode.py

Basic code to support p2p connectivity to a bitcoind.

test_framework/comptool.py

Framework for comparison-tool style, p2p tests.

test_framework/script.py

Utilities for manipulating transaction scripts (originally from python-bitcoinlib)

test_framework/blockstore.py

Implements disk-backed block and tx storage.

test_framework/key.py

Wrapper around OpenSSL EC_Key (originally from python-bitcoinlib)

test_framework/bignum.py

Helpers for script.py

test_framework/blocktools.py

Helper functions for creating blocks and transactions.

P2P test design notes

Mininode

  • mininode.py contains all the definitions for objects that pass over the network (CBlock, CTransaction, etc, along with the network-level wrappers for them, msg_block, msg_tx, etc).

  • P2P tests have two threads. One thread handles all network communication with the bitcoind(s) being tested (using python's asyncore package); the other implements the test logic.

  • NodeConn is the class used to connect to a bitcoind. If you implement a callback class that derives from NodeConnCB and pass that to the NodeConn object, your code will receive the appropriate callbacks when events of interest arrive. NOTE: be sure to call self.create_callback_map() in your derived classes' __init__ function, so that the correct mappings are set up between p2p messages and your callback functions.

  • You can pass the same handler to multiple NodeConn's if you like, or pass different ones to each -- whatever makes the most sense for your test.

  • Call NetworkThread.start() after all NodeConn objects are created to start the networking thread. (Continue with the test logic in your existing thread.)

  • RPC calls are available in p2p tests.

  • Can be used to write free-form tests, where specific p2p-protocol behavior is tested. Examples: p2p-accept-block.py, maxblocksinflight.py.

Comptool

  • Testing framework for writing tests that compare the block/tx acceptance behavior of a bitcoind against 1 or more other bitcoind instances, or against known outcomes, or both.

  • Set the num_nodes variable (defined in ComparisonTestFramework) to start up 1 or more nodes. If using 1 node, then --testbinary can be used as a command line option to change the bitcoind binary used by the test. If using 2 or more nodes, then --refbinary can be optionally used to change the bitcoind that will be used on nodes 2 and up.

  • Implement a (generator) function called get_tests() which yields TestInstances. Each TestInstance consists of:

    • a list of [object, outcome, hash] entries
      • object is a CBlock, CTransaction, or CBlockHeader. CBlock's and CTransaction's are tested for acceptance. CBlockHeaders can be used so that the test runner can deliver complete headers-chains when requested from the bitcoind, to allow writing tests where blocks can be delivered out of order but still processed by headers-first bitcoind's.
      • outcome is True, False, or None. If True or False, the tip is compared with the expected tip -- either the block passed in, or the hash specified as the optional 3rd entry. If None is specified, then the test will compare all the bitcoind's being tested to see if they all agree on what the best tip is.
      • hash is the block hash of the tip to compare against. Optional to specify; if left out then the hash of the block passed in will be used as the expected tip. This allows for specifying an expected tip while testing the handling of either invalid blocks or blocks delivered out of order, which complete a longer chain.
    • sync_every_block: True/False. If False, then all blocks are inv'ed together, and the test runner waits until the node receives the last one, and tests only the last block for tip acceptance using the outcome and specified tip. If True, then each block is tested in sequence and synced (this is slower when processing many blocks).
    • sync_every_transaction: True/False. Analogous to sync_every_block, except if the outcome on the last tx is "None", then the contents of the entire mempool are compared across all bitcoind connections. If True or False, then only the last tx's acceptance is tested against the given outcome.
  • For examples of tests written in this framework, see invalidblockrequest.py and p2p-fullblocktest.py.