Skip to content

Commit

Permalink
fix imports
Browse files Browse the repository at this point in the history
  • Loading branch information
dauphin3 committed Nov 30, 2024
1 parent f1363c2 commit b5b9564
Show file tree
Hide file tree
Showing 9 changed files with 671 additions and 443 deletions.
676 changes: 449 additions & 227 deletions Cargo.lock

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions crates/follows_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,22 @@ pub struct RemoveCreatorForFollowerInput {
pub base_follower: AgentPubKey,
pub target_creator: AgentPubKey,
}

#[derive(Serialize, Deserialize, SerializedBytes, Debug)]
pub struct FollowInput {
pub agent: AgentPubKey,
pub follow_topics: Vec<FollowTopicInput>,
}

#[derive(Serialize, Deserialize, SerializedBytes, Debug)]
pub struct FollowTopicInput {
pub topic: String,
pub weight: String,
}

#[derive(Serialize, Deserialize, SerializedBytes, Debug)]
pub struct TrustedFeedInput {
pub agent: AgentPubKey,
pub topic: String,
pub weight: String,
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,6 @@ use hdk::prelude::*;
use mews_types::FOLLOW_TOPIC;
use trust_atom_types::{DeleteReport, QueryInput, TrustAtom, TrustAtomInput};

#[derive(Debug, Serialize, Deserialize, SerializedBytes)]
pub struct FollowInput {
pub agent: AgentPubKey,
pub follow_topics: Vec<FollowTopicInput>,
}

#[derive(Debug, Serialize, Deserialize, SerializedBytes)]
pub struct FollowTopicInput {
pub topic: String,
pub weight: String,
}

#[derive(Debug, Serialize, Deserialize, SerializedBytes)]
pub struct TrustedFeedInput {
pub agent: AgentPubKey,
pub topic: String,
pub weight: String,
}
#[hdk_extern]
pub fn add_creator_for_follower(input: AddCreatorForFollowerInput) -> ExternResult<()> {
call_local_zome(
Expand Down
1 change: 1 addition & 0 deletions dnas/mewsfeed/zomes/coordinator/follows/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use hdk::prelude::*;
pub mod follower_to_creators;
pub use follower_to_creators::*;

#[hdk_extern]
pub fn init(_: ()) -> ExternResult<InitCallbackResult> {
Expand Down
3 changes: 2 additions & 1 deletion dnas/mewsfeed/zomes/coordinator/mews/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ rand = { workspace = true }
hc_call_utils = { workspace = true }
hc_link_pagination = { workspace = true }
follows_types = { workspace = true }
trust_atom = { workspace = true }
trust_atom = { workspace = true }
trust_atom_types = { workspace = true }
4 changes: 2 additions & 2 deletions dnas/mewsfeed/zomes/coordinator/mews/src/hashtag_to_mews.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use hc_link_pagination::HashPagination;
use hdk::prelude::*;
use mews_integrity::*;

#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct AddHashtagForMewInput {
pub base_hashtag: String,
pub target_mew_hash: ActionHash,
Expand Down Expand Up @@ -31,7 +31,7 @@ pub fn add_hashtag_for_mew(input: AddHashtagForMewInput) -> ExternResult<()> {
// Link from hashtag to mew_hash
create_link(
path.path_entry_hash()?,
input.target_mew_hash,
input.target_mew_hash.clone(),
LinkTypes::HashtagToMews,
LinkTag(input.base_hashtag.as_bytes().to_vec()),
)?;
Expand Down
6 changes: 6 additions & 0 deletions dnas/mewsfeed/zomes/coordinator/mews/src/mew_with_context.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
use crate::hashtag_to_mews::*;
use crate::licker_to_mews::*;
use crate::mew_to_responses::*;
use crate::pinner_to_mews::get_is_hash_pinned;
use follows_types::TrustedFeedInput;
use hc_call_utils::call_local_zome;
use hdk::prelude::*;
use mews_integrity::*;
use mews_types::Profile;
use trust_atom_types::{QueryInput, TrustAtom};

fn get_agent_profile(agent_pub_key: AgentPubKey) -> ExternResult<Option<Profile>> {
let maybe_record = call_local_zome::<Option<Record>, AgentPubKey>(
Expand Down Expand Up @@ -53,6 +56,7 @@ pub fn get_batch_mews_with_context_based_on_topic_and_weight_threshold(
target: None,
content_full: Some(topic.clone()), // query by topic
content_starts_with: None,
content_not_starts_with: None,
value_starts_with: None,
},
)?;
Expand Down Expand Up @@ -247,6 +251,8 @@ pub fn get_mew_with_context(original_mew_hash: ActionHash) -> ExternResult<FeedM
author_profile: original_mew_author_profile,
deleted_timestamp: original_mew_deleted_timestamp,
}),
weight: None, // default is None
topic: None,
})
}
_ => Err(wasm_error!(WasmErrorInner::Guest(String::from(
Expand Down
113 changes: 45 additions & 68 deletions flake.lock

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

Loading

0 comments on commit b5b9564

Please sign in to comment.