From 7bdac85b77d1aad0f75011ff172d7cd609b5b6b7 Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 7 Nov 2024 22:59:24 +0100 Subject: [PATCH] remove unused zome function --- .../zomes/coordinator/generic_zome/src/api.rs | 27 ------------------- .../zomes/integrity/generic_zome/src/thing.rs | 10 +++---- 2 files changed, 5 insertions(+), 32 deletions(-) diff --git a/dnas/generic_dna/zomes/coordinator/generic_zome/src/api.rs b/dnas/generic_dna/zomes/coordinator/generic_zome/src/api.rs index 91093bc..0bd5dac 100644 --- a/dnas/generic_dna/zomes/coordinator/generic_zome/src/api.rs +++ b/dnas/generic_dna/zomes/coordinator/generic_zome/src/api.rs @@ -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> { - 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, 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 { let thing_entry = record .entry() diff --git a/dnas/generic_dna/zomes/integrity/generic_zome/src/thing.rs b/dnas/generic_dna/zomes/integrity/generic_zome/src/thing.rs index 7f8679e..11c9c02 100644 --- a/dnas/generic_dna/zomes/integrity/generic_zome/src/thing.rs +++ b/dnas/generic_dna/zomes/integrity/generic_zome/src/thing.rs @@ -10,7 +10,7 @@ pub fn validate_create_thing( _action: EntryCreationAction, _thing: ThingEntry, ) -> ExternResult { - /// TODO: add the appropriate validation rules + // TODO: add the appropriate validation rules Ok(ValidateCallbackResult::Valid) } @@ -20,7 +20,7 @@ pub fn validate_update_thing( _original_action: EntryCreationAction, _original_thing: ThingEntry, ) -> ExternResult { - /// TODO: add the appropriate validation rules + // TODO: add the appropriate validation rules Ok(ValidateCallbackResult::Valid) } @@ -29,7 +29,7 @@ pub fn validate_delete_thing( _original_action: EntryCreationAction, _original_thing: ThingEntry, ) -> ExternResult { - /// TODO: add the appropriate validation rules + // TODO: add the appropriate validation rules Ok(ValidateCallbackResult::Valid) } @@ -39,7 +39,7 @@ pub fn validate_create_link_thing_updates( target_address: AnyLinkableHash, _tag: LinkTag, ) -> ExternResult { - /// 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( @@ -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()