Skip to content

Commit

Permalink
Merge pull request #84 from kinode-dao/hf/match-caps-impls
Browse files Browse the repository at this point in the history
match caps impls to core
  • Loading branch information
dr-frmr authored Jul 16, 2024
2 parents 4631ebd + 69daa62 commit 9b5efbb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
9 changes: 7 additions & 2 deletions src/types/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,15 +153,20 @@ impl<'a> Deserialize<'a> for Capability {
impl Hash for Capability {
fn hash<H: Hasher>(&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);
}
}

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
}
}

Expand Down

0 comments on commit 9b5efbb

Please sign in to comment.