fix format and serde for ORM

feat/orm-diffs
Niko PLP 2 days ago
parent 1cfb754d75
commit 2f9a2d8668
  1. 5
      app/nextgraph/src-tauri/src/lib.rs
  2. 2
      engine/net/Cargo.toml
  3. 9
      engine/oxigraph/src/oxigraph/storage/mod.rs
  4. 9
      engine/verifier/src/inbox_processor.rs
  5. 3
      engine/verifier/src/orm/mod.rs
  6. 15
      sdk/python/src/lib.rs

@ -34,11 +34,6 @@ use ng_wallet::*;
use nextgraph::local_broker::*;
#[cfg(mobile)]
mod mobile;
#[cfg(mobile)]
pub use mobile::*;
pub type SetupHook = Box<dyn FnOnce(&mut App) -> Result<(), Box<dyn std::error::Error>> + Send>;
#[tauri::command(rename_all = "snake_case")]

@ -17,7 +17,7 @@ rust-version.workspace = true
maintenance = { status = "actively-developed" }
[dependencies]
serde = { version = "1.0", features = ["derive"] }
serde = { version = "1.0", features = ["derive","rc"] }
serde_bare = "0.5.0"
serde_bytes = "0.11.7"
serde_json = "1.0"

@ -2187,14 +2187,7 @@ impl<'a> StorageWriter<'a> {
let value = [value];
self.buffer.clear();
write_spog_quad(&mut self.buffer, encoded);
let result =
// if self
// .transaction
// .contains_key_for_update(&self.storage.spog_cf, &self.buffer)?
// {
// false
// } else
{
let result = {
self.transaction
.insert(&self.storage.spog_cf, &self.buffer, &value)?;

@ -537,8 +537,8 @@ impl Verifier {
OPTIONAL {{ <> ng:social_query_forwarder ?from_forwarder .}}
OPTIONAL {{ <> ng:social_query_ended ?ended . }}
}}".to_string(),
Some(forwarder_nuri_string)).await?
{
Some(forwarder_nuri_string)
).await? {
QueryResults::Solutions(mut sols) => {
match sols.next() {
None => {
@ -570,11 +570,10 @@ impl Verifier {
} else {
None
};
(from_profile, from_inbox, from_forwarder)
}
}
}
}
},
_ => return Err(VerifierError::SparqlError(NgError::InvalidResponse.to_string())),
};

@ -18,7 +18,6 @@ pub mod types;
pub mod utils;
pub use ng_net::orm::{OrmDiff, OrmShapeType};
use std::collections::HashMap;
use crate::orm::types::*;
use crate::verifier::*;
@ -31,5 +30,3 @@ impl Verifier {
});
}
}
// Btw, orm/mod.rs is exceeding 1200 lines again. Is that a good practice? I have the feeling, we could separate a couple of things..

@ -25,7 +25,7 @@ use ::nextgraph::net::app_protocol::*;
use ::nextgraph::net::types::BootstrapContentV0;
use ::nextgraph::repo::errors::NgError;
use ::nextgraph::repo::log::*;
use ::nextgraph::repo::types::{BranchCrdt, StoreRepo, PubKey};
use ::nextgraph::repo::types::{BranchCrdt, PubKey, StoreRepo};
use ::nextgraph::wallet::types::{CreateWalletV0, SessionInfo};
use ::nextgraph::wallet::{display_mnemonic, emojis::display_pazzle};
use async_std::stream::StreamExt;
@ -149,11 +149,16 @@ fn doc_create(
store_repo: Option<String>,
) -> PyResult<Bound<PyAny>> {
pyo3_async_runtimes::async_std::future_into_py(py, async move {
Ok(nextgraph::local_broker::doc_create(session_id, crdt, class_name, destination, store_type, store_repo)
.await
.map_err(|e| Into::<PyNgError>::into(e))?
Ok(nextgraph::local_broker::doc_create(
session_id,
crdt,
class_name,
destination,
store_type,
store_repo,
)
.await
.map_err(|e| Into::<PyNgError>::into(e))?)
})
}

Loading…
Cancel
Save