2017-06-26 17:54:28 +00:00
|
|
|
pragma solidity ^0.4.11;
|
2017-10-27 14:38:25 +00:00
|
|
|
/*
|
|
|
|
Copyright 2017, Jordi Baylina
|
|
|
|
Contributor: Adrià Massanet <adria@codecontext.io>
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
2017-06-26 17:54:28 +00:00
|
|
|
|
2017-07-13 17:12:45 +00:00
|
|
|
import "./LiquidPledging.sol";
|
2017-06-26 17:54:28 +00:00
|
|
|
|
2017-10-27 14:38:25 +00:00
|
|
|
/// @dev `LiquidPledgingMock` allows for mocking up
|
|
|
|
/// a `LiquidPledging` contract with the added ability
|
|
|
|
/// to manipulate the block time for testing purposes.
|
2017-06-26 17:54:28 +00:00
|
|
|
contract LiquidPledgingMock is LiquidPledging {
|
|
|
|
|
2017-08-18 16:47:22 +00:00
|
|
|
uint public mock_time;
|
2017-06-26 17:54:28 +00:00
|
|
|
|
2017-10-27 14:38:25 +00:00
|
|
|
/// @dev `LiquidPledgingMock` creates a standard `LiquidPledging`
|
|
|
|
/// instance and sets the mocked time to the current blocktime.
|
2017-10-27 19:09:55 +00:00
|
|
|
/// @param _vault The vault where ETH backing this pledge is stored
|
2017-12-05 19:58:20 +00:00
|
|
|
function LiquidPledgingMock(
|
|
|
|
address _vault,
|
|
|
|
address _escapeHatchCaller,
|
|
|
|
address _escapeHatchDestination
|
|
|
|
) LiquidPledging(_vault, _escapeHatchCaller, _escapeHatchDestination) {
|
2017-06-26 17:54:28 +00:00
|
|
|
mock_time = now;
|
|
|
|
}
|
|
|
|
|
2017-10-27 14:38:25 +00:00
|
|
|
/// @dev `getTime` is a basic getter function for
|
|
|
|
/// the mock_time parameter
|
2017-06-26 17:54:28 +00:00
|
|
|
function getTime() internal returns (uint) {
|
|
|
|
return mock_time;
|
|
|
|
}
|
|
|
|
|
2017-10-27 14:38:25 +00:00
|
|
|
/// @dev `setMockedTime` is a basic setter function for
|
|
|
|
/// the mock_time parameter
|
|
|
|
/// @param _t This is the value to which the mocked time
|
|
|
|
/// will be set.
|
2017-06-26 17:54:28 +00:00
|
|
|
function setMockedTime(uint _t) {
|
|
|
|
mock_time = _t;
|
|
|
|
}
|
|
|
|
}
|