Skip to content

Instantly share code, notes, and snippets.

@agawish
Last active March 21, 2018 00:23
Show Gist options
  • Save agawish/3b13c224ca9a210e5db5b14924083d0d to your computer and use it in GitHub Desktop.
Save agawish/3b13c224ca9a210e5db5b14924083d0d to your computer and use it in GitHub Desktop.
Helpers - common.js
/* 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