Skip to content

Commit

Permalink
update to keyplace and toboggan_kv crates in lieu of mindbase_crypto …
Browse files Browse the repository at this point in the history
…and mindbase_store, respectively
  • Loading branch information
dnorman committed Feb 25, 2021
1 parent 3946adc commit 73e8215
Show file tree
Hide file tree
Showing 38 changed files with 54 additions and 1,010 deletions.
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,12 @@ members = [
"crates/artifact",
"crates/claim",
"crates/core",
"crates/crypto",
"crates/data-adapters",
"crates/fuzzyset",
"crates/genesis",
"crates/hypergraph",
"crates/mbcli",
"crates/mbql",
"crates/store",
"crates/symbol",
"crates/util"
]
Expand Down
4 changes: 2 additions & 2 deletions crates/artifact/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
mindbase-crypto = { path="../crypto" }
keyplace = "0.1.0"
mindbase-hypergraph = { path="../hypergraph" }
mindbase-util = { path="../util" }

Expand All @@ -18,4 +18,4 @@ sha2 = "0.9"
lazy_static="1.4.0"

[dev-dependencies]
mindbase-store = { path="../store" }
toboggan-kv = "0.1.1"
2 changes: 1 addition & 1 deletion crates/artifact/src/body.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use mindbase_crypto::AgentId;
use keyplace::AgentId;
use serde::{Deserialize, Serialize};
use std::fmt::{self, Display};

Expand Down
2 changes: 1 addition & 1 deletion crates/artifact/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub struct ArtifactId(

#[derive(Serialize, Deserialize, PartialEq, Debug)]
pub enum Artifact<T> {
Agent(mindbase_crypto::AgentId),
Agent(keyplace::AgentId),
Url(body::Url),
FlatText(body::Text),
Node(body::DataNode<T>),
Expand Down
8 changes: 5 additions & 3 deletions crates/claim/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
mindbase-symbol = { path="../symbol" }
mindbase-crypto = { path="../crypto" }
mindbase-hypergraph = { path = "../hypergraph" }
# mindbase-symbol = { path="../symbol" }
keyplace = "0.1.0"
mindbase-util = { path="../util" }

rusty_ulid = "0.9.3"
rusty_ulid = "0.10"
serde = { version = "1.0", features = ["derive"] }
base64 = "0.13"
bincode = "1.3"
2 changes: 1 addition & 1 deletion crates/claim/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use mindbase_symbol::{
AssociativeAnalogy, CategoricalAnalogy,
};

use mindbase_crypto::{AgentId, AgentKey, Signature};
use keyplace::{AgentId, AgentKey, Signature};
use mindbase_util::Error;

use rusty_ulid::generate_ulid_bytes;
Expand Down
4 changes: 2 additions & 2 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ exclude = ["mbql/*"]
mindbase-symbol = { path="../symbol" }
mindbase-mbql = { path="../mbql" }
mindbase-util = { path="../util" }
mindbase-crypto = { path="../crypto" }
mindbase-store = { path="../store"}
keyplace = "0.1.0"
toboggan-kv = "0.1.1"
mindbase-artifact = { path="../artifact" }
mindbase-claim = { path="../claim" }

Expand Down
6 changes: 3 additions & 3 deletions crates/core/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub enum Error {
SymbolVarAlreadyBound,
NullSymbol,
Other,
Store(mindbase_store::Error),
Store(toboggan_kv::Error),
Util(mindbase_util::Error),
}

Expand All @@ -30,8 +30,8 @@ impl std::fmt::Display for Error {
// }
// }

impl From<mindbase_store::Error> for Error {
fn from(e: mindbase_store::Error) -> Self {
impl From<toboggan_kv::Error> for Error {
fn from(e: toboggan_kv::Error) -> Self {
Self::Store(e)
}
}
Expand Down
6 changes: 3 additions & 3 deletions crates/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ pub use error::Error;

#[cfg(test)]
mod tests {
use mindbase_store::MemoryStore;
use toboggan_kv::adapter::BTreeAdapter;

#[test]
fn dump() -> Result<(), Error> {
let mb = Service::new(MemoryStore::new())?;
let mb = Service::new(BTreeAdapter::new())?;

// Make the ULID play nice for out-of-order testing
let dur = std::time::Duration::from_millis(50);
Expand Down Expand Up @@ -66,7 +66,7 @@ mod tests {
{"Allegation":["AXDCW2k4A7LuPwBx3l2hBw",{"id":"AXDCW2k4A7LuPwBx3l2hBw","agent_id":{"pubkey":"rKEhipCfl9P3K7+6glZVZi1nnQbxVA9vjloNdWsS0bY"},"body":{"Analogy":{"left":{"atoms":[{"id":"AXDCW2gsaVltJU2vcQFKuQ","spin":"Up"}],"spread_factor":0.0},"confidence":1.0,"right":{"atoms":[{"id":"AXDCW2jLdjUVrz/igyanqQ","spin":"Up"}],"spread_factor":0.0}}},"signature":"dd4fqB3J957G/dP/GUl9lP9ZaTYWqQ5zi5U+3oSniUTOd1rtUX9x6nZENxOa8OnW6571nBRpmyXBOPNnGtDdDg"}]}"#;
let cursor = std::io::Cursor::new(dump);

let mb = Service::new(MemoryStore::new())?;
let mb = Service::new(BTreeAdapter::new())?;

crate::xport::load_json(&mb, cursor).unwrap();

Expand Down
4 changes: 2 additions & 2 deletions crates/core/src/service.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use mindbase_artifact::Artifact;
use mindbase_mbql::Query;
use mindbase_store::{MemoryStore, Store, Tree};
use toboggan_kv::{adapter::BTreeAdapter, Toboggan, Tree};

use crate::Error;

Expand Down Expand Up @@ -62,7 +62,7 @@ where

#[test]
fn basic() -> Result<(), Error> {
let mb = Service::new(MemoryStore::new())?;
let mb = Service::new(BTreeAdapter::new())?;
let query = mb.query_str(r#"$isaid = Ground("Things that I said" : "In this test")"#)?;

query.apply()?;
Expand Down
32 changes: 0 additions & 32 deletions crates/crypto/Cargo.toml

This file was deleted.

46 changes: 0 additions & 46 deletions crates/crypto/src/error.rs

This file was deleted.

114 changes: 0 additions & 114 deletions crates/crypto/src/key_manager.rs

This file was deleted.

52 changes: 0 additions & 52 deletions crates/crypto/src/keys/custodian.rs

This file was deleted.

Loading

0 comments on commit 73e8215

Please sign in to comment.