Update to Truffle 4.1.5 and Ganache 6.1.0 (#876)

* Update to ganache-cli v6.1.0 and truffle v4.1.0

* Update to stable version of ganache-cli

* fix: update event emission warning

- Fix event emission warnings for solidity 4.21 after truffle has been
updated to use this version

* fix pr review comments

* update to truffle v4.1.5

* update package-lock

* add additional emit keywords

* update solidity-coverage to 0.4.15

* update to solium 1.1.6

* fix MerkleProof coverage analysis by testing through wrapper

* change version pragma to ^0.4.21

* fix solium linting errors
This commit is contained in:
Francisco Giordano
2018-04-09 20:48:32 -03:00
committed by GitHub
parent 06666be93a
commit a7e91856f3
118 changed files with 2247 additions and 920 deletions

View File

@ -17,7 +17,7 @@ contract('FinalizableCrowdsale', function ([_, owner, wallet, thirdparty]) {
const rate = new BigNumber(1000);
before(async function () {
// Advance to the next block to correctly read time in the solidity "now" function interpreted by testrpc
// Advance to the next block to correctly read time in the solidity "now" function interpreted by ganache
await advanceBlock();
});

View File

@ -20,7 +20,7 @@ contract('PostDeliveryCrowdsale', function ([_, investor, wallet, purchaser]) {
const tokenSupply = new BigNumber('1e22');
before(async function () {
// Advance to the next block to correctly read time in the solidity "now" function interpreted by testrpc
// Advance to the next block to correctly read time in the solidity "now" function interpreted by ganache
await advanceBlock();
});

View File

@ -21,7 +21,7 @@ contract('RefundableCrowdsale', function ([_, owner, wallet, investor, purchaser
const tokenSupply = new BigNumber('1e22');
before(async function () {
// Advance to the next block to correctly read time in the solidity "now" function interpreted by testrpc
// Advance to the next block to correctly read time in the solidity "now" function interpreted by ganache
await advanceBlock();
});

View File

@ -20,7 +20,7 @@ contract('TimedCrowdsale', function ([_, investor, wallet, purchaser]) {
const tokenSupply = new BigNumber('1e22');
before(async function () {
// Advance to the next block to correctly read time in the solidity "now" function interpreted by testrpc
// Advance to the next block to correctly read time in the solidity "now" function interpreted by ganache
await advanceBlock();
});

View File

@ -21,7 +21,7 @@ contract('SampleCrowdsale', function ([owner, wallet, investor]) {
const CAP = ether(20);
before(async function () {
// Advance to the next block to correctly read time in the solidity "now" function interpreted by testrpc
// Advance to the next block to correctly read time in the solidity "now" function interpreted by ganache
await advanceBlock();
});

View File

@ -8,7 +8,7 @@ export default async promise => {
// TODO: When we contract A calls contract B, and B throws, instead
// of an 'invalid jump', we get an 'out of gas' error. How do
// we distinguish this from an actual out of gas event? (The
// testrpc log actually show an 'invalid jump' event.)
// ganache log actually show an 'invalid jump' event.)
const outOfGas = error.message.search('out of gas') >= 0;
const revert = error.message.search('revert') >= 0;
assert(

View File

@ -1,6 +1,6 @@
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 ganache use.
module.exports = function (message) {
const messageHex = Buffer.from(utils.sha3(message).toString('hex'), 'hex');
const prefix = utils.toBuffer('\u0019Ethereum Signed Message:\n' + messageHex.length.toString());

View File

@ -1,6 +1,6 @@
import latestTime from './latestTime';
// Increases testrpc time by the passed duration in seconds
// Increases ganache time by the passed duration in seconds
export default function increaseTime (duration) {
const id = Date.now();
@ -25,7 +25,7 @@ export default function increaseTime (duration) {
}
/**
* Beware that due to the need of calling two separate testrpc methods and rpc calls overhead
* Beware that due to the need of calling two separate ganache methods and rpc calls overhead
* it's hard to increase time precisely to a target point so design your test to tolerate
* small fluctuations from time to time.
*

View File

@ -11,7 +11,7 @@ contract('ECRecovery', function (accounts) {
});
it('recover v0', async function () {
// Signature generated outside testrpc with method web3.eth.sign(signer, message)
// Signature generated outside ganache with method web3.eth.sign(signer, message)
let signer = '0x2cc1166f6212628a0deef2b33befb2187d35b86c';
let message = web3.sha3(TEST_MESSAGE);
// eslint-disable-next-line max-len
@ -21,7 +21,7 @@ contract('ECRecovery', function (accounts) {
});
it('recover v1', async function () {
// Signature generated outside testrpc with method web3.eth.sign(signer, message)
// Signature generated outside ganache with method web3.eth.sign(signer, message)
let signer = '0x1e318623ab09fe6de3c9b8672098464aeda9100e';
let message = web3.sha3(TEST_MESSAGE);
// eslint-disable-next-line max-len

View File

@ -2,13 +2,13 @@
import MerkleTree from '../helpers/merkleTree.js';
import { sha3, bufferToHex } from 'ethereumjs-util';
var MerkleProof = artifacts.require('MerkleProof');
var MerkleProofWrapper = artifacts.require('MerkleProofWrapper');
contract('MerkleProof', function (accounts) {
let merkleProof;
before(async function () {
merkleProof = await MerkleProof.new();
merkleProof = await MerkleProofWrapper.new();
});
describe('verifyProof', function () {

View File

@ -1,4 +1,4 @@
pragma solidity ^0.4.18;
pragma solidity ^0.4.21;
import "../../contracts/math/Math.sol";