Hi, after trying to add some functions to the template, I got this kind of warning when running unit-tests:
[I 180619 08:00:35 pytoken:253] Op Not Converted: JUMP_IF_FALSE_OR_POP
I cut off my additional code, until there's only function declaration left, the warning still appears.
The function is like this:
def foo(ctx, param1, param2, param3):
if param1 == 0:
print('case1: param1 == 0')
return 0
if param2 == 0:
print('case2: param1 == 0')
return 0
temp_var1 = 0
stored_value1 = Get(ctx, 'value1')
stored_value2 = Get(ctx, 'value2')
stored_value3 = Get(ctx, 'value3')
stored_value4 = Get(ctx, 'value4')
stored_value5 = Get(ctx, 'value5')
stored_value6 = Get(ctx, 'value6')
if (stored_value1 <= param3) and (param3 <= stored_value2):
if not Get(ctx, 'condition1'):
print('case3: condition1')
return 0
temp_var1 = stored_value2 + param3
temp_var2 = stored_value3 + param2
if temp_var2 > stored_value4:
stored_value7 = Get(ctx, 'value7')
if stored_value7 > temp_var1:
return 0
return stored_value7
if temp_var2 > stored_value5:
temp_var1 = stored_value5 + stored_value6
if (temp_var1 > param1):
return stored_value6
return temp_var1
if (stored_value3 <= param3) and (param3 <= stored_value4):
temp_var1 = param1 + param2 + param3
return temp_var1
return 0
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.
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 testsI 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.