this is used in tests (#1380)

* signing prefix added

* Minor improvement

* Tests changed

* Successfully tested

* Minor improvements

* Minor improvements

* Revert "Dangling commas are now required. (#1359)"

This reverts commit a6889776f4.

* updates

* fixes #1200

* suggested change
This commit is contained in:
Aniket
2018-10-04 18:27:37 +05:30
committed by Nicolás Venturo
parent fd4de77651
commit b41b125c15
4 changed files with 21 additions and 30 deletions

View File

@ -7,10 +7,8 @@ require('chai')
.should();
contract('MerkleProof', function () {
let merkleProof;
beforeEach(async function () {
merkleProof = await MerkleProofWrapper.new();
this.merkleProof = await MerkleProofWrapper.new();
});
describe('verify', function () {
@ -24,7 +22,7 @@ contract('MerkleProof', function () {
const leaf = bufferToHex(sha3(elements[0]));
(await merkleProof.verify(proof, root, leaf)).should.equal(true);
(await this.merkleProof.verify(proof, root, leaf)).should.equal(true);
});
it('should return false for an invalid Merkle proof', async function () {
@ -40,7 +38,7 @@ contract('MerkleProof', function () {
const badProof = badMerkleTree.getHexProof(badElements[0]);
(await merkleProof.verify(badProof, correctRoot, correctLeaf)).should.equal(false);
(await this.merkleProof.verify(badProof, correctRoot, correctLeaf)).should.equal(false);
});
it('should return false for a Merkle proof of invalid length', async function () {
@ -54,7 +52,7 @@ contract('MerkleProof', function () {
const leaf = bufferToHex(sha3(elements[0]));
(await merkleProof.verify(badProof, root, leaf)).should.equal(false);
(await this.merkleProof.verify(badProof, root, leaf)).should.equal(false);
});
});
});