Depending on where QINToken is deployed (this changes the bool that's passed to it on construction), it and all the contracts it creates will be in test mode. Whenever these contracts check the time through the getCurrentTime function, they will receive a test time that will be set to now on initialization. Afterwards, it can be modified externally. If not in test mode, it will return now, and the set method will throw (maybe we should make this just a no-op).
@zlgrube Updated Controllable.sol as a minor cleanup. Just FYI, we generally prefer require(condition) or assert(condition) over if(!condition) { revert(); }.
This should supersede #56.
Depending on where QINToken is deployed (this changes the
bool
that's passed to it on construction), it and all the contracts it creates will be in test mode. Whenever these contracts check the time through thegetCurrentTime
function, they will receive a test time that will be set tonow
on initialization. Afterwards, it can be modified externally. If not in test mode, it will return now, and the set method will throw (maybe we should make this just a no-op).