update cargo deps

This commit is contained in:
2021-01-23 17:13:34 +01:00
parent 30fa479156
commit 2ac4fdbc07
12 changed files with 63 additions and 25 deletions

View File

@@ -7,11 +7,11 @@ edition = "2018"
[dependencies]
serde = "1"
serde_bytes = "0.11"
rmp-serde = "0.14"
rmp-serde = "0.15"
async-trait = "0.1"
anyhow = "1"
uuid = "0.8"
crdts = "4"
crdts = "5"
gpgme = "0.9"
dyn-clone = "1"

View File

@@ -9,7 +9,7 @@ use crdt_enc::{
};
use crdts::{CmRDT, CvRDT, MVReg, Orswot};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use std::{borrow::Cow, fmt::Debug, sync::Mutex as SyncMutex};
use std::{borrow::Cow, convert::Infallible, fmt::Debug, sync::Mutex as SyncMutex};
use uuid::Uuid;
pub fn init() {
@@ -48,6 +48,12 @@ pub struct Meta {
}
impl CvRDT for Meta {
type Validation = Infallible;
fn validate_merge(&self, _other: &Self) -> Result<(), Infallible> {
Ok(())
}
fn merge(&mut self, other: Self) {
self.key_fps.merge(other.key_fps);
}
@@ -117,12 +123,9 @@ impl crdt_enc::key_cryptor::KeyCryptor for KeyHandler {
let read_ctx = data.remote_meta.read();
let actor = data.info.as_ref().context("info is none")?.actor();
let write_ctx = read_ctx.derive_add_ctx(actor);
let mut keys = read_ctx
.val
.into_iter()
.iter()
.try_fold(Keys::default(), |mut acc, vb| {
// TODO: check version
// TODO: decrypt key
@@ -133,6 +136,9 @@ impl crdt_enc::key_cryptor::KeyCryptor for KeyHandler {
keys.merge(new_keys);
let actor = data.info.as_ref().context("info is none")?.actor();
let write_ctx = read_ctx.derive_add_ctx(actor);
let op = data.remote_meta.write(
VersionBytes::new(
// TODO