Commit d07bdccc by Matt Condon

feat: manually fix linting errors across tests

parent 227a3353
...@@ -12,7 +12,7 @@ contract('BasicToken', function (accounts) { ...@@ -12,7 +12,7 @@ contract('BasicToken', function (accounts) {
it('should return correct balances after transfer', async function () { it('should return correct balances after transfer', async function () {
let token = await BasicTokenMock.new(accounts[0], 100); let token = await BasicTokenMock.new(accounts[0], 100);
let transfer = await token.transfer(accounts[1], 100); await token.transfer(accounts[1], 100);
let firstAccountBalance = await token.balanceOf(accounts[0]); let firstAccountBalance = await token.balanceOf(accounts[0]);
assert.equal(firstAccountBalance, 0); assert.equal(firstAccountBalance, 0);
...@@ -24,7 +24,7 @@ contract('BasicToken', function (accounts) { ...@@ -24,7 +24,7 @@ contract('BasicToken', function (accounts) {
it('should throw an error when trying to transfer more than balance', async function () { it('should throw an error when trying to transfer more than balance', async function () {
let token = await BasicTokenMock.new(accounts[0], 100); let token = await BasicTokenMock.new(accounts[0], 100);
try { try {
let transfer = await token.transfer(accounts[1], 101); await token.transfer(accounts[1], 101);
assert.fail('should have thrown before'); assert.fail('should have thrown before');
} catch (error) { } catch (error) {
assertRevert(error); assertRevert(error);
...@@ -34,7 +34,7 @@ contract('BasicToken', function (accounts) { ...@@ -34,7 +34,7 @@ contract('BasicToken', function (accounts) {
it('should throw an error when trying to transfer to 0x0', async function () { it('should throw an error when trying to transfer to 0x0', async function () {
let token = await BasicTokenMock.new(accounts[0], 100); let token = await BasicTokenMock.new(accounts[0], 100);
try { try {
let transfer = await token.transfer(0x0, 100); await token.transfer(0x0, 100);
assert.fail('should have thrown before'); assert.fail('should have thrown before');
} catch (error) { } catch (error) {
assertRevert(error); assertRevert(error);
......
import expectThrow from './helpers/expectThrow'; import expectThrow from './helpers/expectThrow';
import toPromise from './helpers/toPromise';
const CanReclaimToken = artifacts.require('../contracts/ownership/CanReclaimToken.sol'); const CanReclaimToken = artifacts.require('../contracts/ownership/CanReclaimToken.sol');
const BasicTokenMock = artifacts.require('./mocks/BasicTokenMock.sol'); const BasicTokenMock = artifacts.require('./mocks/BasicTokenMock.sol');
......
import expectThrow from './helpers/expectThrow'; import expectThrow from './helpers/expectThrow';
import ether from './helpers/ether'; import ether from './helpers/ether';
var CappedToken = artifacts.require('../contracts/Tokens/CappedToken.sol');
const BigNumber = web3.BigNumber; var CappedToken = artifacts.require('../contracts/Tokens/CappedToken.sol');
contract('Capped', function (accounts) { contract('Capped', function (accounts) {
const cap = ether(1000); const cap = ether(1000);
......
const assertRevert = require('./helpers/assertRevert');
var Contactable = artifacts.require('../contracts/ownership/Contactable.sol'); var Contactable = artifacts.require('../contracts/ownership/Contactable.sol');
contract('Contactable', function (accounts) { contract('Contactable', function (accounts) {
...@@ -12,7 +10,7 @@ contract('Contactable', function (accounts) { ...@@ -12,7 +10,7 @@ contract('Contactable', function (accounts) {
it('should have an empty contact info', async function () { it('should have an empty contact info', async function () {
let info = await contactable.contactInformation(); let info = await contactable.contactInformation();
assert.isTrue(info == ''); assert.isTrue(info === '');
}); });
describe('after setting the contact information', function () { describe('after setting the contact information', function () {
......
const assertRevert = require('./helpers/assertRevert');
import latestTime from './helpers/latestTime'; import latestTime from './helpers/latestTime';
import { increaseTimeTo, duration } from './helpers/increaseTime'; import { increaseTimeTo, duration } from './helpers/increaseTime';
var DayLimitMock = artifacts.require('./mocks/DayLimitMock.sol'); const assertRevert = require('./helpers/assertRevert');
const DayLimitMock = artifacts.require('./mocks/DayLimitMock.sol');
contract('DayLimit', function (accounts) { contract('DayLimit', function (accounts) {
let dayLimit; let dayLimit;
......
var ECRecovery = artifacts.require('../contracts/ECRecovery.sol'); var ECRecovery = artifacts.require('../contracts/ECRecovery.sol');
var utils = require('ethereumjs-util');
var hashMessage = require('./helpers/hashMessage.js'); var hashMessage = require('./helpers/hashMessage.js');
contract('ECRecovery', function (accounts) { contract('ECRecovery', function (accounts) {
...@@ -13,6 +12,7 @@ contract('ECRecovery', function (accounts) { ...@@ -13,6 +12,7 @@ contract('ECRecovery', function (accounts) {
// Signature generated outside testrpc with method web3.eth.sign(signer, message) // Signature generated outside testrpc with method web3.eth.sign(signer, message)
let signer = '0x2cc1166f6212628a0deef2b33befb2187d35b86c'; let signer = '0x2cc1166f6212628a0deef2b33befb2187d35b86c';
let message = '0x7dbaf558b0a1a5dc7a67202117ab143c1d8605a983e4a743bc06fcc03162dc0d'; // web3.sha3('OpenZeppelin') let message = '0x7dbaf558b0a1a5dc7a67202117ab143c1d8605a983e4a743bc06fcc03162dc0d'; // web3.sha3('OpenZeppelin')
// eslint-disable-next-line max-len
let signature = '0x5d99b6f7f6d1f73d1a26497f2b1c89b24c0993913f86e9a2d02cd69887d9c94f3c880358579d811b21dd1b7fd9bb01c1d81d10e69f0384e675c32b39643be89200'; let signature = '0x5d99b6f7f6d1f73d1a26497f2b1c89b24c0993913f86e9a2d02cd69887d9c94f3c880358579d811b21dd1b7fd9bb01c1d81d10e69f0384e675c32b39643be89200';
assert.equal(signer, await ecrecovery.recover(message, signature)); assert.equal(signer, await ecrecovery.recover(message, signature));
}); });
...@@ -21,6 +21,7 @@ contract('ECRecovery', function (accounts) { ...@@ -21,6 +21,7 @@ contract('ECRecovery', function (accounts) {
// Signature generated outside testrpc with method web3.eth.sign(signer, message) // Signature generated outside testrpc with method web3.eth.sign(signer, message)
let signer = '0x1e318623ab09fe6de3c9b8672098464aeda9100e'; let signer = '0x1e318623ab09fe6de3c9b8672098464aeda9100e';
let message = '0x7dbaf558b0a1a5dc7a67202117ab143c1d8605a983e4a743bc06fcc03162dc0d'; // web3.sha3('OpenZeppelin') let message = '0x7dbaf558b0a1a5dc7a67202117ab143c1d8605a983e4a743bc06fcc03162dc0d'; // web3.sha3('OpenZeppelin')
// eslint-disable-next-line max-len
let signature = '0x331fe75a821c982f9127538858900d87d3ec1f9f737338ad67cad133fa48feff48e6fa0c18abc62e42820f05943e47af3e9fbe306ce74d64094bdf1691ee53e001'; let signature = '0x331fe75a821c982f9127538858900d87d3ec1f9f737338ad67cad133fa48feff48e6fa0c18abc62e42820f05943e47af3e9fbe306ce74d64094bdf1691ee53e001';
assert.equal(signer, await ecrecovery.recover(message, signature)); assert.equal(signer, await ecrecovery.recover(message, signature));
}); });
......
import expectThrow from './helpers/expectThrow'; import expectThrow from './helpers/expectThrow';
import toPromise from './helpers/toPromise';
const Ownable = artifacts.require('../contracts/ownership/Ownable.sol'); const Ownable = artifacts.require('../contracts/ownership/Ownable.sol');
const HasNoContracts = artifacts.require( const HasNoContracts = artifacts.require(
'../contracts/ownership/HasNoContracts.sol', '../contracts/ownership/HasNoContracts.sol',
......
import expectThrow from './helpers/expectThrow'; import expectThrow from './helpers/expectThrow';
import toPromise from './helpers/toPromise'; import toPromise from './helpers/toPromise';
const HasNoEther = artifacts.require('../contracts/lifecycle/HasNoEther.sol');
const HasNoEtherTest = artifacts.require('../mocks/HasNoEtherTest.sol'); const HasNoEtherTest = artifacts.require('../mocks/HasNoEtherTest.sol');
const ForceEther = artifacts.require('../mocks/ForceEther.sol'); const ForceEther = artifacts.require('../mocks/ForceEther.sol');
...@@ -9,7 +8,7 @@ contract('HasNoEther', function (accounts) { ...@@ -9,7 +8,7 @@ contract('HasNoEther', function (accounts) {
const amount = web3.toWei('1', 'ether'); const amount = web3.toWei('1', 'ether');
it('should be constructorable', async function () { it('should be constructorable', async function () {
let hasNoEther = await HasNoEtherTest.new(); await HasNoEtherTest.new();
}); });
it('should not accept ether in constructor', async function () { it('should not accept ether in constructor', async function () {
......
import expectThrow from './helpers/expectThrow'; import expectThrow from './helpers/expectThrow';
import toPromise from './helpers/toPromise';
const HasNoTokens = artifacts.require('../contracts/lifecycle/HasNoTokens.sol'); const HasNoTokens = artifacts.require('../contracts/lifecycle/HasNoTokens.sol');
const ERC23TokenMock = artifacts.require('./mocks/ERC23TokenMock.sol'); const ERC23TokenMock = artifacts.require('./mocks/ERC23TokenMock.sol');
......
var MerkleProof = artifacts.require('./MerkleProof.sol');
import MerkleTree from './helpers/merkleTree.js'; import MerkleTree from './helpers/merkleTree.js';
import { sha3, bufferToHex } from 'ethereumjs-util'; import { sha3, bufferToHex } from 'ethereumjs-util';
var MerkleProof = artifacts.require('./MerkleProof.sol');
contract('MerkleProof', function (accounts) { contract('MerkleProof', function (accounts) {
let merkleProof; let merkleProof;
......
...@@ -14,7 +14,7 @@ contract('PullPayment', function (accounts) { ...@@ -14,7 +14,7 @@ contract('PullPayment', function (accounts) {
it('can record an async payment correctly', async function () { it('can record an async payment correctly', async function () {
let AMOUNT = 100; let AMOUNT = 100;
let callSend = await ppce.callSend(accounts[0], AMOUNT); await ppce.callSend(accounts[0], AMOUNT);
let paymentsToAccount0 = await ppce.payments(accounts[0]); let paymentsToAccount0 = await ppce.payments(accounts[0]);
let totalPayments = await ppce.totalPayments(); let totalPayments = await ppce.totalPayments();
...@@ -23,8 +23,8 @@ contract('PullPayment', function (accounts) { ...@@ -23,8 +23,8 @@ contract('PullPayment', function (accounts) {
}); });
it('can add multiple balances on one account', async function () { it('can add multiple balances on one account', async function () {
let call1 = await ppce.callSend(accounts[0], 200); await ppce.callSend(accounts[0], 200);
let call2 = await ppce.callSend(accounts[0], 300); await ppce.callSend(accounts[0], 300);
let paymentsToAccount0 = await ppce.payments(accounts[0]); let paymentsToAccount0 = await ppce.payments(accounts[0]);
let totalPayments = await ppce.totalPayments(); let totalPayments = await ppce.totalPayments();
...@@ -33,8 +33,8 @@ contract('PullPayment', function (accounts) { ...@@ -33,8 +33,8 @@ contract('PullPayment', function (accounts) {
}); });
it('can add balances on multiple accounts', async function () { it('can add balances on multiple accounts', async function () {
let call1 = await ppce.callSend(accounts[0], 200); await ppce.callSend(accounts[0], 200);
let call2 = await ppce.callSend(accounts[1], 300); await ppce.callSend(accounts[1], 300);
let paymentsToAccount0 = await ppce.payments(accounts[0]); let paymentsToAccount0 = await ppce.payments(accounts[0]);
assert.equal(paymentsToAccount0, 200); assert.equal(paymentsToAccount0, 200);
...@@ -50,7 +50,7 @@ contract('PullPayment', function (accounts) { ...@@ -50,7 +50,7 @@ contract('PullPayment', function (accounts) {
let payee = accounts[1]; let payee = accounts[1];
let initialBalance = web3.eth.getBalance(payee); let initialBalance = web3.eth.getBalance(payee);
let call1 = await ppce.callSend(payee, amount); await ppce.callSend(payee, amount);
let payment1 = await ppce.payments(payee); let payment1 = await ppce.payments(payee);
assert.equal(payment1, amount); assert.equal(payment1, amount);
...@@ -58,7 +58,7 @@ contract('PullPayment', function (accounts) { ...@@ -58,7 +58,7 @@ contract('PullPayment', function (accounts) {
let totalPayments = await ppce.totalPayments(); let totalPayments = await ppce.totalPayments();
assert.equal(totalPayments, amount); assert.equal(totalPayments, amount);
let withdraw = await ppce.withdrawPayments({ from: payee }); await ppce.withdrawPayments({ from: payee });
let payment2 = await ppce.payments(payee); let payment2 = await ppce.payments(payee);
assert.equal(payment2, 0); assert.equal(payment2, 0);
......
import ether from './helpers/ether';
import EVMRevert from './helpers/EVMRevert';
const BigNumber = web3.BigNumber; const BigNumber = web3.BigNumber;
require('chai') require('chai')
...@@ -5,9 +8,6 @@ require('chai') ...@@ -5,9 +8,6 @@ require('chai')
.use(require('chai-bignumber')(BigNumber)) .use(require('chai-bignumber')(BigNumber))
.should(); .should();
import ether from './helpers/ether';
import EVMRevert from './helpers/EVMRevert';
const RefundVault = artifacts.require('RefundVault'); const RefundVault = artifacts.require('RefundVault');
contract('RefundVault', function ([_, owner, wallet, investor]) { contract('RefundVault', function ([_, owner, wallet, investor]) {
......
...@@ -33,7 +33,8 @@ contract('RefundableCrowdsale', function ([_, owner, wallet, investor]) { ...@@ -33,7 +33,8 @@ contract('RefundableCrowdsale', function ([_, owner, wallet, investor]) {
describe('creating a valid crowdsale', function () { describe('creating a valid crowdsale', function () {
it('should fail with zero goal', async function () { it('should fail with zero goal', async function () {
await RefundableCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0, { from: owner }).should.be.rejectedWith(EVMRevert); await RefundableCrowdsale.new(this.startTime, this.endTime, rate, wallet, 0, { from: owner })
.should.be.rejectedWith(EVMRevert);
}); });
}); });
......
...@@ -12,7 +12,7 @@ contract('SafeMath', function (accounts) { ...@@ -12,7 +12,7 @@ contract('SafeMath', function (accounts) {
it('multiplies correctly', async function () { it('multiplies correctly', async function () {
let a = 5678; let a = 5678;
let b = 1234; let b = 1234;
let mult = await safeMath.multiply(a, b); await safeMath.multiply(a, b);
let result = await safeMath.result(); let result = await safeMath.result();
assert.equal(result, a * b); assert.equal(result, a * b);
}); });
...@@ -20,7 +20,7 @@ contract('SafeMath', function (accounts) { ...@@ -20,7 +20,7 @@ contract('SafeMath', function (accounts) {
it('adds correctly', async function () { it('adds correctly', async function () {
let a = 5678; let a = 5678;
let b = 1234; let b = 1234;
let add = await safeMath.add(a, b); await safeMath.add(a, b);
let result = await safeMath.result(); let result = await safeMath.result();
assert.equal(result, a + b); assert.equal(result, a + b);
...@@ -29,7 +29,7 @@ contract('SafeMath', function (accounts) { ...@@ -29,7 +29,7 @@ contract('SafeMath', function (accounts) {
it('subtracts correctly', async function () { it('subtracts correctly', async function () {
let a = 5678; let a = 5678;
let b = 1234; let b = 1234;
let subtract = await safeMath.subtract(a, b); await safeMath.subtract(a, b);
let result = await safeMath.result(); let result = await safeMath.result();
assert.equal(result, a - b); assert.equal(result, a - b);
...@@ -39,7 +39,7 @@ contract('SafeMath', function (accounts) { ...@@ -39,7 +39,7 @@ contract('SafeMath', function (accounts) {
let a = 1234; let a = 1234;
let b = 5678; let b = 5678;
try { try {
let subtract = await safeMath.subtract(a, b); await safeMath.subtract(a, b);
assert.fail('should have thrown before'); assert.fail('should have thrown before');
} catch (error) { } catch (error) {
assertJump(error); assertJump(error);
...@@ -50,7 +50,7 @@ contract('SafeMath', function (accounts) { ...@@ -50,7 +50,7 @@ contract('SafeMath', function (accounts) {
let a = 115792089237316195423570985008687907853269984665640564039457584007913129639935; let a = 115792089237316195423570985008687907853269984665640564039457584007913129639935;
let b = 1; let b = 1;
try { try {
let add = await safeMath.add(a, b); await safeMath.add(a, b);
assert.fail('should have thrown before'); assert.fail('should have thrown before');
} catch (error) { } catch (error) {
assertRevert(error); assertRevert(error);
...@@ -61,7 +61,7 @@ contract('SafeMath', function (accounts) { ...@@ -61,7 +61,7 @@ contract('SafeMath', function (accounts) {
let a = 115792089237316195423570985008687907853269984665640564039457584007913129639933; let a = 115792089237316195423570985008687907853269984665640564039457584007913129639933;
let b = 2; let b = 2;
try { try {
let multiply = await safeMath.multiply(a, b); await safeMath.multiply(a, b);
assert.fail('should have thrown before'); assert.fail('should have thrown before');
} catch (error) { } catch (error) {
assertRevert(error); assertRevert(error);
......
...@@ -6,7 +6,7 @@ import EVMRevert from './helpers/EVMRevert'; ...@@ -6,7 +6,7 @@ import EVMRevert from './helpers/EVMRevert';
const BigNumber = web3.BigNumber; const BigNumber = web3.BigNumber;
const should = require('chai') require('chai')
.use(require('chai-as-promised')) .use(require('chai-as-promised'))
.use(require('chai-bignumber')(BigNumber)) .use(require('chai-bignumber')(BigNumber))
.should(); .should();
...@@ -14,7 +14,7 @@ const should = require('chai') ...@@ -14,7 +14,7 @@ const should = require('chai')
const SampleCrowdsale = artifacts.require('SampleCrowdsale'); const SampleCrowdsale = artifacts.require('SampleCrowdsale');
const SampleCrowdsaleToken = artifacts.require('SampleCrowdsaleToken'); const SampleCrowdsaleToken = artifacts.require('SampleCrowdsaleToken');
contract('Crowdsale', function ([owner, wallet, investor]) { contract('SampleCrowdsale', function ([owner, wallet, investor]) {
const RATE = new BigNumber(10); const RATE = new BigNumber(10);
const GOAL = ether(10); const GOAL = ether(10);
const CAP = ether(20); const CAP = ether(20);
...@@ -37,12 +37,19 @@ contract('Crowdsale', function ([owner, wallet, investor]) { ...@@ -37,12 +37,19 @@ contract('Crowdsale', function ([owner, wallet, investor]) {
this.crowdsale.should.exist; this.crowdsale.should.exist;
this.token.should.exist; this.token.should.exist;
(await this.crowdsale.startTime()).should.be.bignumber.equal(this.startTime); const startTime = await this.crowdsale.startTime();
(await this.crowdsale.endTime()).should.be.bignumber.equal(this.endTime); const endTime = await this.crowdsale.endTime();
(await this.crowdsale.rate()).should.be.bignumber.equal(RATE); const rate = await this.crowdsale.rate();
(await this.crowdsale.wallet()).should.be.equal(wallet); const walletAddress = await this.crowdsale.wallet();
(await this.crowdsale.goal()).should.be.bignumber.equal(GOAL); const goal = await this.crowdsale.goal();
(await this.crowdsale.cap()).should.be.bignumber.equal(CAP); const cap = await this.crowdsale.cap();
startTime.should.be.bignumber.equal(this.startTime);
endTime.should.be.bignumber.equal(this.endTime);
rate.should.be.bignumber.equal(RATE);
walletAddress.should.be.equal(wallet);
goal.should.be.bignumber.equal(GOAL);
cap.should.be.bignumber.equal(CAP);
}); });
it('should not accept payments before start', async function () { it('should not accept payments before start', async function () {
......
const BigNumber = web3.BigNumber; const BigNumber = web3.BigNumber;
const should = require('chai') require('chai')
.use(require('chai-as-promised')) .use(require('chai-as-promised'))
.use(require('chai-bignumber')(BigNumber)) .use(require('chai-bignumber')(BigNumber))
.should(); .should();
......
const assertRevert = require('./helpers/assertRevert'); const assertRevert = require('./helpers/assertRevert');
const expectThrow = require('./helpers/expectThrow');
var StandardTokenMock = artifacts.require('./mocks/StandardTokenMock.sol'); var StandardTokenMock = artifacts.require('./mocks/StandardTokenMock.sol');
contract('StandardToken', function (accounts) { contract('StandardToken', function (accounts) {
...@@ -108,7 +108,7 @@ contract('StandardToken', function (accounts) { ...@@ -108,7 +108,7 @@ contract('StandardToken', function (accounts) {
it('should throw an error when trying to transfer to 0x0', async function () { it('should throw an error when trying to transfer to 0x0', async function () {
let token = await StandardTokenMock.new(accounts[0], 100); let token = await StandardTokenMock.new(accounts[0], 100);
try { try {
let transfer = await token.transfer(0x0, 100); await token.transfer(0x0, 100);
assert.fail('should have thrown before'); assert.fail('should have thrown before');
} catch (error) { } catch (error) {
assertRevert(error); assertRevert(error);
...@@ -119,7 +119,7 @@ contract('StandardToken', function (accounts) { ...@@ -119,7 +119,7 @@ contract('StandardToken', function (accounts) {
let token = await StandardTokenMock.new(accounts[0], 100); let token = await StandardTokenMock.new(accounts[0], 100);
await token.approve(accounts[1], 100); await token.approve(accounts[1], 100);
try { try {
let transfer = await token.transferFrom(accounts[0], 0x0, 100, { from: accounts[1] }); await token.transferFrom(accounts[0], 0x0, 100, { from: accounts[1] });
assert.fail('should have thrown before'); assert.fail('should have thrown before');
} catch (error) { } catch (error) {
assertRevert(error); assertRevert(error);
......
import latestTime from './helpers/latestTime';
import { increaseTimeTo, duration } from './helpers/increaseTime';
const BigNumber = web3.BigNumber; const BigNumber = web3.BigNumber;
require('chai') require('chai')
...@@ -5,9 +8,6 @@ require('chai') ...@@ -5,9 +8,6 @@ require('chai')
.use(require('chai-bignumber')(BigNumber)) .use(require('chai-bignumber')(BigNumber))
.should(); .should();
import latestTime from './helpers/latestTime';
import { increaseTimeTo, duration } from './helpers/increaseTime';
const MintableToken = artifacts.require('MintableToken'); const MintableToken = artifacts.require('MintableToken');
const TokenTimelock = artifacts.require('TokenTimelock'); const TokenTimelock = artifacts.require('TokenTimelock');
......
import EVMRevert from './helpers/EVMRevert';
import latestTime from './helpers/latestTime';
import { increaseTimeTo, duration } from './helpers/increaseTime';
const BigNumber = web3.BigNumber; const BigNumber = web3.BigNumber;
require('chai') require('chai')
...@@ -5,10 +9,6 @@ require('chai') ...@@ -5,10 +9,6 @@ require('chai')
.use(require('chai-bignumber')(BigNumber)) .use(require('chai-bignumber')(BigNumber))
.should(); .should();
import EVMRevert from './helpers/EVMRevert';
import latestTime from './helpers/latestTime';
import { increaseTimeTo, duration } from './helpers/increaseTime';
const MintableToken = artifacts.require('MintableToken'); const MintableToken = artifacts.require('MintableToken');
const TokenVesting = artifacts.require('TokenVesting'); const TokenVesting = artifacts.require('TokenVesting');
...@@ -104,7 +104,7 @@ contract('TokenVesting', function ([_, owner, beneficiary]) { ...@@ -104,7 +104,7 @@ contract('TokenVesting', function ([_, owner, beneficiary]) {
it('should fail to be revoked a second time', async function () { it('should fail to be revoked a second time', async function () {
await increaseTimeTo(this.start + this.cliff + duration.weeks(12)); await increaseTimeTo(this.start + this.cliff + duration.weeks(12));
const vested = await this.vesting.vestedAmount(this.token.address); await this.vesting.vestedAmount(this.token.address);
await this.vesting.revoke(this.token.address, { from: owner }); await this.vesting.revoke(this.token.address, { from: owner });
......
...@@ -2,7 +2,7 @@ import utils from 'ethereumjs-util'; ...@@ -2,7 +2,7 @@ import utils from 'ethereumjs-util';
// Hash and add same prefix to the hash that testrpc use. // Hash and add same prefix to the hash that testrpc use.
module.exports = function (message) { module.exports = function (message) {
const messageHex = new Buffer(utils.sha3(message).toString('hex'), 'hex'); const messageHex = Buffer.from(utils.sha3(message).toString('hex'), 'hex');
const prefix = utils.toBuffer('\u0019Ethereum Signed Message:\n' + messageHex.length.toString()); const prefix = utils.toBuffer('\u0019Ethereum Signed Message:\n' + messageHex.length.toString());
return utils.bufferToHex(utils.sha3(Buffer.concat([prefix, messageHex]))); return utils.bufferToHex(utils.sha3(Buffer.concat([prefix, messageHex])));
}; };
...@@ -15,7 +15,7 @@ export default class MerkleTree { ...@@ -15,7 +15,7 @@ export default class MerkleTree {
} }
getLayers (elements) { getLayers (elements) {
if (elements.length == 0) { if (elements.length === 0) {
return [['']]; return [['']];
} }
......
export default func => export default func =>
(...args) => (...args) =>
new Promise((accept, reject) => new Promise((resolve, reject) =>
func(...args, (error, data) => error ? reject(error) : accept(data))); func(...args, (error, data) => error ? reject(error) : resolve(data)));
...@@ -21,15 +21,15 @@ module.exports = { ...@@ -21,15 +21,15 @@ module.exports = {
development: { development: {
host: 'localhost', host: 'localhost',
port: 8545, port: 8545,
network_id: '*', network_id: '*', // eslint-disable-line camelcase
}, },
ropsten: { ropsten: {
provider: ropstenProvider, provider: ropstenProvider,
network_id: 3, // official id of the ropsten network network_id: 3, // eslint-disable-line camelcase
}, },
coverage: { coverage: {
host: 'localhost', host: 'localhost',
network_id: '*', network_id: '*', // eslint-disable-line camelcase
port: 8555, port: 8555,
gas: 0xfffffffffff, gas: 0xfffffffffff,
gasPrice: 0x01, gasPrice: 0x01,
...@@ -37,12 +37,12 @@ module.exports = { ...@@ -37,12 +37,12 @@ module.exports = {
testrpc: { testrpc: {
host: 'localhost', host: 'localhost',
port: 8545, port: 8545,
network_id: '*', network_id: '*', // eslint-disable-line camelcase
}, },
ganache: { ganache: {
host: 'localhost', host: 'localhost',
port: 7545, port: 7545,
network_id: '*', network_id: '*', // eslint-disable-line camelcase
}, },
}, },
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment