Skip to content

Commit

Permalink
remove unused zome function
Browse files Browse the repository at this point in the history
  • Loading branch information
matthme committed Nov 7, 2024
1 parent 3dc8e43 commit 7bdac85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 32 deletions.
27 changes: 0 additions & 27 deletions dnas/generic_dna/zomes/coordinator/generic_zome/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -899,33 +899,6 @@ fn derive_link_tag(
Ok(LinkTag::from(serialized_content))
}

/// Deletes all links for a base that are pointing to the given target
fn delete_links_for_base_with_target(
base: AnyLinkableHash,
target: AnyLinkableHash,
link_type: LinkTypes,
) -> ExternResult<Option<ActionHash>> {
let mut action_hash = None;
let links = get_links(GetLinksInputBuilder::try_new(base, link_type)?.build())?;
for link in links {
if link.target == target {
action_hash = Some(delete_link(link.create_link_hash)?);
}
}
// We only return a single action hash although multiple action hashes may have been deleted. This
// is because we don't care in the frontend whether there were
Ok(action_hash)
}

fn delete_links_with_target(links: &Vec<Link>, target: AnyLinkableHash) -> ExternResult<()> {
for link in links {
if link.target == target {
delete_link(link.create_link_hash.clone())?;
}
}
Ok(())
}

fn thing_record_to_thing(record: Record) -> ExternResult<Thing> {
let thing_entry = record
.entry()
Expand Down
10 changes: 5 additions & 5 deletions dnas/generic_dna/zomes/integrity/generic_zome/src/thing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub fn validate_create_thing(
_action: EntryCreationAction,
_thing: ThingEntry,
) -> ExternResult<ValidateCallbackResult> {
/// TODO: add the appropriate validation rules
// TODO: add the appropriate validation rules
Ok(ValidateCallbackResult::Valid)
}

Expand All @@ -20,7 +20,7 @@ pub fn validate_update_thing(
_original_action: EntryCreationAction,
_original_thing: ThingEntry,
) -> ExternResult<ValidateCallbackResult> {
/// TODO: add the appropriate validation rules
// TODO: add the appropriate validation rules
Ok(ValidateCallbackResult::Valid)
}

Expand All @@ -29,7 +29,7 @@ pub fn validate_delete_thing(
_original_action: EntryCreationAction,
_original_thing: ThingEntry,
) -> ExternResult<ValidateCallbackResult> {
/// TODO: add the appropriate validation rules
// TODO: add the appropriate validation rules
Ok(ValidateCallbackResult::Valid)
}

Expand All @@ -39,7 +39,7 @@ pub fn validate_create_link_thing_updates(
target_address: AnyLinkableHash,
_tag: LinkTag,
) -> ExternResult<ValidateCallbackResult> {
/// Check the entry type for the given action hash
// Check the entry type for the given action hash
let action_hash = base_address
.into_action_hash()
.ok_or(wasm_error!(WasmErrorInner::Guest(
Expand All @@ -53,7 +53,7 @@ pub fn validate_create_link_thing_updates(
.ok_or(wasm_error!(WasmErrorInner::Guest(
"Linked action must reference an entry".to_string()
)))?;
/// Check the entry type for the given action hash
// Check the entry type for the given action hash
let action_hash =
target_address
.into_action_hash()
Expand Down

0 comments on commit 7bdac85

Please sign in to comment.