UNPKG

solidity-cron

Version:

[![Build Status](https://travis-ci.com/Frontier-project/cron.svg?token=DJeMzxJJncp3nRaEUuxH&branch=master)](https://travis-ci.com/Frontier-project/cron) [![codecov](https://codecov.io/gh/Frontier-project/cron/branch/master/graph/badge.svg?token=BGbU5Q6IRV

24 lines (22 loc) 909 B
const TracksCreationContract = artifacts.require('Traceable') let TracksCreationInstance let PeriodInstance let deployBlockNumber let deployTimestamp contract('Traceable', function (accounts) { beforeEach(async () => { TracksCreationInstance = await TracksCreationContract.new() deployTimestamp = await web3.eth.getBlock(web3.eth.blockNumber).timestamp deployBlockNumber = web3.eth.blockNumber }) describe('Calculating Height', async () => { it('Should record the transaction block properly', async () => { const contractBlock = await TracksCreationInstance.creationBlock() assert.equal(deployBlockNumber, contractBlock.toNumber()) }) it('Should record the transaction timestamp properly', async () => { const contractTimestamp = await TracksCreationInstance.creationTimestamp() assert.equal(deployTimestamp, contractTimestamp.toNumber()) }) }) })