11import { assertEquals } from "https://deno.land/std@0.86.0/testing/asserts.ts"
2- import { Helper } from "./helper.ts" ;
3- import { MerkleTree } from "./merkle-tree.ts" ;
2+ import { MerkleTree , Helper } from "../mod.ts" ;
43
54Deno . test ( "should return valid as the investigated entry is in array" , async ( ) => {
65
@@ -22,15 +21,15 @@ Deno.test("should return valid as the investigated entry is in array", async ()
2221 }
2322} )
2423
25- // Deno.test("should return the correct proof for an element at a specific index", async () => {
24+ Deno . test ( "should return the correct proof for an element at a specific index" , async ( ) => {
2625
27- // const exampleArray = ["dog", "horse", "cow", "chicken"]
28- // const merkleTree = new MerkleTree(exampleArray)
26+ const exampleArray = [ "dog" , "horse" , "cow" , "chicken" ]
27+ const merkleTree = new MerkleTree ( exampleArray )
2928
30- // const proof = merkleTree.getProof(exampleArray.indexOf("dog"))
29+ const proof = merkleTree . getProof ( exampleArray . indexOf ( "dog" ) )
3130
32- // const expectedProof = ["fd62862b6dc213bee77c2badd6311528253c6cb3107e03c16051aa15584eca1c", "a12b2f7a5ddb20963c22654f6b22a6955c9956a20c76a0e8f169a437aafb4c98"]
31+ const expectedProof = [ "fd62862b6dc213bee77c2badd6311528253c6cb3107e03c16051aa15584eca1c" , "a12b2f7a5ddb20963c22654f6b22a6955c9956a20c76a0e8f169a437aafb4c98" ]
3332
34- // assertEquals(proof, expectedProof)
33+ assertEquals ( proof , expectedProof )
3534
36- // })
35+ } )
0 commit comments