The following question have been asked on Telegram:
I have the following error:
name 'show' is not defined
. How can I fix it?
The following question have been asked on Telegram:
I have the following error:
name 'show' is not defined
. How can I fix it?
This error is caused when you try to add the result of an entrypoint call to a scenario.
For example:
import smartpy as sp
@sp.module
def main():
class MyContract(sp.Contract):
def __init__(self):
pass
@sp.entrypoint
def ep(self):
pass
if "templates" not in __name__:
@sp.add_test(name="MyContract")
def test():
sc = sp.test_scenario(main)
c1 = main.MyContract()
sc += c1
sc += c1.ep()
To fix it simply remove sc +=
before c1.ep()
.
This syntax was needed in the first versions of SmartPy but it’s not simplified.