Skip to main content
Version: 0.60.0

Is there a way to advance time in Ligo tests ?

The Tezos.get_now function can be used to get the current time, but in the tests, we may want to setup a situation where the contracts thinks Tezos.get_now() is in the future.

Time advances by baking (protocol checks and enforces the timestamp makes sense)

So, to bake and advance time, you can use :

let Test.bake_until_n_cycle_end = (cycles : nat) => unit

Depending on the situation, the following can be useful as well :

let Test.reset_state_at = (initial_timestamp : timestamp, no_of_accounts: nat, amount: list<tez>) => unit

For more information on these function, see the Test library