Update docs
This commit is contained in:
@ -47,7 +47,7 @@ function split (signature) {
|
||||
web3.utils.bytesToHex(raw.slice(32, 64)), // s
|
||||
];
|
||||
default:
|
||||
expect.fail('Invalid siganture length, cannot split');
|
||||
expect.fail('Invalid signature length, cannot split');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -24,6 +24,12 @@ contract('MerkleProof', function (accounts) {
|
||||
const proof = merkleTree.getHexProof(leaf);
|
||||
|
||||
expect(await this.merkleProof.verify(proof, root, leaf)).to.equal(true);
|
||||
|
||||
// For demonstration, it is also possible to create valid proofs for certain 64-byte values *not* in elements:
|
||||
const noSuchLeaf = keccak256(
|
||||
Buffer.concat([keccak256(elements[0]), keccak256(elements[1])].sort(Buffer.compare)),
|
||||
);
|
||||
expect(await this.merkleProof.verify(proof.slice(1), root, noSuchLeaf)).to.equal(true);
|
||||
});
|
||||
|
||||
it('returns false for an invalid Merkle proof', async function () {
|
||||
|
||||
Reference in New Issue
Block a user