This patch eliminates the global configuration variables `opt` and `g`, making
all functions and class instances locally configurable. Configuration data is
passed to functions and constructors via the `cfg` parameter and made available
to methods in `self.cfg`.
Local configuration free from dependence on the command line will enable the
creation of multiple, independently configured instances of MMGen’s data
objects within a single process.
Potential applications include testing (tracking wallets configured to interact
with spawned processes, for example) and the use of MMGen as a library for
other projects.
This patch completes most of the work required to enable the API. The full
implementation will appear in a forthcoming commit.
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.
- 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
This is the first commit of the MMGen Python 3 port. Branch 'py3port', against
master branch commit ab06ca4
Commits are groupings of similar or related changes: automatic changes first,
followed by repetitive and global changes, followed by specific ones
All commits until the final one will leave the branch in a broken state
- closes an exploit whereby an infected online MMGen installation could craft
a special TX file to trick an offline signing MMGen into executing an
arbitrary expression
- update TX file format (to v3) to permit calling literal_eval() on unmodified
inputs and outputs data (old v2 file format continues to be supported)
- new TX file conversion script: `scripts/tx-v2-to-v3.py`
- `scripts/tx-old2new.py` modified and renamed to `scripts/tx-v1-to-v3.py`