Merge pull request #434 from kinode-dao/hf/fix-caps

fix caps
This commit is contained in:
nick.kino 2024-07-08 17:34:58 -07:00 committed by GitHub
commit a5e12fcc3f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 12 additions and 5 deletions

View File

@ -7,7 +7,6 @@ on:
jobs:
deploy:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
timeout-minutes: 60
steps:

2
Cargo.lock generated
View File

@ -3212,7 +3212,7 @@ dependencies = [
[[package]]
name = "kinode"
version = "0.8.2"
version = "0.8.3"
dependencies = [
"aes-gcm",
"alloy",

View File

@ -1,7 +1,7 @@
[package]
name = "kinode_lib"
authors = ["KinodeDAO"]
version = "0.8.2"
version = "0.8.3"
edition = "2021"
description = "A general-purpose sovereign cloud computing platform"
homepage = "https://kinode.org"

View File

@ -3,6 +3,7 @@ use ring::signature;
use rusqlite::types::{FromSql, FromSqlError, ToSql, ValueRef};
use serde::{Deserialize, Serialize};
use std::collections::{BTreeMap, HashMap, HashSet};
use std::hash::{Hash, Hasher};
use thiserror::Error;
lazy_static::lazy_static! {
@ -470,7 +471,7 @@ pub enum Message {
Response((Response, Option<Context>)),
}
#[derive(Clone, Debug, Hash, Serialize, Deserialize)]
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Capability {
pub issuer: Address,
pub params: String,
@ -488,6 +489,14 @@ impl PartialEq for Capability {
}
}
impl Hash for Capability {
fn hash<H: Hasher>(&self, state: &mut H) {
self.issuer.hash(state);
let params: serde_json::Value = serde_json::from_str(&self.params).unwrap_or_default();
params.hash(state);
}
}
impl Capability {
pub fn new<T, U>(issuer: T, params: U) -> Self
where

View File

@ -1 +0,0 @@
[{"chain_id":1,"trusted":false,"provider":{"Node":{"kns_update":{"name":"providerfren.os","owner":"","node":"","public_key":"0x54f5a8a4c625d5925e63ed3f0203b63e007e3f822d7858bd98b1fd9704c99451","ips":["147.135.114.167"],"ports":{"ws":9999},"routers":[]},"use_as_provider":true}}},{"chain_id":11155111,"trusted":false,"provider":{"Node":{"kns_update":{"name":"providerfren.os","owner":"","node":"","public_key":"0x54f5a8a4c625d5925e63ed3f0203b63e007e3f822d7858bd98b1fd9704c99451","ips":["147.135.114.167"],"ports":{"ws":9999},"routers":[]},"use_as_provider":true}}},{"chain_id":10,"trusted":true,"provider":{"RpcUrl":"wss://opt-mainnet.g.alchemy.com/v2/phOnE7X9A3mnzAVjfyR1idu1yYX1mqSL"}},{"chain_id":10,"trusted":false,"provider":{"Node":{"kns_update":{"name":"providerfren.os","owner":"","node":"","public_key":"0x54f5a8a4c625d5925e63ed3f0203b63e007e3f822d7858bd98b1fd9704c99451","ips":["147.135.114.167"],"ports":{"ws":9999},"routers":[]},"use_as_provider":true}}}]