Commit Graph

54 Commits

Author SHA1 Message Date
c5fde12485 qa: port 12 wallet/mining tests to python3 and fix three framework blockers
Ports qa/rpc-tests from 6 python3 files to 18. Ran every ported test against
the freshly built v1.3.0 dragonxd. Results, honestly:

  PASS (1)            getblocktemplate_proposals.py
  NOT APPLICABLE (7)  wallet.py, walletbackup.py, wallet_protectcoinbase.py,
                      wallet_listnotes.py, wallet_mergetoaddress.py,
                      getblocktemplate.py, wallet_shieldcoinbase.py
  BLOCKED (4)         wallet_sapling, wallet_nullifiers, wallet_persistence,
                      wallet_treestate

The "not applicable" seven are inherited Zcash/Hush-era tests that exercise
features DragonX deliberately removed. They assume transparent t->t value
transfer, but ASSETCHAINS_PRIVATE=1 (hush_utils.h:1826) makes sendtoaddress
and sendmany consensus-refuse; they assume Sprout joinsplits, which are gone
from the RPC layer entirely; and they hardcode Bitcoin economics (10 coin/block,
100-block maturity) against DragonX's 3 DRGX and COINBASE_MATURITY=1. They are
ported and left in place rather than deleted, but they cannot pass on this chain
without being rewritten around z_shieldcoinbase/autoshield.

Three framework fixes in test_framework/util.py, each of which broke every
multi-node test:
  - initialize_chain() passed -connect=0, and init.cpp soft-sets -listen=0 when
    -connect is present, so cache node0 never opened its p2p port and nodes 1-3
    could never sync to it -- initialize_chain() hung forever in sync_blocks().
    Now passes -listen=1 -bind=127.0.0.1 -dnsseed=0 explicitly (an explicit arg
    beats SoftSetBoolArg) while keeping the cache nodes off the public network.
  - cache cleanup removed files from <datadir> when dragonxd writes them one
    level deeper into the net-specific <datadir>/regtest.
  - set_node_times() did print("..." + t) with t an int -> TypeError.
  - default binary paths corrected to src/dragonxd and src/dragonx-cli.

The four BLOCKED tests are blocked by a daemon assert, not by the port; see the
follow-up commit/report on BLOCK_VALID_CONTEXT.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FU87LdsJZiZkfq1eXubpeo
2026-08-31 01:53:43 -05:00
4cc7e0491a qa: finish the python3 port far enough to build the shared test chain
Follow-up to 5e0a70683, which got start_node() working. Three more
defects sat behind it:

- initialize_chain() builds the 4-node cache with its own daemon
  invocation, which 5e0a70683 did not touch. It therefore still omitted
  -regtest (so those cache nodes ran on MAINNET) and -asmap (so they
  refused to start at all). Every test that uses the cache -- which is
  most of the wallet suite -- died there.

- reindex.py and getblocktemplate_longpoll.py each carried a single
  python2 print statement, which is the whole reason they would not even
  parse under python3. Shebangs updated to match.

The suite still does not pass: initialize_chain hits a remaining py2
str+int concatenation, and getblocktemplate.py reaches a real test
assertion. Both are beyond this commit, but the harness now gets far
enough to start nodes, answer RPC and begin building the shared chain,
which it could not do before.
2026-08-30 21:29:08 -05:00
5e0a706839 qa: repair the rpc-test harness so it can start a DragonX node at all
The integration suite has never run against DragonX. Six independent
defects stacked up, each only visible once the previous was fixed:

1. test_framework used python2 implicit relative imports
   ("from authproxy import ..."), removed in python3, so every test died
   at import. Made explicit relative imports.

2. It wrote ZZZ.conf -- a Komodo assetchain convention -- while DragonX
   reads DRAGONX.conf. The daemon therefore never saw the generated
   config, fell back to mainnet defaults and tried to bind RPC 21769,
   which on a seed node is already held by the real node.

3. start_node() was hard-wired for the -ac_name=ZZZ assetchain tests: it
   took the RPC port from extra_args[3], passed extra_args[0] as argv[0]
   of the CLI, and only wrote a config when extra_args[0] matched. Any
   test that passes no extra args crashed on len(None). The generic path
   now takes the port from rpc_port(i) -- the same helper
   initialize_datadir() already used -- and drives the CLI with -datadir.

4. dragonxd refuses to start without an asmap file, which no test datadir
   had. initialize_datadir() now provisions one.

5. -asmap relative paths resolve against the NET-SPECIFIC datadir, so a
   copy in <datadir> is never found. Pass an absolute path.

6. Worst: -regtest was only ever set as "regtest=1" in the conf file,
   which DragonX ignores. Every "regtest" node therefore ran on MAINNET:
   real genesis, real seeds, real peers. An observed run synced 196,180
   live blocks and 679MB into /tmp before the test timed out. -regtest is
   now passed as a command-line flag, with -connect=0 so an isolated
   regtest node stays off the public network.

