1

req passed to _verifySigPersonalSign will be of type ERC

import smartpy as sp

ERC = sp.TRecord(sender=sp.TAddress,to=sp.TAddress,deadline=sp.TTimestamp)

class StoreValue(sp.Contract):
    @sp.entry_point
    def _verifySigPersonalSign(self,params):
        req=params.req
        sp.verify(sp.now<=sp.timestamp(params.req.deadline))

But I am getting this error in the last line of code

Error: Error in Scenario
Literal format error: (timestamp(attr(attr(params 39)req 40)deadline 41))

How to resolve this?

2

To compare timestamps, you can use < or <=.

The problem in your code is that sp.timestamp(params.req.deadline) is wrongly built. sp.timestamp(...) is for constants.

Simply replace that by sp.now<=params.req.deadline.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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