modularize transaction classes

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.
This commit is contained in:
The MMGen Project 2022-02-03 20:40:43 +00:00
commit 818488c559
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
57 changed files with 2924 additions and 2421 deletions

View file

@ -24,10 +24,11 @@ opts_data = {
cmd_args = opts.init(opts_data)
from mmgen.tx import *
import asyncio
from mmgen.tx import CompletedTX
if len(cmd_args) != 1:
opts.usage()
tx = MMGenTX(cmd_args[0],quiet_open=True)
tx.write_to_file(ask_tty=False,ask_overwrite=not opt.quiet,ask_write=not opt.quiet)
tx = asyncio.run(CompletedTX(cmd_args[0],quiet_open=True))
tx.file.write(ask_tty=False,ask_overwrite=not opt.quiet,ask_write=not opt.quiet)