trustgraph / trustgraph-holochain

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

on delete, validate that actionhash is a link create

harlantwood opened this issue · comments

holochain core does not seem to do this.

something like this (from mewsfeed)

        FlatOp::StoreRecord(store_record) => match store_record {
            OpRecord::DeleteLink {
                original_action_hash,
                base_address,
                action,
            } => {
                let record = must_get_valid_record(original_action_hash)?;
                let create_link = match record.action() {
                    Action::CreateLink(create_link) => create_link.clone(),
                    _ => {
                        return Ok(ValidateCallbackResult::Invalid(
                            "The action that a DeleteLink deletes must be a CreateLink".to_string(),
                        ));
                    }
                };
...