Commit graph

18 commits

Author SHA1 Message Date
e90e25b2f0
Config API, Part II
This patch completes the implementation of the API, making the entire MMGen
code base usable as a library for external projects.  A usage example can be
found in the script `examples/coin-daemon-info.py`.

Testing:

    $ test/test.py -e coin_daemon_info
2023-04-04 16:04:13 +00:00
9e1935ad19
opts.init() -> Config() 2023-04-04 16:04:10 +00:00
3896293652
minor cleanups 2023-04-04 16:04:10 +00:00
c7adb56e38
Config API, Part I
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.
2023-03-28 18:14:37 +00:00
78e882143c
whitespace, cleanups, imports throughout [73 files changed] 2023-03-27 10:49:04 +00:00
1aeefd64ae
update copyright dates 2023-01-03 10:36:07 +00:00
20f4b12832
module docstring cleanups [134 files] 2022-11-14 09:54:07 +00:00
c74e15669b
util.py: run_session() -> async_run() 2022-10-17 18:37:23 +00:00
59bffb59b2
CoinProtocol.Base: skip loading of .amt module via 'need_amt=False' 2022-01-29 11:25:03 +00:00
8e457707f0
BTCAmt: remove 'min_coin_unit' attribute 2021-09-01 16:56:47 +00:00
15876f4e37
Minor changes 2020-10-19 18:29:57 +00:00
1fa4f601d0
Version bump; minor changes, fixes 2020-07-29 14:39:32 +00:00
cfa8d19cd0
LTC support/testing fixes
- examples/halving-calculator.py: support LTC and BCH
- test/test.py regtest: support Litecoin Core v0.18.1
- test/unit_tests.py: add LTC test
2020-06-11 14:36:32 +00:00
2f6e5f1fc2
test.py: add test for halving calculator 2020-06-02 13:00:18 +00:00
9d8b90f705
modified: examples/halving-calculator.py 2020-06-01 20:59:34 +00:00
b01af014a3
opts.py: allow no-arg init() with dfl opts_data; longhelp fixes,cleanups 2020-05-15 10:13:39 +00:00
bfc40fce4d
halving-calculator.py: a few minor fixes 2020-05-12 16:37:59 +00:00
86fd45566d
new file: examples/halving-calculator.py 2020-05-11 18:07:58 +00:00