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
The weird thing is if I remove some random statement, for example print('case1: param1 == 0') or temp_var1 = param1 + param2 + param3, the warning is gone.
The function is just declared, not used anywhere yet.
To reproduce, you can checkout this commit: Chubby-Chocobo@5e3a3b2, then run the unittest: python -m unittest discover tests
I asked on Discord, and @localhuman advised we should not ignore this warning.
I'm not sure whether it relate to neo-boa compiler or this ico-template, so I'm just report here. Please help to tag right people to check.
Thank you very much.
The text was updated successfully, but these errors were encountered:
I suspect this has something to do with your nested conditionals. To understand why neo-boa might complain it helps to understand how the compiler works.
First it will generate normal python bytecode (something we have no control over) and then try to translate this into NEO VM code. The problem is that neo-boa doesn't always handle every possible bytecode operation that python can generate. In this case, it encounters a JUMP_IF_FALSE_OR_POP instruction, which it doesn't currently know how to handle, so it just skips it (which is probably bad).
Given that you probably don't want to deep dive into neo-boa and try to add support for JUMP_IF_FALSE_OR_POP - I would suggest maybe restructuring your conditionals until the problem goes away. In the general, it seems if you are able to stay away from complex nested conditionals (like 3 levels of if statements), this doesn't happen.
This is somewhat of an annoyance because you do have valid python code, but the neo-boa just doesn't know how to translate it based on the bytecode that's been generated.
You will encounter these issues when you try to do complex python code.
Does that sound more or less correct @localhuman ?
Hi, after trying to add some functions to the template, I got this kind of warning when running unit-tests:
I cut off my additional code, until there's only function declaration left, the warning still appears.
The function is like this:
The weird thing is if I remove some random statement, for example
print('case1: param1 == 0')
ortemp_var1 = param1 + param2 + param3
, the warning is gone.The function is just declared, not used anywhere yet.
To reproduce, you can checkout this commit: Chubby-Chocobo@5e3a3b2, then run the unittest:
python -m unittest discover tests
I asked on Discord, and @localhuman advised we should not ignore this warning.
I'm not sure whether it relate to neo-boa compiler or this ico-template, so I'm just report here. Please help to tag right people to check.
Thank you very much.
The text was updated successfully, but these errors were encountered: