G-d willing
Hello,
I need to design a contract (Agreement) that will need to be created only between time limits (it has 2 properties beginTime & endTime).
I have another contract (Proposal) that one of its choices is creating the Agreement. So, inside the choice I added validation for the time limits.
time <- getTime
let currentTime = toDateUTC time
assertMsg "The proposal is out of the time limit" (currentTime >= info.registrationBegins && currentTime <= info.registrationBegins)
The problem I am having is when I run the script inside VisualStudio Code and also use daml test
, it fails since the getTime
function returns 1970-01-01
.
How can I make sure that the date & time will be correct?
Calling the setTime
will help with the Visual Studio, but won’t be enough due to daml test
.
How can I overcome this to make sure my tests will work properly?
Thanks,