Testable

Base class that provides time overrides, but only if being run in test mode.

Modifiers

onlyIfTest() modifier

Reverts if not running in test mode.

constructor(address _timerAddress) internal

Constructs the Testable contract. Called by child contracts.

Parameters:

  • _timerAddress: Contract that stores the current time in a testing environment. Must be set to 0x0 for production environments that use live time.

setCurrentTime(uint256 time) external

Sets the current time.

Will revert if not running in test mode.

Parameters:

  • time: timestamp to set current Testable time to.

getCurrentTime() → uint256 public

Gets the current time. Will return the last time set in setCurrentTime if running in test mode. Otherwise, it will return the block timestamp.

© UMA Project 2018-2019