Skip to content

Commit

Permalink
Add encoding to fs.readFileSync calls
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio authored Jul 26, 2023
1 parent fc56e44 commit 0951d3c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ import { StandardMerkleTree } from "@openzeppelin/merkle-tree";
import fs from "fs";

// (1)
const tree = StandardMerkleTree.load(JSON.parse(fs.readFileSync("tree.json")));
const tree = StandardMerkleTree.load(JSON.parse(fs.readFileSync("tree.json", "utf8")));

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

```typescript
StandardMerkleTree.load(JSON.parse(fs.readFileSync('tree.json')));
StandardMerkleTree.load(JSON.parse(fs.readFileSync('tree.json', 'utf8')));
```

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

0 comments on commit 0951d3c

Please sign in to comment.