I call a smart contract and pass and argument which represents unix time as Uint64 argument.
Inside I compare this against the current time (using Global.latest_timestamp() in PyTeal), so it looks like the TEAL assembler can infer that my argument is representing time.
When I call getApplicationByID, inside the return value (app.params[‘global-state’] element containing { key: mytime, value: } I get an uint surprisingly contatning the estimated block number instead of the unix time that I put in.
Can someone confirm that the Algorand VM is converting this, or am I making a mistake somewhere?
Inside I compare this against the current time (using Global.latest_timestamp() in PyTeal), so it looks like the TEAL assembler can infer that my argument is representing time.
This function returns a uint64, so there is no inferring of what it represents. Just numeric comparison.
When I call getApplicationByID, inside the return value (app.params[‘global-state’] element containing { key: mytime, value: } I get an uint surprisingly contatning the estimated block number instead of the unix time that I put in .
I don’t quite understand this. You’re making this call off chain and you see a value that looks like round instead of the timestamp you’re expecting?
There should be no magic conversions happening in the AVM. If the value you’re getting back is indeed a round number not a timestamp, double check that the thing writing to it is 1) actually writing to that key, 2) writing the argument you’re passing.