With these, nodes start, RPC answers, and tests run to a real result.
They do not all pass yet -- getblocktemplate.py reaches an assertion --
but that is now a test outcome rather than a harness failure.
2026-08-30 19:44:27 -05:00
Duke
cb81fc3b95 Less noise unless -debug is used 2025-09-24 09:30:33 -04:00
Duke
04ec2be8c8 Add fullyNotified to getblockchaininfo and use it in tests 2025-08-22 13:17:36 -04:00
Duke
bd9dc4d190 A test for lockzins branch which currently fails on dev branch 2025-08-13 01:13:10 -04:00
Duke
0f18946630 Add lockzins test 2025-08-12 23:30:06 -04:00
Duke
465fe58e6a ./test.sh now runs successfully and we can now write RPC tests 2025-08-12 22:17:18 -04:00
Duke
fb062d2849 Work towards getting RPC tests working again
So much has changed since I originally got the RPC tests working many years ago,
most notably modern Linux distros don't even have a way to install python2 via
packages, you have to install from source. Continuing with python2 does not seem
like a good idea, so we begin migrating thigns to Python 3.

Currently running ./test.sh will successfully spin up a test chain but then
the test suite crashes when attempting to send an RPC request, which looks
to be caused by the test suite internals still expecting python2.
2025-08-12 17:19:04 -04:00
Duke
b386cd1acf Scripts to test this branch 2023-10-07 14:15:12 -04:00
Duke Leto
980350b9b4 Stuck in the grind 2020-12-16 22:10:59 -05:00
Duke Leto
be16f80abc Hush Full Node is now GPLv3
Any projects which want to use Hush code from now on will need to be licensed as
GPLv3 or we will send the lawyers: https://www.softwarefreedom.org/

