Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 982 Bytes

time.md

File metadata and controls

21 lines (14 loc) · 982 Bytes

Time

The Time class allows the manipulation of blocktime. These functions only add time to the current block time (never reduces). Note that it is not super accurate. You will definitely increase time by at least the number of seconds you indicate, but likely a few seconds more. So you should not be trying to do super precision tests with this function. Give your tests a few seconds leeway when checking behaviour that does NOT exceed some time span. It will work well for exceeding timeouts, or making large leaps in time, etc.

Properties

chain: Chain

Reference to the chain instance

timeAdded: number

The total number of seconds that have been skipped in the chain

Constructor

constructor(chain: Chain): Time

Methods

async increase(time: number, fromBlockTime: string = ""): Promise<number>

Incrementally increase time of chain.

async increaseTo(time: number): Promise<number>

Increase time of chain to specific time point T