Skip to content

Commit

Permalink
Remove todos
Browse files Browse the repository at this point in the history
  • Loading branch information
appcypher committed Jun 26, 2023
1 parent a1f1216 commit 95ddaf7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 24 deletions.
15 changes: 0 additions & 15 deletions wnfs/src/private/forest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,21 +184,6 @@ impl PrivateForest {
Ok(Box::pin(stream))
}

// /// Returns a stream of all private nodes that could be decrypted at given revision.
// ///
// /// The stream of results is ordered by CID.
// ///
// /// Each item in the resulting stream represents an instance of a concurrent write.
// pub fn get_multivalue<'a>(
// &'a self,
// access_key: &'a AccessKey,
// store: &'a impl BlockStore,
// ) -> Result<Box> {
// let revision_ref = access_key.derive_private_ref()?.into_revision_ref();
// let stream = self.get_multivalue_with_revision_ref(revision_ref, store);
// todo!("implement stream ordering")
// }

/// Gets the difference in changes between two forests.
#[inline]
pub async fn diff(
Expand Down
2 changes: 1 addition & 1 deletion wnfs/src/private/keys/access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ impl AccessKey {
}

pub(crate) fn derive_private_ref(&self) -> Result<PrivateRef> {
// TODO(appcypher): SnapshottAccessKey currently not supported for PrivateRef.
// TODO(appcypher): SnapshotAccessKey currently not supported for PrivateRef.
let Self::Temporal(key) = self else {
bail!(AccessKeyError::UnsupportedSnapshotPrivateRefDerive)
};
Expand Down
16 changes: 10 additions & 6 deletions wnfs/src/private/keys/privateref.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ pub(crate) struct RevisionRef {
impl PrivateRef {
/// Creates a PrivateRef from provided saturated name and temporal key.
pub(crate) fn with_temporal_key(
// TODO(appcypher): Make this private
saturated_name_hash: HashOutput,
temporal_key: TemporalKey,
content_cid: Cid,
Expand Down Expand Up @@ -115,21 +114,27 @@ impl PrivateRef {
})
}

pub fn serialize<S>(&self, serializer: S, temporal_key: &TemporalKey) -> Result<S::Ok, S::Error>
#[allow(unused)]
pub(crate) fn serialize<S>(
&self,
serializer: S,
temporal_key: &TemporalKey,
) -> Result<S::Ok, S::Error>
where
S: serde::Serializer, // TODO(appcypher): Make this private
S: serde::Serializer,
{
self.to_serializable(temporal_key)
.map_err(SerError::custom)?
.serialize(serializer)
}

pub fn deserialize<'de, D>(
#[allow(unused)]
pub(crate) fn deserialize<'de, D>(
deserializer: D,
temporal_key: &TemporalKey,
) -> Result<Self, D::Error>
where
D: serde::Deserializer<'de>, // TODO(appcypher): Make this private
D: serde::Deserializer<'de>,
{
let private_ref = PrivateRefSerializable::deserialize(deserializer)?;
PrivateRef::from_serializable(private_ref, temporal_key).map_err(DeError::custom)
Expand Down Expand Up @@ -168,7 +173,6 @@ impl RevisionRef {
///
/// The resulting private ref refers to the given CID in the multivalue.
pub(crate) fn into_private_ref(self, content_cid: Cid) -> PrivateRef {
// TODO(appcypher): Make this private
PrivateRef {
saturated_name_hash: self.saturated_name_hash,
temporal_key: self.temporal_key,
Expand Down
2 changes: 0 additions & 2 deletions wnfs/src/private/node/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ impl PrivateNodeHeader {

/// Derives the revision ref of the current header.
pub(crate) fn derive_revision_ref(&self) -> RevisionRef {
// TODO(appcypher): Make this private
let temporal_key = self.derive_temporal_key();
let saturated_name_hash = self.get_saturated_name_hash();

Expand Down Expand Up @@ -151,7 +150,6 @@ impl PrivateNodeHeader {
/// ```
#[inline]
pub fn derive_temporal_key(&self) -> TemporalKey {
// TODO(appcypher): Make this private
TemporalKey::from(&self.ratchet)
}

Expand Down

0 comments on commit 95ddaf7

Please sign in to comment.