Notably, Komodo (KMD) is licensed as GPLv2 and is no longer compatible to receive
code changes, without causing legal issues. MIT projects, such as Zcash, also cannot pull
in changes from the Hush Full Node without permission from The Hush Developers,
which may in some circumstances grant an MIT license on a case-by-case basis.
2020-10-21 07:28:10 -04:00
Duke Leto
a7f88a87aa Update copyright URL to be https 2020-09-20 13:17:38 -04:00
Duke Leto
a2b3316664 Port PR93 from @denioD 2020-03-07 13:55:12 -05:00
Duke Leto
75fa411537 Tweak some test suite stuff 2019-12-24 13:43:51 -05:00
Duke Leto
a61118e818 Update python test framework for Hush 2019-12-23 07:50:40 -05:00
ca333
41a7dcf549 add mempool tests 2019-10-02 23:57:21 +02:00
jl777
58cd849591 Jl777 (#1311)
* Remove voutsum check

* Teach RPC interface about dpow-enabled minconfs (#1231)

* Make minconfs dpow-aware in z_listunspent + z_listreceivedbyaddress

* Add dpow-related test files to test suite

* Add dpow simulation to regtest every 7 blocks

* Fix compiler errors

* Fix link error

* Fix stdout spam when running regtests

* Dpowminconfs for listreceivedbyaddress

* dpowconfs tests

* Start adding specific tests for dpowminconfs in listreceivedbyaddress

* Get dpowminconfs tests for listreceivedbyaddress working

* Add dpowminconfs to getreceivedbyaddress + listunspent

* Add test for listtransactions + getreceivedbyaddress support

* Reliably passing dpowminconf tests. We only check for notarized-ness now, not exact confirmation numbers, to avoid race conditions

* Poll for the expected notarization info before running further tests; add support for getbalance

* Migrate tx_height() to a place where asyncrpcoperation_sendmany.cpp can use it

* fix

* Teach GetFilteredNotes about dpowconfs

Many RPCs rely on this internal function, which now correctly uses
dpowconfs to filter by the minconf/maxconf parameters.

* Fix sendmany when using non-default minconf

* inline seems to make things happy

* cleanup

* Add some code to test z_sendmany, which points out https://github.com/jl777/komodo/issues/1247

* try this

* Use already calculated value of dpowconfs instead of calculating it again

* Cleanup .pack file

* Remove

* Remove .pack
2019-03-03 21:42:12 -11:00
jl777
4458e675a2 Merge pull request #969 from tonymorony/FSM
CC auto-tests changes
2018-11-22 23:01:56 -11:00
Anton Lysakov
3a1f15a5ef start node is specific now for cryptoconditions tests 2018-11-23 10:57:06 +06:00
Anton Lysakov
572db45f9d repaired faucet tests by second node adding 2018-11-21 20:46:36 +06:00
Anton Lysakov
ec6811d60f initial version of multi-nodes testing 2018-11-21 15:55:53 +06:00
miketout
99aeab28f9 Integrate latest Zcash fixes and update for non-latin user names 2018-10-27 20:29:03 -07:00
Eirik Ogilvie-Wigley
882a4f577f Fix potentially misleading test failures 2018-10-24 13:53:25 -06:00
miketout
644c7445ec Latest Zcash updates 2018-09-20 13:32:57 -07:00
miketout
9feb4b9e08 Major updates integration from all upstreams 2018-09-18 14:33:53 -07:00
Eirik Ogilvie-Wigley
5602e1f1a6 Allow passing timeout parameter to wait_and_assert_operationid_status 2018-09-14 18:41:14 -06:00
Eirik Ogilvie-Wigley
4d89d020a6 Remove unneeded semicolons 2018-09-14 18:41:14 -06:00
Eirik Ogilvie-Wigley
611f93244b Allow more information to be returned when an async rpc fails 2018-09-14 18:41:14 -06:00
Jonathan "Duke" Leto
941619eb46 Make the REGTEST AC special in our test suite, so we get a predictable rpc port number 2018-08-11 19:14:51 +02:00
Jonathan "Duke" Leto
d48c67574f Improve faucetaddress tests 2018-08-07 21:45:32 +02:00
Jonathan "Duke" Leto
8d454fb58e Sleep a bit to give time for regtest komodod to start 2018-08-07 21:32:56 +02:00
Jonathan "Duke" Leto
dcc6cdb083 Remove reference to REGTEST.conf in start_node which all tests use, not just CC tests. it is passed via extra_args 2018-08-07 21:24:33 +02:00
Jonathan "Duke" Leto
eb8f0960e1 Fix some docs and references to bitcoind 2018-08-07 21:23:05 +02:00
Jonathan "Duke" Leto
38a2d0c825 Pass along extra_args correctly to get correct rpc user/pass 2018-08-07 20:57:42 +02:00
Jonathan "Duke" Leto
3528faa711 Use correct rpc user/pass; this only works the second time its run, some kind of timing/caching issue 2018-08-07 20:51:12 +02:00
Jonathan "Duke" Leto
626af0e73e Getting closer, invalid rpc user/pass instead of wrong port 2018-08-07 20:13:32 +02:00
Jonathan "Duke" Leto
5ec4373ca4 More debugging trying to make getblockcount work and not have komodod hang the test 2018-08-07 09:22:40 +02:00
Jonathan "Duke" Leto
32829f6d6f Fix various test suite bugs and create CC AC in our tests 2018-08-07 08:13:18 +02:00
Jonathan "Duke" Leto
f4cdde0e85 Enable txindex in regtest komodo.confs and update binary in initialize_chain 2018-08-06 08:09:15 -07:00
Jonathan "Duke" Leto
3ccd5a79e5 Look for the correct config file in our tests 2018-08-06 00:43:31 -07:00
Eirik Ogilvie-Wigley
a81b36d267 Add more options when asserting in RPC tests 2018-05-04 09:38:36 -06:00
Jack Grigg
b7caaf954b test: Move wait_and_assert_operationid_status debug output before asserts
Otherwise we don't see them for failed tests :)
2018-03-19 14:00:18 +01:00
Jack Grigg
57e6ecda5a Implement roll-back limit for reorganisation
Closes #713.
2018-02-19 16:32:42 +00:00
Per Grön
d4ab94a6d9 Print result of RPC call in test only when PYTHON_DEBUG is set 2017-12-16 19:24:25 +01:00
Per Grön
8993edfb77 Deduplicate test utility method wait_and_assert_operationid_status
Strictly speaking this is not a true deduplication; the test output will be
slightly different (due to inconsistent print statements) but I think this is
close enough.
2017-12-16 19:24:25 +01:00
Daira Hopwood
811b36ba80 For unused variables reported by pyflakes, either remove the variable,
suppress the warning, or fix a bug (if the wrong variable was used).
refs #2450

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-06-22 18:09:05 +01:00
Daira Hopwood
aff0bf7fa1 Clean up imports to be pyflakes-checkable. fixes #2450
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
2017-06-22 18:09:04 +01:00
Wladimir J. van der Laan
f3e1770cfb tests: Disable Tor interaction
This is unnecessary during the current tests (any test for Tor
interaction can explicitly enable it) and interferes with the proxy
test.
2017-03-25 20:25:38 +13:00
Jack Grigg
c7cb3c13ea [qa] py2: Unfiddle strings into bytes explicitly in ZMQ RPC test
Extracted from bitcoin/bitcoin#7853
commit faa41ee204124da19dcf1e5b8a3aef1e216bf5e6
2017-02-08 22:11:53 +00:00