Skip to content

Commit

Permalink
adjusted dependencies in Cargo files -- migrated functions from Holon…
Browse files Browse the repository at this point in the history
…Space to HolonSpaceManager
  • Loading branch information
evomimic committed Oct 25, 2024
1 parent 16d561c commit 76bb247
Show file tree
Hide file tree
Showing 11 changed files with 150 additions and 156 deletions.
55 changes: 30 additions & 25 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,37 +1,16 @@

[profile.dev]
opt-level = "z"

[profile.release]
opt-level = "z"

[workspace]
resolver = "2"

members = ["crates/coordinator/holons",
members = [
"crates/coordinator/holons",
"crates/coordinator/descriptors",
"crates/coordinator/core_schema",
"crates/coordinator/dances",
"crates/integrity/holons_integrity",
"crates/shared_types/holon",
"crates/shared_validation",
]
resolver = "2"

[workspace.dependencies]
ahash ="=0.8.11"
derive-new = "0.6"
hdi = "0.4"
hdk = "0.3"
holochain_integrity_types = "0.3"
Inflector = "0.11"
quick_cache = "0.6"
serde = { version = "1", features = ["derive"] }
serde_json = "1.0.109"
strum = "0.26"
strum_macros = "0.26"
thiserror = "1"


# Local workspace dependencies
[workspace.dependencies.holons]
path = "crates/coordinator/holons"

Expand All @@ -52,3 +31,29 @@ path = "crates/shared_types/holon"

[workspace.dependencies.shared_validation]
path = "crates/shared_validation"

# External dependencies
[workspace.dependencies]
ahash = "=0.8.11"
derive-new = "0.6"
hdi = "0.4"
hdk = "0.3"
holochain_integrity_types = "0.3"
Inflector = "0.11"
quick_cache = "0.6"
serde = { version = "1", features = ["derive"] }
serde_json = "1.0.109"
strum = "0.26"
strum_macros = "0.26"
thiserror = "1"
async-std = "1.1.12"
futures = { version = "0.3.1", default-features = false }
pretty_assertions = "1.4.0"
rstest = "0.21"


[profile.dev]
opt-level = "z"

[profile.release]
opt-level = "z"
32 changes: 18 additions & 14 deletions crates/coordinator/core_schema/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,37 @@ name = "core_schema"
version = "0.1.0"
edition = "2021"

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[lib]
crate-type = ["cdylib", "rlib"]
name = "core_schema"

[dependencies]

# General Dependencies
serde = { workspace = true }
derive-new = { workspace = true }
thiserror = { workspace = true }
Inflector = {workspace = true}
strum = {workspace = true}
strum_macros ={workspace = true}
Inflector = { workspace = true }
strum = { workspace = true }
strum_macros = { workspace = true }

# Holochain Dependencies
hdi = { workspace = true }
hdk = { workspace = true }
#holochain_integrity_types = { workspace = true }

# MAP Dependencies

holons_integrity = { workspace = true }
holons = {workspace = true}
shared_types_holon = {workspace = true}
descriptors = {workspace = true}



holons = { workspace = true }
shared_types_holon = { workspace = true }
descriptors = { workspace = true }

# General dev-dependencies (platform-agnostic)
[dev-dependencies]
async-std = { workspace = true }
futures = { workspace = true }
pretty_assertions = { workspace = true }
rstest = { workspace = true }

# Target-specific dev dependencies for non-WASM builds
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
holochain = { version = "0.3", default-features = false, features = ["test_utils", "sqlite-encrypted"] }
tokio = { version = "1.35.1", features = ["full"] }
33 changes: 15 additions & 18 deletions crates/coordinator/dances/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,23 @@ name = "dances"
hdk = { workspace = true }
hdi = { workspace = true }
holochain_integrity_types = { workspace = true }
thiserror = { workspace = true, features = [] }
#holochain = "0.1.7"

#holons_integrity = { workspace = true }
thiserror = { workspace = true }
serde = { workspace = true }
derive-new = { workspace = true }

shared_types_holon = { workspace = true }
holons = {workspace = true}
descriptors = {workspace = true}
core_schema = {workspace = true}

holons = { workspace = true }
descriptors = { workspace = true }
core_schema = { workspace = true }

# General dev-dependencies (platform-agnostic)
[dev-dependencies]
async-std = { workspace = true }
futures = { workspace = true }
pretty_assertions = { workspace = true }
rstest = { workspace = true }

# Target-specific dev dependencies for non-WASM builds
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]

