Skip to content

Commit 0951d3c

Browse files
authored
Add encoding to fs.readFileSync calls
1 parent fc56e44 commit 0951d3c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ import { StandardMerkleTree } from "@openzeppelin/merkle-tree";
5252
import fs from "fs";
5353

5454
// (1)
55-
const tree = StandardMerkleTree.load(JSON.parse(fs.readFileSync("tree.json")));
55+
const tree = StandardMerkleTree.load(JSON.parse(fs.readFileSync("tree.json", "utf8")));
5656

5757
// (2)
5858
for (const [i, v] of tree.entries()) {
@@ -168,7 +168,7 @@ Returns a boolean that is `true` when the multiproof verifies that all the value
168168
### `StandardMerkleTree.load`
169169

170170
```typescript
171-
StandardMerkleTree.load(JSON.parse(fs.readFileSync('tree.json')));
171+
StandardMerkleTree.load(JSON.parse(fs.readFileSync('tree.json', 'utf8')));
172172
```
173173

174174
Loads the tree from a description previously returned by `tree.dump`.

0 commit comments

Comments
 (0)