Skip to main content
Version: 1.6.0

Is there a way to advance time in LIGO tests ?

The Mavryk.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 Mavryk.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:

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

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

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

For more information on these function, see the Test library