Skip to content

Commit

Permalink
wip: impl Prove for Vector
Browse files Browse the repository at this point in the history
  • Loading branch information
ralexstokes committed Mar 29, 2024
1 parent 4d904c6 commit a1a51be
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions ssz-rs/src/vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@ use crate::{
error::{Error, InstanceError, TypeError},
lib::*,
merkleization::{
elements_to_chunks, get_power_of_two_ceil, merkleize, pack, GeneralizedIndex,
GeneralizedIndexable, HashTreeRoot, MerkleizationError, Node, Path, PathElement,
elements_to_chunks, get_power_of_two_ceil, merkleize, pack,
proofs::{ProofAndWitness, Prove},
GeneralizedIndex, GeneralizedIndexable, HashTreeRoot, MerkleizationError, Node, Path,
PathElement,
},
ser::{Serialize, SerializeError, Serializer},
Serializable, SimpleSerialize,
Expand Down Expand Up @@ -278,6 +280,15 @@ where
}
}

impl<T, const N: usize> Prove for Vector<T, N>
where
T: SimpleSerialize + GeneralizedIndexable + Prove,
{
fn prove(&mut self, index: GeneralizedIndex) -> Result<ProofAndWitness, MerkleizationError> {

Check warning on line 287 in ssz-rs/src/vector.rs

View check run for this annotation

Codecov / codecov/patch

ssz-rs/src/vector.rs#L287

Added line #L287 was not covered by tests
todo!()
}
}

#[cfg(feature = "serde")]
struct VectorVisitor<T: Serializable>(PhantomData<Vec<T>>);

Expand Down

0 comments on commit a1a51be

Please sign in to comment.