holochain = { version = "0.3", default-features = false, features = ["test_utils","sqlite-encrypted"] }
tokio = { version = "1.35.1", features = ["full"] }
futures = { version = "0.3.1", default-features = false }
rstest = "0.21"
async-std = "1.1.12"

pretty_assertions = "1.4.0"

#[dev-dependencies]
holochain = { version = "0.3", default-features = false, features = ["test_utils", "sqlite-encrypted"] }
tokio = { version = "1.35.1", features = ["full"] }
21 changes: 1 addition & 20 deletions crates/coordinator/dances/src/dancer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,26 +127,7 @@ impl Dancer {
dispatch_table.insert("stage_new_version", stage_new_version_dance as DanceFunction);
dispatch_table.insert("with_properties", with_properties_dance as DanceFunction);

dispatch_table.insert(
"abandon_staged_changes",
abandon_staged_changes_dance as DanceFunction,
);

dispatch_table.insert(
"add_related_holons",
add_related_holons_dance as DanceFunction,
);
dispatch_table.insert(
"remove_related_holons",
remove_related_holons_dance as DanceFunction,
);
dispatch_table.insert("load_core_schema", load_core_schema_dance as DanceFunction);
dispatch_table.insert(
"query_relationships",
query_relationships_dance as DanceFunction,
);

// Add more functions as needed
// Add more functions (in alphabetical order) as needed

Dancer { dispatch_table }
}
Expand Down
2 changes: 1 addition & 1 deletion crates/coordinator/dances/src/descriptors_dance_adapter.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//! This file defines the DancesAdaptors offered by the descriptors zome.
//! TODO: Move these adaptors to their own zome
//! TODO: Move these adaptors to their own zome (at some point)
//!
//! For each Dance, this file defines:
//! - a `build_` function as a helper function for creating DanceRequests for that Dance from
Expand Down
12 changes: 6 additions & 6 deletions crates/coordinator/dances/tests/dance_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,13 @@ use shared_types_holon::HolonId;
/// set WASM_LOG to enable guest-side (i.e., zome code) tracing
///
#[rstest]
// #[case::simple_undescribed_create_holon_test(simple_create_test_fixture())]
// #[case::simple_add_related_holon_test(simple_add_remove_related_holons_fixture())]
// #[case::simple_abandon_staged_changes_test(simple_abandon_staged_changes_fixture())]
// #[case::load_core_schema(load_core_schema_test_fixture())]
// #[case::simple_stage_new_from_clone_test(simple_stage_new_from_clone_fixture())]
#[case::simple_undescribed_create_holon_test(simple_create_test_fixture())]
#[case::simple_add_related_holon_test(simple_add_remove_related_holons_fixture())]
#[case::simple_abandon_staged_changes_test(simple_abandon_staged_changes_fixture())]
#[case::load_core_schema(load_core_schema_test_fixture())]
#[case::simple_stage_new_from_clone_test(simple_stage_new_from_clone_fixture())]
#[case::simple_stage_new_version_test(simple_stage_new_version_fixture())]
// #[case::delete_holon(delete_holon_fixture())]
#[case::delete_holon(delete_holon_fixture())]
#[tokio::test(flavor = "multi_thread")]
async fn rstest_dance_tests(#[case] input: Result<DancesTestCase, HolonError>) {
// Setup
Expand Down
35 changes: 15 additions & 20 deletions crates/coordinator/descriptors/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ edition = "2021"
crate-type = ["cdylib", "rlib"]
name = "descriptors"


# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html


[dependencies]
# General Dependencies
serde = { workspace = true }
Expand All @@ -19,24 +15,23 @@ thiserror = { workspace = true }

# Holochain Dependencies
hdk = { workspace = true }
hdi = { workspace = true}
hdi = { workspace = true }
holochain_integrity_types = { workspace = true }

# MAP Dependencies

holons_integrity = { workspace = true }
holons = {workspace = true}
shared_types_holon = {workspace = true}

Inflector = {workspace = true}

holons = { workspace = true }
shared_types_holon = { workspace = true }
Inflector = { workspace = true }

# General dev-dependencies (platform-agnostic)
[dev-dependencies]
async-std = { workspace = true }
futures = { workspace = true }
pretty_assertions = { workspace = true }
rstest = { workspace = true }

# Target-specific dev dependencies for non-WASM builds
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]

