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:
parent
d6872ddb87
commit
818488c559
57 changed files with 2924 additions and 2421 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue