diff --git a/Cargo.lock b/Cargo.lock index 9d575a2..8062e60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1448,7 +1448,7 @@ dependencies = [ [[package]] name = "kinode_process_lib" -version = "0.8.3" +version = "0.8.4" dependencies = [ "alloy", "alloy-primitives", diff --git a/Cargo.toml b/Cargo.toml index a14b059..3b6bbb6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "kinode_process_lib" description = "A library for writing Kinode processes in Rust." -version = "0.8.3" +version = "0.8.4" edition = "2021" license-file = "LICENSE" homepage = "https://kinode.org" diff --git a/src/types/capability.rs b/src/types/capability.rs index ce5c26e..db0949c 100644 --- a/src/types/capability.rs +++ b/src/types/capability.rs @@ -153,7 +153,8 @@ impl<'a> Deserialize<'a> for Capability { impl Hash for Capability { fn hash(&self, state: &mut H) { self.issuer.hash(state); - self.params.hash(state); + let params: serde_json::Value = serde_json::from_str(&self.params).unwrap_or_default(); + params.hash(state); } } @@ -161,7 +162,11 @@ impl Eq for Capability {} impl PartialEq for Capability { fn eq(&self, other: &Self) -> bool { - self.issuer == other.issuer && self.params == other.params + let self_json_params: serde_json::Value = + serde_json::from_str(&self.params).unwrap_or_default(); + let other_json_params: serde_json::Value = + serde_json::from_str(&other.params).unwrap_or_default(); + self.issuer == other.issuer && self_json_params == other_json_params } }