1

Previously, to set the (virtual) time a transaction happened in SmartPy I used the flag now when running a command like run. Now it seems to cause an error (seems like something changed in an update). What is the new way to perform the equivalent command?

Note that in this example, c1 is the name of the contract, merchClaim is the name of the entrypoint, and bob is the name of an account.

Error: 'int' object has no attribute 'export'

Traceback (most recent call last):

 SmartPy code line 299, in test (line 299)
   scenario += c1.merchClaim().run(sender = bob, now = 10, valid = False)
 module smartpy line 1103, in run
   result.time = self.smartml.time.export()

1 Answer 1

3

Use now = sp.timestamp(10).

We used to allow now = 10 but this is not well typed.

(also, obviously, the exception message should be better)

Your Answer

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

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