Skip to content

Commit

Permalink
chore: update the example code in the README.md (#336)
Browse files Browse the repository at this point in the history
<!--
Please read and fill out this form before submitting your PR.

Please make sure you have reviewed our contributors guide before
submitting your
first PR.
-->

## Overview

<!-- 
Please provide an explanation of the PR, including the appropriate
context,
background, goal, and rationale. If there is an issue with this
information,
please provide a tl;dr and link the issue. 
-->

The sample code listed in the README cannot be executed, so I modified
it.
  • Loading branch information
kobakaku authored Aug 27, 2024
1 parent d09175d commit 707f20d
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ func main() {
// ComputeExtendedDataSquare failed
}

rowRoots, err := eds.RowRoots()
if err != nil {
// RowRoots failed
}
colRoots, err := eds.ColRoots()
if err != nil {
// ColRoots failed
}

flattened := eds.Flattened()

// Delete some shares, just enough so that repairing is possible.
Expand All @@ -56,9 +65,9 @@ func main() {
}

// Repair square.
err := eds.Repair(
eds.RowRoots(),
eds.ColRoots(),
err = eds.Repair(
rowRoots,
colRoots,
)
if err != nil {
// err contains information to construct a fraud proof
Expand Down

0 comments on commit 707f20d

Please sign in to comment.