Skip to content

Commit

Permalink
fix height generation
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Jul 9, 2018
1 parent 530e5c4 commit d39a4b6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Configure to use nightly:
## Build

```
> cargo build
> cargo build --release --features u128-support
```

## Test
Expand All @@ -28,7 +28,7 @@ Configure to use nightly:
Build

```
> cargo build --examples --release
> cargo build --examples --release --features u128-support
```

Running them
Expand Down
4 changes: 3 additions & 1 deletion src/test_helper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ pub fn fake_drgpoprep_proof<R: Rng>(
// get commR
let subtree = MerkleTree::from_data(leaves);
let subtree_root: Fr = subtree.root().into();
let subtree_depth = subtree.height();
let subtree_depth = subtree.height() - 1; // .height() inludes the leave
let remaining_depth = tree_depth - subtree_depth;
let (remaining_path, replica_root) =
random_merkle_path_with_value(rng, remaining_depth, &subtree_root, remaining_depth);
Expand All @@ -101,6 +101,8 @@ pub fn fake_drgpoprep_proof<R: Rng>(
subtree_path
};

assert_eq!(data_node_path.len(), replica_node_path.len());

(
prover_id,
replica_node,
Expand Down

0 comments on commit d39a4b6

Please sign in to comment.