Commit graph

12 commits

Author SHA1 Message Date
f9e6d994f0
whitespace: test/misc 2024-10-18 10:32:13 +00:00
a0fe92f832
pylint (test suite) - non-interpolated f-strings 2023-10-11 12:58:52 +00:00
aff850d1c8
test suite: import cleanups 2023-10-03 14:27:57 +00:00
46dcb5cabe
minor fixes and cleanups 2023-05-19 16:16:52 +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
c3ce1ab8e3
globalvars.py: new GlobalConstants (gc), GlobalVars (gv) classes
- The attributes of GlobalConstants are non-configurable.  They’re constant
  for a given machine, user, executable and MMGen release.

- The attributes of GlobalVars, `stderr` and `stdout`, are used by the test
  suite to redirect msg() and friends to /dev/null.

- All the aforementioned attributes formerly belonged to GlobalConfig.
2023-03-28 18:14:36 +00:00
19f0730913
crypto.py: reimplement as class 2023-03-27 10:50:38 +00:00
ccb4894583
crypto.py:get_*passphrase(),get_hash_preset*(): merge with duplicating code in wallet.py 2022-01-22 14:26:14 +00:00
748bf68c15
crypto.py:mmgen_{en,de}crypt(): whitespace, cleanups 2022-01-22 14:26:14 +00:00
c2dc09cbf3
get_passphrase,get_hash_preset,get_label: new test, cleanups, fixes 2020-05-30 17:49:22 +00:00