-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
ßingen
committed
Jul 30, 2018
1 parent
ef93d35
commit 0910f19
Showing
2 changed files
with
37 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
pragma solidity 0.4.18; | ||
|
||
import "../../contracts/lib/misc/TimeHelpers.sol"; | ||
|
||
|
||
contract TimeHelpersMock is TimeHelpers { | ||
function getBlockNumberExt() public view returns (uint256) { | ||
return getBlockNumber(); | ||
} | ||
|
||
function getBlockNumber64Ext() public view returns (uint64) { | ||
return getBlockNumber64(); | ||
} | ||
|
||
function getTimestampExt() public view returns (uint256) { | ||
return getTimestamp(); | ||
} | ||
|
||
function getTimestamp64Ext() public view returns (uint64) { | ||
return getTimestamp64(); | ||
} | ||
} |
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,15 @@ | ||
contract('TimeHelpers test', accounts => { | ||
let timeHelpersMock | ||
|
||
before(async () => { | ||
timeHelpersMock = await artifacts.require('TimeHelpersMock').new() | ||
}) | ||
|
||
it('checks block number', async () => { | ||
assert.equal((await timeHelpersMock.getBlockNumberExt.call()).toString(), (await timeHelpersMock.getBlockNumber64Ext.call()).toString(), "block number should match") | ||
}) | ||
|
||
it('checks time stamp', async () => { | ||
assert.equal((await timeHelpersMock.getTimestampExt.call()).toString(), (await timeHelpersMock.getTimestamp64Ext.call()).toString(), "time stamp should match") | ||
}) | ||
}) |