tx.completed: new DummyCompleted class

This commit is contained in:
The MMGen Project 2026-09-09 18:33:59 +00:00
commit 379a041e8d
Signed by: mmgen
GPG key ID: 3F8B1861E32B7DA2
2 changed files with 9 additions and 2 deletions

View file

@ -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

View file

@ -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