Skip to content

Commit

Permalink
Merge pull request #10 from EspeoBlockchain/feature/documentation
Browse files Browse the repository at this point in the history
changes needed for easier Getting started in documentation
  • Loading branch information
Krzysztof Wędrowicz authored Jan 16, 2019
2 parents 0cb796d + e8e915e commit 6db314e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .env.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PRIVATE_KEY=
PRIVATE_KEY=0x4f3edf983ac636a65a842ce7c78d9aa706d3b113bce9c46f30d7d21715b23b1d
MNEMONIC=
ROPSTEN_PROVIDER_URL=
ORACLE_SERVER_ADDRESS=
ORACLE_SERVER_ADDRESS=0x1df62f291b2e969fb0849d99d9ce41e2f137006e
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
copy-env:
if ! [ -e .env ]; then cp .env.tpl .env; fi;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "gardener-smart-contracts",
"name": "gardener-ethereum",
"version": "0.1.0",
"description": "Ethereum smart contracts for Gardener open source oracle project",
"files": [
Expand Down
9 changes: 6 additions & 3 deletions test/OracleTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ const timeController = require('./utils/timeController');
const Oracle = artifacts.require('Oracle');
const UsingOracle = artifacts.require('UsingOracle');

const ONE_DAY = 60 * 60 * 24;

contract('Oracle', (accounts) => {
const sut = {};
const serverAddress = accounts[1];
Expand Down Expand Up @@ -185,10 +187,11 @@ contract('Oracle', (accounts) => {
it('should emit RequestFullfilled event when fulfill request with valid delay as timestamp', async () => {
// given
const url = 'someurl.example.com';
const delayAsTimestamp = 1546300800; // 2020/01/01 as unix timestamp.
const delayAsTimestamp = timeController.currentTimestamp().add(ONE_DAY);

const transaction = await sut.usingOracle.delayedRequest(url, delayAsTimestamp);
const { blockNumber } = transaction.receipt;
timeController.addDays(100); // Adding 15 months from now.
timeController.addDays(1);
const events = await getEvents(
sut.instance,
{ eventName: 'DelayedDataRequested', eventArgs: {} },
Expand All @@ -210,7 +213,7 @@ contract('Oracle', (accounts) => {
it('should reject fulfilling request for invalid request delay as timestamp', async () => {
// given
const url = 'someurl.example.com';
const delayInSeconds = 1577836802;
const delayInSeconds = timeController.currentTimestamp().add(ONE_DAY);
const transaction = await sut.usingOracle.delayedRequest(url, delayInSeconds);
const { blockNumber } = transaction.receipt;
const events = await getEvents(
Expand Down

0 comments on commit 6db314e

Please sign in to comment.