Skip to content

Commit fc9e003

Browse files
prepare for getProof implementation
1 parent 9b2d670 commit fc9e003

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ You can use this to proof a specific element is available at a specific index wi
66

77
```sh
88

9-
deno run https://deno.land/x/merkletree/usage-example.ts
9+
deno run https://deno.land/x/merkletrees/usage-example.ts
1010

1111
```
1212

src/merkle-tree.spec.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { 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

54
Deno.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+
})

usage-example.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { MerkleTree, Helper } from "./mod.ts"
1+
import { MerkleTree, Helper } from "https://deno.land/x/merkletrees/mod.ts"
22

33
const exampleArray = ["dog", "horse", "cow", "chicken"]
44

0 commit comments

Comments
 (0)