I'm doing something like this, but the invalid scenario assertion fails.

Is there a way to propagate the exception from the other contract? Or do I just have to test that contract separately?

class TezosHomepageAdNft(FA2):
    def mint(self, params):

class TezosHomepage(sp.Contract):
    def buy(self, params):
        sp.transfer(token_params, sp.tez(0), land_nft_contract)  # calling mint here

def test():
    scenario = sp.test_scenario()
    t_home = TezosHomepage()
    scenario += t_home
    scenario += t_home.buy().run(sender = mark, amount = sp.mutez(1), valid=False)

1 Answer 1


SmartPy test interpreter already handles internal operations failures really well.

Here is an example: https://smartpy.io/ide?cid=QmV3nwdkwHGXdJbWwV8LDgm3TPbC49Es7Wm6GufMeh8Pz2&k=184987b7b8089b73396a

Please, don't provide incomplete examples. I always find myself wasting tremendous amounts of time just to put those examples to work.

  • 1
    sorry about that. I'll include a link to smartpy ide example next time. this time it was a user error... had a hardcoded contract address when I should've been using the one instantiated in the scenario
    – JJJ
    Commented Apr 9, 2021 at 22:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.