Commit graph

3,143 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
bac47a6a0a
rpc_init(): make proto a keyword parameter 2023-04-04 16:04:13 +00:00
d4db9b0409
proto.eth.daemon: use port offset for test suite only 2023-04-04 16:04:13 +00:00
5dac884a39
class Lockable: _lock -> _locked, lock() -> _lock() 2023-04-04 16:04:12 +00:00
f1b427fd9c
scripts/exec_wrapper.py: sys -> exec_wrapper_sys 2023-04-04 16:04:12 +00:00
1ba9733199
a few minor fixes and cleanups 2023-04-04 16:04:12 +00:00
286105b73a
opts.py: remove show_common_opts_diff() 2023-04-04 16:04:11 +00:00
d81d82fe35
cfg.py: prefix internally used attrs with underscore 2023-04-04 16:04:11 +00:00
ce6df33827
opts.py: minor renames 2023-04-04 16:04:11 +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
93bcc92534
globalvars.py -> cfg.py 2023-04-04 16:04:10 +00:00
e52588b5af
term.py: register_cleanup() fix 2023-04-04 16:04:09 +00:00
b8bf2c7df2
test.py regtest: test scroll interface for tw views 2023-04-04 16:04:09 +00:00
2e68cc095b
license message bugfix and test 2023-04-01 12:25:28 +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
6cd8856912
minor whitespace, cleanups 2023-03-28 18:14:37 +00:00
5adf17a85f
globalvars.GlobalConfig: reorder attributes 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
795b653c6d
cfgfile.py: cleanups 2023-03-27 10:50:38 +00:00
5e55b4f155
cfgfile.py: rename virtual classes 2023-03-27 10:50:37 +00:00
e82a3cb8c7
altcoin.py: improve opts handling 2023-03-27 10:50:37 +00:00
9eab15dc6e
mn_entry.py: check configured mnemonic entry modes at runtime 2023-03-27 10:50:37 +00:00
158bc24716
fileutil.py: reimplement get_lines_from_file() 2023-03-27 10:50:18 +00:00
78e882143c
whitespace, cleanups, imports throughout [73 files changed] 2023-03-27 10:49:04 +00:00
a385c98c17
globalvars.py: implement data_dir and data_dir_root as properties 2023-03-27 10:48:20 +00:00
9cb02db5c0
g.testnet -> g.network == 'testnet' 2023-03-27 10:48:20 +00:00
563b0ca7d0
daemon.py, opts.py, globalvars.py, tool/wallet.py: minor cleanups 2023-03-27 10:48:20 +00:00
fcb520228d
cfgfile.py: cleanups, avoid use of g.data_dir_root 2023-03-27 10:48:19 +00:00
80244b57ea
module rename: cfg.py -> cfgfile.py 2023-03-27 10:48:19 +00:00
e00e4cd149
opts.py: improve environment var parsing 2023-03-27 10:48:19 +00:00
77f4fd245d
minor fixes, cleanups, whitespace 2023-03-27 10:48:18 +00:00
333cbcf3ac
mmgen-xmrwallet: new label operation 2023-03-26 12:48:45 +00:00
258f856128
xmrwallet: save TX data to file even when relaying 2023-03-26 12:48:44 +00:00
60a201e112
xmrwallet, proto.xmr.daemon: minor changes 2023-03-26 12:48:44 +00:00
12a1986e26
xmrwallet: de-async rpc methods 2023-03-26 12:48:44 +00:00
11b16e7378
xmrwallet: new spec virtual class 2023-03-26 12:48:43 +00:00
f62a4ce5a9
proto.xmr: disable version check for restricted (public) nodes 2023-03-25 11:49:40 +00:00
b6662bd4b7
mmgen.cfg: add xmr_ignore_daemon_version option 2023-03-25 11:49:39 +00:00
cbdd9db75e
add Monero daemon version checking 2023-03-24 20:31:11 +00:00
2aab4fff1b
test.py xmrwallet: ensure minimum initial blocks are mined 2023-03-24 20:31:11 +00:00
56746d92ae
MoneroRPCClient: add proto param to constructor 2023-03-24 20:31:10 +00:00
47db716d7b
MoneroRPCClient: make call(), call_raw() methods non-async 2023-03-24 20:31:10 +00:00
ee8ca9f99e
delete class MoneroRPCClientRaw 2023-03-24 20:31:10 +00:00
add9dd7850
rpc: make process_http_resp() non-async 2023-03-24 20:31:09 +00:00
aed8600931
proto.xmr: whitespace 2023-03-24 20:31:09 +00:00
7d66d0468a
make handle_unsupported_daemon_version() a method 2023-03-24 20:31:03 +00:00
52b0fa5508
Update coin daemon support to latest versions
- Bitcoin Cash Node:  v26.0.0
- Litecoin Core:      v21.2.2
- Geth:               v1.11.5
- Monero:             v0.18.2.0 (tested)
2023-03-23 17:30:22 +00:00
9ea3ee491a
test.py xmrwallet: use mainnet/regtest instead of stagenet
- this results in the test running about 3X faster on average.

Testing:

    $ test/test.py --coin=xmr -e xmrwallet
2023-03-23 17:29:51 +00:00