Skip to content

Commit

Permalink
chore: Update root document timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
dariusc93 committed Oct 12, 2023
1 parent e487386 commit d0fffdc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions extensions/warp-ipfs/src/store/document.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ impl RootDocument {
let mut root_document = self.clone();
//In case there is a signature already exist
root_document.signature = None;
if root_document.created.is_none() {
root_document.created = Some(Utc::now());
}
root_document.modified = Some(Utc::now());

let bytes = serde_json::to_vec(&root_document)?;
let signature = did.sign(&bytes);
self.signature = Some(bs58::encode(signature).into_string());
Expand Down

0 comments on commit d0fffdc

Please sign in to comment.