f649bb36c5
(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. |
||
---|---|---|
.. | ||
test_framework | ||
.gitignore | ||
README.md | ||
bip65-cltv-p2p.py | ||
bipdersig-p2p.py | ||
blockchain.py | ||
decodescript.py | ||
disablewallet.py | ||
forknotify.py | ||
fundrawtransaction.py | ||
getblocktemplate.py | ||
getblocktemplate_longpoll.py | ||
getblocktemplate_proposals.py | ||
getchaintips.py | ||
hardforkdetection.py | ||
httpbasics.py | ||
invalidateblock.py | ||
invalidblockrequest.py | ||
key_import_export.py | ||
keypool.py | ||
listtransactions.py | ||
maxblocksinflight.py | ||
mempool_nu_activation.py | ||
mempool_reorg.py | ||
mempool_resurrect_test.py | ||
mempool_spendcoinbase.py | ||
mempool_tx_expiry.py | ||
mempool_tx_input_limit.py | ||
merkle_blocks.py | ||
nodehandling.py | ||
overwinter_peer_management.py | ||
p2p-acceptblock.py | ||
p2p_node_bloom.py | ||
p2p_txexpiry_dos.py | ||
paymentdisclosure.py | ||
prioritisetransaction.py | ||
proton_test.py | ||
proxy_test.py | ||
pruning.py | ||
rawtransactions.py | ||
receivedby.py | ||
reindex.py | ||
reorg_limit.py | ||
rest.py | ||
rewind_index.py | ||
rpcbind_test.py | ||
script_test.py | ||
signrawtransactions.py | ||
smartfees.py | ||
txn_doublespend.py | ||
wallet.py | ||
wallet_1941.py | ||
wallet_anchorfork.py | ||
wallet_mergetoaddress.py | ||
wallet_nullifiers.py | ||
wallet_overwintertx.py | ||
wallet_protectcoinbase.py | ||
wallet_shieldcoinbase.py | ||
wallet_treestate.py | ||
walletbackup.py | ||
zapwallettxes.py | ||
zcjoinsplit.py | ||
zcjoinsplitdoublespend.py | ||
zkey_import_export.py | ||
zmq_test.py |
README.md
Regression tests of RPC interface
test_framework/test_framework.py
Base class for RPC regression tests.
test_framework/util.py
Generally useful functions.
Notes
You can run a single test by calling qa/pull-tester/rpc-tests.sh <testname>
.
Run all possible tests with qa/pull-tester/rpc-tests.sh -extended
.
Possible options:
-h, --help show this help message and exit
--nocleanup Leave bitcoinds and test.* datadir on exit or error
--noshutdown Don't stop bitcoinds after the test execution
--srcdir=SRCDIR Source directory containing bitcoind/bitcoin-cli (default:
../../src)
--tmpdir=TMPDIR Root directory for datadirs
--tracerpc Print out all RPC calls as they are made
If you set the environment variable PYTHON_DEBUG=1
you will get some debug output (example: PYTHON_DEBUG=1 qa/pull-tester/rpc-tests.sh wallet
).
A 200-block -regtest blockchain and wallets for four nodes is created the first time a regression test is run and is stored in the cache/ directory. Each node has the miner subsidy from 25 mature blocks (25*10=250 ZEC) in its wallet.
After the first run, the cache/ blockchain and wallets are copied into a temporary directory and used as the initial test state.
If you get into a bad state, you should be able to recover with:
rm -rf cache
killall zcashd