-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #127 from skalenetwork/feature/SKALE-2223-delegati…
…on-testing Feature/skale 2223 delegation testing
- Loading branch information
Showing
6 changed files
with
95 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
TimeHellpersWithDebug.sol - SKALE Manager | ||
Copyright (C) 2019-Present SKALE Labs | ||
@author Dmytro Stebaiev | ||
SKALE Manager is free software: you can redistribute it and/or modify | ||
it under the terms of the GNU Affero General Public License as published | ||
by the Free Software Foundation, either version 3 of the License, or | ||
(at your option) any later version. | ||
SKALE Manager 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 Affero General Public License for more details. | ||
You should have received a copy of the GNU Affero General Public License | ||
along with SKALE Manager. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
pragma solidity 0.5.16; | ||
|
||
import "@openzeppelin/contracts-ethereum-package/contracts/ownership/Ownable.sol"; | ||
import "@openzeppelin/upgrades/contracts/Initializable.sol"; | ||
|
||
import "../delegation/TimeHelpers.sol"; | ||
|
||
|
||
contract TimeHelpersWithDebug is TimeHelpers, Ownable { | ||
uint timeShift; | ||
|
||
function getCurrentMonth() external view returns (uint) { | ||
return timestampToMonth(now.add(timeShift)); | ||
} | ||
|
||
function skipTime(uint sec) external onlyOwner { | ||
timeShift = timeShift.add(sec); | ||
} | ||
|
||
function initialize() external initializer { | ||
Ownable.initialize(msg.sender); | ||
timeShift = 0; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { ContractManagerInstance, TimeHelpersWithDebugInstance } from "../../../../types/truffle-contracts"; | ||
import { deployFunctionFactory } from "../factory"; | ||
|
||
const deployTimeHelpersWithDebug: (contractManager: ContractManagerInstance) => Promise<TimeHelpersWithDebugInstance> | ||
= deployFunctionFactory("TimeHelpersWithDebug", | ||
undefined, | ||
async (contractManager: ContractManagerInstance) => { | ||
const TimeHelpersWithDebug = artifacts.require("./TimeHelpersWithDebug"); | ||
const instance = await TimeHelpersWithDebug.new(); | ||
await instance.initialize(); | ||
return instance; | ||
}); | ||
|
||
export { deployTimeHelpersWithDebug }; |