tx.completed: new DummyCompleted class
This commit is contained in:
parent
41bc51e356
commit
379a041e8d
2 changed files with 9 additions and 2 deletions
|
|
@ -103,3 +103,10 @@ class Completed(Base):
|
|||
|
||||
if self.is_swap:
|
||||
raise ValueError('missing or invalid memo in swap transaction')
|
||||
|
||||
class DummyCompleted: # required by MMGenTxFile.get_proto()
|
||||
|
||||
desc = 'dummy transaction'
|
||||
|
||||
def __init__(self, cfg):
|
||||
self.cfg = cfg
|
||||
|
|
|
|||
|
|
@ -336,7 +336,7 @@ class MMGenTxFile(MMGenObject):
|
|||
|
||||
@classmethod
|
||||
def get_proto(cls, cfg, filename, *, quiet_open=False):
|
||||
from . import BaseTX
|
||||
tmp_tx = BaseTX(cfg=cfg)
|
||||
from .completed import DummyCompleted
|
||||
tmp_tx = DummyCompleted(cfg=cfg)
|
||||
cls(tmp_tx).parse(filename, get_proto_only=True, quiet_open=quiet_open)
|
||||
return tmp_tx.proto
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue