I am testing a contract in SmartPy that uses a contract call (similar to the Collatz example).

Contract 'A' sends a transaction to contract 'B' with some data.
Contract 'B' does some computation and sends data back to contract 'A' including a parameter validState.
Contract 'A' receives the data from contract 'B' and does some verification including:

        sp.verify(params.validState == True)

Now, I am trying to write a test scenario in which validState is false, and so contract 'A' should fail the operation.

The problem is that since the first transaction from Contract 'A' to 'B' is valid, I cannot use the normal valid = False flag in the first transaction.

Is there a solution for this?

1 Answer 1


It's sadly not supported yet in the interpreter. It's a known limitation and it's pretty high on the priority list.

You can often test each contract independently (far from perfect, obviously).

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.