Skip to content

Commit

Permalink
chore: add missing docs
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielc committed Jan 14, 2025
1 parent f21b8a3 commit 636f4c0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions event/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ pub mod unvalidated;

pub use ceramic_core::*;

/// Shared testing logic with the crate.
#[cfg(test)]
pub mod tests {
use ceramic_core::DidDocument;

use crate::unvalidated::signed::JwkSigner;

/// Pretty print json
pub fn to_pretty_json(json_data: &[u8]) -> String {
let json: serde_json::Value = match serde_json::from_slice(json_data) {
Ok(r) => r,
Expand All @@ -27,10 +29,12 @@ pub mod tests {
serde_json::to_string_pretty(&json).unwrap()
}

/// Serialize to pretty json
pub fn serialize_to_pretty_json<T: serde::Serialize>(data: &T) -> String {
serde_json::to_string_pretty(data).unwrap()
}

/// Construct a signer with a hardcoded private key
pub async fn signer() -> JwkSigner {
JwkSigner::new(
DidDocument::new("did:key:z6Mkk3rtfoKDMMG4zyarNGwCQs44GSQ49pcYKQspHJPXSnVw"),
Expand Down

0 comments on commit 636f4c0

Please sign in to comment.