This repository was archived by the owner on Nov 15, 2021. It is now read-only.

Description
Current behavior
Using --tx-attrs with any spaces inside the attribute JSON (even inside quoted strings) results in the following error:
[E 190822 14:50:54 Utils:197] Could not parse json from tx attrs: unexpected EOF while parsing (<string>, line 1)
Expected behavior
To properly parse tx attributes with spaces in them
How to reproduce
Try the following invocation on TestNet - the --tx-attr value is taken directly from the example shown by the sc invoke help command in np-prompt:
sc invoke 9aff1e08aea2048a26a3d2ddbb3df495b932b1e7 transfer ['AaPoixMs8SAd7
XtXzJqt1t7MsKwjY6KaiL','Ae8JQr7b9QtCxcQMjJSbxAv685UqWF8CY7',100000000000] --tx-a
ttr=[{"usage": 0x90,"data":"my brief description"}]
The spaces both inside and outside of the quotes will stop the parser from reading the rest of the string, resulting in the EOF error. This works:
--tx-attr=[{"usage":0x90,"data":"my_brief_description"}]
but it's not ideal for text remarks to be unable to have spaces in them. I tried escaping the spaces with one or more backslashes to no avail. The only way to get the attribute accepted is to remove all spaces inside and outside of the quotes.
Your environment
- OS: OSX Mojave
- neo-python version: 0.8.6-dev
- Python version: 3.7.4