Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Add doc-comments for read_optional_entry
Browse files Browse the repository at this point in the history
  • Loading branch information
slumber committed Sep 1, 2021
1 parent 788787a commit 9d0de8f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pallets/parachain-system/src/relay_state_snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,11 @@ where
.ok_or(ReadEntryErr::Absent)
}

/// Read an optional entry given by the key and try to decode it.
/// Returns `None` if the value specified by the key according to the proof is empty.
///
/// Returns `Err` in case the backend can't return the value under the specific key (likely due to
/// a malformed proof) or if the value couldn't be decoded.
fn read_optional_entry<T, B>(backend: &B, key: &[u8]) -> Result<Option<T>, ReadEntryErr>
where
T: Decode,
Expand Down

0 comments on commit 9d0de8f

Please sign in to comment.