I think my plutus-playground-server
has an incorrect notion of time. I'm working on the homework for lecture 3 and keep running into issues with the simulator.
Here's a screenshot of what I'm simulating for homework 2 of week 3:
I've verified that, according to the cabal repl, 1596059101000
is slot 10.
Prelude Ledger Wallet.Emulator Data.Default Ledger.TimeSlot Week03.Homework2> slotToBeginPOSIXTime de
f 10
POSIXTime {getPOSIXTime = 1596059101000}
Note that in the example simulation I Wait Until Slot 11
.
I've changed the following line when constructing transactions clientside to show now
: https://github.com/paymog/plutus-pioneer-program/commit/4098f73bef4191ebc976fb8c2c3d46ee53f97b5e#diff-7fd9bde64b988d6aa9520167ed285990ed737f5dbda967ac19c786ff4160bb36R105
Interesting, when I execute the above simulation, I see the following output:
Add slot 11
Contract instance for wallet 2: (ReceiveEndpointCall (EndpointDescription { getEndpointDescription: "grab" }) (RawJson "{\"contents\":[{\"getEndpointDescription\":\"grab\"},{\"unEndpointValue\":[]}],\"tag\":\"ExposeEndpointResp\"}"))
Contract instance for wallet 2: (ContractLog (RawJson "no gifts available at time POSIXTime {getPOSIXTime = 1596059102}"))
Note that the value of now
is 1596059102
which is missing three trailing zeroes compared to 1596059101000
. If I check the posix time of slot 11 in the cabal repl
I see
Prelude Ledger.TimeSlot Data.Default Week03.Homework1> slotToBeginPOSIXTime def 11
POSIXTime {getPOSIXTime = 1596059102000}
which is the value reported by the simulation with 3 extra trailing zeroes.
Does my instance of the plutus-playground-server
have a "incorrect" notion of time?