You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.
I have experienced a very STRANGE bug. I want to provide a string argument to smart-contract, However sometimes I get an error (even BEFORE execution starts, so the problem is in neo-python shell): Could not load script argument should be bytes, buffer or ASCII string, not 'float'
Strings, that caused this error: "ny", "anf", "puhnaty"
Strings, that didnt cause error: "kn", "antz" ...
See the pattern?
Exactly! If we cast strings to byte array and then to hex, strings in first line will contain only numbers and 'e', so they can be interpreted as float (!)
Seems, like it is happening in neo/Prompt/Utils.py:parse_param, where eval takes as argument hex representation of string, however I had not found a quick way to fix it.
Expected behavior
All strings are processed correctly.
How to reproduce
Probably any load_run *.avm where one of arguments is string.
Your environment
Let us know in what environment you're running into the issue:
Linux dzeta-pc 4.13.0-41-generic #46-Ubuntu SMP Wed May 2 13:38:30 UTC 2018 x86_64 GNU/Linux
neo-python v0.7.0-dev
Python 3.6.3
The text was updated successfully, but these errors were encountered:
For me, this only happens when using these strings in a list in the arguments. So the following works: testinvoke {hash} ny [] whereas this does not: testinvoke {hash} mystr ['ny']
If you're interested in making a PR for the fix that would be great! Otherwise we can get it done. Will need to add some more tests to catch cases like these 😆
Current behavior
I have experienced a very STRANGE bug. I want to provide a string argument to smart-contract, However sometimes I get an error (even BEFORE execution starts, so the problem is in neo-python shell):
Could not load script argument should be bytes, buffer or ASCII string, not 'float'
Strings, that caused this error: "ny", "anf", "puhnaty"
Strings, that didnt cause error: "kn", "antz" ...
See the pattern?
Exactly! If we cast strings to byte array and then to hex, strings in first line will contain only numbers and 'e', so they can be interpreted as float (!)
Seems, like it is happening in
neo/Prompt/Utils.py:parse_param
, whereeval
takes as argument hex representation of string, however I had not found a quick way to fix it.Expected behavior
All strings are processed correctly.
How to reproduce
Probably any load_run *.avm where one of arguments is string.
Your environment
Let us know in what environment you're running into the issue:
Linux dzeta-pc 4.13.0-41-generic #46-Ubuntu SMP Wed May 2 13:38:30 UTC 2018 x86_64 GNU/Linux
neo-python v0.7.0-dev
Python 3.6.3
The text was updated successfully, but these errors were encountered: