Make Truffle provider creation lazy (#1526)
* make provider creation lazy * change getter for function * remove unused networks from truffle config * remove unused dotenv package * remove truffle-hdwallet-provider dependency * install ethereumjs-util * replace sha3 with keccak256 for ethereumjs-util v6
This commit is contained in:
committed by
GitHub
parent
c0bda4db88
commit
e7d6e86395
@ -1,5 +1,5 @@
|
||||
const { MerkleTree } = require('../helpers/merkleTree.js');
|
||||
const { sha3, bufferToHex } = require('ethereumjs-util');
|
||||
const { keccak256, bufferToHex } = require('ethereumjs-util');
|
||||
|
||||
const MerkleProofWrapper = artifacts.require('MerkleProofWrapper');
|
||||
|
||||
@ -20,7 +20,7 @@ contract('MerkleProof', function () {
|
||||
|
||||
const proof = merkleTree.getHexProof(elements[0]);
|
||||
|
||||
const leaf = bufferToHex(sha3(elements[0]));
|
||||
const leaf = bufferToHex(keccak256(elements[0]));
|
||||
|
||||
(await this.merkleProof.verify(proof, root, leaf)).should.equal(true);
|
||||
});
|
||||
@ -31,7 +31,7 @@ contract('MerkleProof', function () {
|
||||
|
||||
const correctRoot = correctMerkleTree.getHexRoot();
|
||||
|
||||
const correctLeaf = bufferToHex(sha3(correctElements[0]));
|
||||
const correctLeaf = bufferToHex(keccak256(correctElements[0]));
|
||||
|
||||
const badElements = ['d', 'e', 'f'];
|
||||
const badMerkleTree = new MerkleTree(badElements);
|
||||
@ -50,7 +50,7 @@ contract('MerkleProof', function () {
|
||||
const proof = merkleTree.getHexProof(elements[0]);
|
||||
const badProof = proof.slice(0, proof.length - 5);
|
||||
|
||||
const leaf = bufferToHex(sha3(elements[0]));
|
||||
const leaf = bufferToHex(keccak256(elements[0]));
|
||||
|
||||
(await this.merkleProof.verify(badProof, root, leaf)).should.equal(false);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user