Commit graph

2,983 commits

Author SHA1 Message Date
ede56a2526
tx.py: infer mmtype for non-MMGen inputs and outputs 2021-10-06 13:22:32 +00:00
fb046dc076
minor cleanups 2021-10-06 13:22:32 +00:00
36c6021ce2
regtest: create miner wallet from hardcoded seed (BTC-only) 2021-10-05 11:57:34 +00:00
b0644a4052
regtest: make cli accept integer and bool args, add wallet_cli 2021-10-05 11:57:34 +00:00
554670b713
overlay_setup(): use passed value of repo_root 2021-10-05 11:57:34 +00:00
2af674a4ce
CoinDaemon: include non-standard --datadir for BCH 2021-10-05 11:57:33 +00:00
ae3c65ec81
regtest: return daemon datadir to its former location under MMGen datadir
Affected coins: BTC,LTC,BCH

Fixes a regression introduced by commit `ca8b4dc31` on Aug 5.

During this period, use of the `mmgen-regtest` script would have overwritten
the user bitcoin/litecoin.conf and regtest dir.  Other files in the daemon
datadir were unaffected.
2021-10-05 11:57:33 +00:00
4dc9b38041
daemon.py: restrict start() and stop() methods to test suite and regtest 2021-10-05 11:57:33 +00:00
517f0ee54f
daemon.py: minor fixes and cleanups 2021-10-05 11:57:32 +00:00
08fc25d863
deterministic testing
Goal: for each test run to produce reproducible output, allowing us to check
for possible stochastic behavior in the scripts, as well as output-related
regressions (for example, garbage or improperly formatted output produced by a
bad format string) that might not be detected by the test scripts.

In practice, bugginess of the pexpect module and the non-deterministic behavior
of Bitcoin Core’s regtest implementation preclude completely identical output
from test run to test run, but the differences are small enough to result in an
easily reviewable diff.

Enable this feature by setting the MMGEN_TEST_SUITE_DETERMINISTIC environment
variable or running test/test-release.sh with the -D switch.

Examples:

    $ script -c 'test/test-release.sh -FDv quick' -O run1
    $ script -c 'test/test-release.sh -FDv quick' -O run2
    # (optionally remove control characters from output files)
    $ diff -u run1 run2 > diff

    $ export MMGEN_TEST_SUITE_DETERMINISTIC=1
    $ script -c 'test/test.py -ne main' -O run1
    $ script -c 'test/test.py -ne main' -O run2
    # (optionally remove control characters from output files)
    $ diff -u run1 run2 > diff
2021-10-03 17:40:03 +00:00
96a250b51d
test suite: run scripts from overlay tree
Rationale of this commit: to relocate some ugly test-related code from the MMGen
package tree to the test tree, as well as to enable deterministic testing
(implemented in the next commit).

The overlay tree is a symlinked mirror of the MMGen package dir with a few
monkey-patched modules.

The monkey-patching is conditional, so the modules are certain to get tested in
their unpatched state as well.
2021-10-03 17:40:02 +00:00
2a178b3b2e
tx.py: format_io(): add amount to sort key so duplicate addrs sort predictably 2021-10-03 17:40:02 +00:00
3a2cb6f551
minor fixes and cleanups 2021-10-03 17:40:02 +00:00
54d123fdc0
scripts/traceback_run.py -> scripts/exec_wrapper.py 2021-10-03 17:40:01 +00:00
ca3ff726ef
test-release.sh: skip individual tests with -S 2021-10-02 17:54:12 +00:00
0493f8077b
test suite: use getrand() instead of os.urandom() 2021-10-02 17:54:12 +00:00
ffa6d44834
test suite: add end_msg() 2021-10-02 17:54:11 +00:00
e957b84def
init_color(): allow disabling of color with num_colors=0 2021-10-02 17:54:11 +00:00
ea5eedcff3
minor changes, whitespace 2021-10-02 17:54:11 +00:00
579226ee7d
AddrList: display checksum only where relevant 2021-10-02 17:54:10 +00:00
8c45829682
add remove_dups() function, use lists instead of sets to preserve order 2021-10-02 17:54:10 +00:00
6692a43d59
f-strings, whitespace (test files) [44 files patched] 2021-09-29 21:17:57 +00:00
2872d4b683
f-strings, whitespace (program files) [43 files patched] 2021-09-29 21:17:56 +00:00
a093075fd5
test.py: add --no-timings option 2021-09-29 21:17:56 +00:00
e91b139c99
test.py: begin implementing TEST_SUITE_DETERMINISTIC 2021-09-29 21:17:56 +00:00
565dd6da62
scripts/traceback_run.py: improve color initialization code 2021-09-29 21:17:55 +00:00
fe756f7303
minor test suite fixes 2021-09-29 21:17:55 +00:00
c82eb9d149
setup.py,setup.cfg: Windows build fixes 2021-09-26 21:16:55 +00:00
eccc48b37f
minor fixes and cleanups 2021-09-26 21:16:55 +00:00
877be3f877
test.py ethdev: support Erigon (WIP) 2021-09-26 21:16:54 +00:00
db4c0158fb
test.py: clean tmpdirs before initializing test groups 2021-09-26 21:16:54 +00:00
229107a8a9
CoinProtocol.Ethereum: generate checksummed addresses 2021-09-26 21:16:21 +00:00
395d3c1a20
test.py: whitespace, remove 'non_mmgen_inputs' parameter 2021-09-26 21:16:20 +00:00
50d8fc8422
test.py ethdev: variable renames 2021-09-26 21:16:20 +00:00
b400b26029
test suite: improve handling of BOGUS_SEND environment var 2021-09-26 21:16:20 +00:00
4c35218fc2
unit_tests.py: new testdep test 2021-09-26 21:16:20 +00:00
cd7e6595ea
unit_tests.py: new 'win_skip' attribute 2021-09-26 21:16:19 +00:00
e9b0c9e325
unit_tests.py daemon: refactor to use subtest API 2021-09-26 21:16:19 +00:00
5afa3f5118
ts_main.py: f-strings 2021-09-26 21:16:19 +00:00
d75ffea985
test suite: whitespace 2021-09-26 21:16:18 +00:00
25fb862390
setup.py: fully automate secp256k1 extension module build
The secp256k1 library is now cloned from Github and built automatically.  It’s
linked statically to the extension mod, so that the resulting wheel can run on
a system without libsecp256k1 installed.
2021-09-24 20:07:06 +00:00
1b1b511a09
finish dependency unit test 2021-09-24 20:07:06 +00:00
8559b9c668
do_hashlib_scrypt(): cleanups 2021-09-24 20:07:05 +00:00
33a576a969
addr.py: KeyGeneratorPython: clean up code 2021-09-24 20:07:05 +00:00
43684c8283
unit_tests.py: add --exclude option 2021-09-24 20:07:05 +00:00
86f263d2d4
minor cleanups 2021-09-24 20:07:04 +00:00
4a9571424e
setuptools: migrate from setup.py to setup.cfg
The preferred way to install MMGen is now:

    # cd to repository root
    $ python3 -m build --no-isolation
    $ pip3 install --user dist/*.whl

A user install eliminates reliance on superuser privileges and prevents
conflicts with Python packages that may already be installed on the system.

Python dependencies are automatically installed by pip.
2021-09-23 21:28:06 +00:00
f6d313dbcb
{start,stop}-coin-daemons.py: reimplement to eliminate use of symlink 2021-09-23 21:15:33 +00:00
511aa79fc8
add dependency unit test (WIP) 2021-09-23 21:15:33 +00:00
906f0320d1
minor fixes and cleanups 2021-09-23 21:15:32 +00:00