Skip to content

Problem with Unlock.inline

If I do a simple Unlock.inline document, I can not parse it...

# I know this unlock is good
good_unlock = Unlock(0, [SIGParameter(0)])
str_unlock = good_unlock.inline()
# I check the inline format is good. It returns "0:SIG(0)" as expected.
print (str_unlock)
# Unlock.from_inline method refuses the inline format
false_unlock = Unlock.from_inline(str_unlock)
print (false_unlock.inline())

Result:

Traceback (most recent call last):
  File "test_all_inline.py", line 14, in <module>
    false_unlock = Unlock.from_inline(str_unlock)
  File "/home/thomas/.cache/pypoetry/virtualenvs/silkaj-aMRjPcbt-py3.7/lib/python3.7/site-packages/duniterpy/documents/transaction.py", line 424, in from_inline
    raise MalformedDocumentError("Inline input")
duniterpy.documents.document.MalformedDocumentError: Could not parse field Inline input

The inline string regexp is not correct and should not include a newline at the end.

Because it is in the Transaction raw format that the Transaction document will add newline, not in the Transaction compact format. So the Unlock inline is without newline.

Edited by Vincent Texier
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information