Add comments to LiquidPledgingMock

This commit is contained in:
Arthur L Lunn 2017-10-27 10:38:25 -04:00
parent 5dacc27943
commit f7e1618093
2 changed files with 30 additions and 3 deletions

View File

@ -19,8 +19,8 @@ pragma solidity ^0.4.11;
import "./ILiquidPledgingPlugin.sol";
/// @dev This is declares a few functions from `Vault` so that the
/// `LiquidPledgingBase` contract can interface with the `Vault` contract
/// @dev `Vault` serves as an interface to allow the `LiquidPledgingBase`
/// contract to interface with a `Vault` contract
contract Vault {
function authorizePayment(bytes32 _ref, address _dest, uint _amount);
function () payable;

View File

@ -1,20 +1,47 @@
pragma solidity ^0.4.11;
/*
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/>.
*/
import "./LiquidPledging.sol";
// @dev LiquidPledgingMock mocks current block number
/// @dev `LiquidPledgingMock` allows for mocking up
/// a `LiquidPledging` contract with the added ability
/// to manipulate the block time for testing purposes.
contract LiquidPledgingMock is LiquidPledging {
uint public mock_time;
/// @dev `LiquidPledgingMock` creates a standard `LiquidPledging`
/// instance and sets the mocked time to the current blocktime.
function LiquidPledgingMock(address _vault) LiquidPledging(_vault) {
mock_time = now;
}
/// @dev `getTime` is a basic getter function for
/// the mock_time parameter
function getTime() internal returns (uint) {
return mock_time;
}
/// @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.
function setMockedTime(uint _t) {
mock_time = _t;
}