Last active
March 21, 2018 00:23
-
-
Save agawish/3b13c224ca9a210e5db5b14924083d0d to your computer and use it in GitHub Desktop.
Helpers - common.js
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
/* Loading all imports */ | |
const _ = require('lodash'); | |
const expectRevert = require('./expectRevert'); | |
const Survey = artifacts.require("./Survey.sol"); | |
const SurveyFactory = artifacts.require("./SurveyFactory.sol"); | |
const BigNumber = web3.BigNumber; | |
require('chai') | |
.use(require('chai-bignumber')(BigNumber)) | |
.use(require('chai-as-promised')) | |
.should();//To enable should chai style | |
/* Creating a class with all common Variables */ | |
class CommonVariables { | |
constructor(_accounts) { | |
this.accounts = _accounts; | |
this.appOwner = _accounts[0] | |
this.surveyMaker = _accounts[1] | |
this.participants = _.difference(_accounts, [_accounts[0], _accounts[1]]); | |
this.surveyCreationCost = web3.toWei('1', 'ether'); //5 Stars services! | |
this.surveyReward = web3.toWei('1', 'ether'); | |
this.surveyRewardAndCreationCost = web3.toWei('2', 'ether'); | |
} | |
} | |
/* Exporting the module */ | |
module.exports = { | |
BigNumber, | |
SurveyFactory, | |
Survey, | |
expectRevert, | |
CommonVariables | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment