Nearly workign

This commit is contained in:
Dave Hrycyszyn
2024-06-11 19:16:36 +01:00
parent 097fbea9a0
commit 0a74c86c5e
3 changed files with 37 additions and 5 deletions

View File

@@ -11,6 +11,12 @@ pub(crate) struct TransactionList {
pub(crate) list: ListCrdt<Transaction>,
}
impl TransactionList {
pub(crate) fn view_sha(&self) -> String {
sha256::digest(serde_json::to_string(&self.list.view()).unwrap().as_bytes()).to_string()
}
}
/// A fake Transaction struct we can use as a simulated payload
#[add_crdt_fields]
#[derive(Clone, CrdtNode, Serialize, Deserialize)]