Commit graph

202 commits

Author SHA1 Message Date
9a1ea34309
initialize developer tools via builtins; add test 2022-10-20 18:14:15 +00:00
c3dbd720c6
minor fixes and changes 2022-10-20 18:14:14 +00:00
1d8b908c7c
util.py: relocate user-prompting functions to ui.py 2022-10-17 18:37:22 +00:00
9888fe4c65
util.py: relocate lesser-used functions to util2.py 2022-10-17 18:37:22 +00:00
6653cff8b0
Python 3.7, 3.8 compatibility fix 2022-08-16 20:35:49 +00:00
3f2acde7a8
test suite: minor changes and cleanups 2022-08-04 13:44:31 +00:00
1db6076410
scripts/exec_wrapper.py: improve traceback handling
- new environment var: EXEC_WRAPPER_TRACEBACK
2022-07-29 16:45:31 +00:00
401744bf88
minor fixes and cleanups 2022-07-27 17:08:59 +00:00
2314247918
add msys2-sshd-setup.sh convenience script 2022-05-06 12:52:41 +00:00
830d07cde2
minor fixes 2022-04-23 14:36:08 +00:00
fc87dcf0ba
fixes and cleanups throughout 2022-02-07 21:08:08 +00:00
71d7986391
minor fixes and cleanups 2022-02-06 13:28:44 +00:00
41376eb515
new MMGenSystemExit exception; remove rdie(), ydie() 2022-02-05 13:32:56 +00:00
d30fbba837
environment var rename: MMGEN_TRACEBACK -> MMGEN_EXEC_WRAPPER 2022-02-05 13:32:55 +00:00
818488c559
modularize transaction classes
The monolithic tx.py module has been split into multiple modules, and a
clean separation of protocol-dependent and protocol-independent code has
been carried out.

- Protocol-independent base classes are located under `tx`.
- Protocol-dependent subclasses are under `base_proto/{name}/tx`.
- The code in `tx/__init__.py` loads the required module and returns an
  initialized instance of the requested class.
2022-02-03 20:41:28 +00:00
d6872ddb87
fixes and cleanups throughout 2022-02-03 20:40:42 +00:00
2305efc39d
scripts/exec_wrapper.py: add tracemalloc support
- support is activated by setting the MMGEN_TRACEMALLOC environment variable
2022-01-24 19:30:12 +00:00
0a4427bb89
scripts/gendiff.py: DOS CR fix 2022-01-22 14:26:12 +00:00
4819c97f8a
util.py: move file utilities to fileutil.py 2022-01-21 11:23:46 +00:00
3799411071
test.py, gendiff.py: minor fixes 2022-01-15 14:00:10 +00:00
0880229e94
use open() strictly as context manager 2022-01-06 20:24:21 +00:00
1a896d9af9
update copyright dates 2022-01-04 19:51:22 +00:00
acd9c1e13f
minor fixes and cleanups 2021-10-06 21:08:02 +00:00
76cf32f3b4
new convenience utility: scripts/gendiff.py 2021-10-06 13:22:34 +00:00
554670b713
overlay_setup(): use passed value of repo_root 2021-10-05 11:57:34 +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
54d123fdc0
scripts/traceback_run.py -> scripts/exec_wrapper.py 2021-10-03 17:40:01 +00:00
ea5eedcff3
minor changes, whitespace 2021-10-02 17:54:11 +00:00
565dd6da62
scripts/traceback_run.py: improve color initialization code 2021-09-29 21:17:55 +00:00
906f0320d1
minor fixes and cleanups 2021-09-23 21:15:32 +00:00
9c5f4de936
scripts/create-token.py, test.py oneshot_warning; minor fixes 2021-09-05 18:40:44 +00:00
530571f610
scripts/create-token.py: cleanups, sanity checks 2021-09-04 18:34:09 +00:00
eaeeef97c0
test.py ethdev: update solc to v0.8.7, update precompiled contract data 2021-09-03 20:17:25 +00:00
4742255ad2
test.py ethdev, scripts/create-token.py: cleanups 2021-09-03 20:17:25 +00:00
bab1242817
minor fixes and cleanups 2021-07-29 14:20:44 +00:00
21ba2476eb
minor cleanups 2021-04-17 13:27:54 +00:00
cb7f38370b
Update copyright dates 2021-02-19 20:09:06 +03:00
c3f185e8b0
eliminate use of global vars g.proto, g.coin, g.rpc and others
This patch eliminates nearly all the global variables that changed during the
execution of scripts.  With a few minor exceptions, global vars are now used
only during initialization or reserved for cfg file / cmdline options and other
unchanging values.

The result is a code base that's much more maintainable and extensible and less
error-prone.  The autosigning code, which supports signing of transactions for
multiple protocols and networks, has been greatly simplified.

Doing away with globals required many changes throughout the code base, and
other related (and not so related) changes and cleanups were made along the
way, resulting in an enormous patch.

Additional code changes include:

    - tx.py: complete reorganization of TX classes and use of nesting

    - protocol.py: separation of Regtest and Testnet into distinct subclasses
      with separate address and transaction files and file extensions

    - new module help.py for the help notes, loaded on demand

    - addr.py: rewrite of the address file label parsing code

    - tx.py,tw.py: use of generators to create formatted text

User-visible changes include:

    - importing of addresses for tokens not yet in the user's tracking wallet
      is now performed with the `--token-addr` option instead of `--token`

Testing:

    Testing this patch requires a full run of the test suite as described on the
    Test-Suite wiki page.
2020-05-28 09:53:34 +00:00
9489b1cb2d
string formatting, whitespace, minor cleanups throughout 2020-05-26 14:53:44 +00:00
43432327c7
global change: init_coin() -> g.proto = init_proto() 2020-05-16 12:44:43 +00:00
da5742f667
various cleanups throughout 2020-04-12 15:02:52 +00:00
673b97b3b8
update copyright dates 2020-02-18 14:07:27 +00:00
d57631695a
test suite: move path fixup code to test/tests_header.py 2019-10-23 10:01:11 +00:00
6cf4fcc7e4
Use subprocess.run() throughout, related cleanups 2019-10-23 09:31:21 +00:00
23ae73d908
minor fixes and cleanups 2019-07-03 20:30:53 +03:00
4a2cc07ef1
relocate test-release.sh script to test directory 2019-04-19 17:37:32 +03:00
823e325c6c
[msys2]: enable color output, handle exceptions in main.py 2019-03-27 19:52:29 +03:00
4240393804
minor fixes 2019-03-26 16:02:10 +03:00
017ecef3bc
[opts]: separate code from text in opts_data
- When parsing opts, opts.init() now looks only at string values from
  opts_data.  Global variables are evaluated only when printing help text,
  after the variables are initialized
2019-03-26 15:59:37 +03:00