- During initialization, data objects now invariably raise an exception on
failure (ObjectInitError by default, configurable via the 'exc' attribute).
- For callers that need to handle the exception, the new get_obj() wrapper is
provided.
Testing:
$ test/objtest.py -S
$ test/objtest.py -S --getobj
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.
This patch introduces the commands `mmgen-seedsplit` and `mmgen-seedjoin`.
The first creates shares one at a time, while the second joins them to
recover the original seed. By default, the default wallet is operated upon.
Shares are ordinary MMGen wallets and as such may be saved in any MMGen wallet
format, with one minor limitation: only one share in a given split may be in
hidden incognito format, and it must be the master share in the case of a
master share split.
For usage information and examples, see:
mmgen-seedsplit --help
mmgen-seedjoin --help
Relevant tests:
test/test.py -e seedsplit
ls -lrt test/tmp23/* # list the created files
test/objtest.py SeedSplitSpecifier
Related commits:
7311f474 - seed splitting: seed-level infrastructure
237567bc - master shares