holochain = {version = "0.3", default-features = false, features = ["test_utils","sqlite-encrypted"] }
tokio = { version = "1.3", features = ["full"] }
futures = { version = "0.3.1", default-features = false }
rstest = "0.21"
async-std = "1.1.12"

#[dev-dependencies]

holochain = { version = "0.3", default-features = false, features = ["test_utils", "sqlite-encrypted"] }
tokio = { version = "1.35.1", features = ["full"] }
21 changes: 9 additions & 12 deletions crates/coordinator/holons/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,22 @@ derive-new = { workspace = true }
hdk = { workspace = true }
hdi = { workspace = true }
holochain_integrity_types = { workspace = true }

holons_integrity = { workspace = true }

quick_cache = { workspace = true }
thiserror = { workspace = true }

shared_types_holon = { workspace = true }
shared_validation = { workspace = true }

serde = { workspace = true }
serde_json = { workspace = true }

[dev-dependencies]
# General dev-dependencies (platform-agnostic)
async-std = { workspace = true }
futures = { workspace = true }
pretty_assertions = { workspace = true }
rstest = { workspace = true }

# Target-specific dev dependencies for non-WASM builds
[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
async-std = "1.1.12"
futures = { version = "0.3.1", default-features = false }
holochain = { version = "0.3", default-features = false, features = ["test_utils","sqlite-encrypted"] }
pretty_assertions = "1.4.0"
rstest = "0.21"
tokio = { version = "1.35.1", features = ["full"] }

#[dev-dependencies]
holochain = { version = "0.3", default-features = false, features = ["test_utils", "sqlite-encrypted"] }
tokio = { version = "1.35.1", features = ["full"] }
30 changes: 9 additions & 21 deletions crates/coordinator/holons/src/holon_space.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ impl HolonSpace {
))),
}
}
// pub fn get_local_space_holon() -> Result<Holon, HolonError> {
// let path = Path::from("local_holon_space");
// let link_type = LinkTypes::LocalHolonSpace;
// let input = GetPathInput { path: path.clone(), link_type: link_type };
// let record = get_holon_node_by_path(input)
// .map_err(|e| HolonError::from(e))?
// .ok_or_else(|| HolonError::HolonNotFound(format!("at path: {:?}", path)))?;
// Holon::try_from_node(record)
// }
fn holon_mut(&mut self) -> &mut Holon {
&mut self.0 // Return a mutable reference to the inner `Holon`
}
Expand Down Expand Up @@ -74,25 +83,4 @@ impl HolonSpace {
)?;
Ok(self)
}

pub fn create_local_path(target_holon_hash: LocalId) -> Result<ActionHash, HolonError> {
let path = Path::from("local_holon_space");
let link_type = LinkTypes::LocalHolonSpace;
let input = CreatePathInput {
path: path,
link_type: link_type,
target_holon_node_hash: target_holon_hash.0,
};
create_path_to_holon_node(input).map_err(|e| HolonError::from(e))
}

pub fn get_local_space_holon() -> Result<Holon, HolonError> {
let path = Path::from("local_holon_space");
let link_type = LinkTypes::LocalHolonSpace;
let input = GetPathInput { path: path.clone(), link_type: link_type };
let record = get_holon_node_by_path(input)
.map_err(|e| HolonError::from(e))?
.ok_or_else(|| HolonError::HolonNotFound(format!("at path: {:?}", path)))?;
Holon::try_from_node(record)
}
}
Loading

0 comments on commit 76bb247

Please sign in to comment.