trustgraph / trustgraph-holochain

Apache License 2.0
24 stars 3 forks source link

on delete, validate that actionhash is a link create #85

Open harlantwood opened 1 year ago

harlantwood commented 1 year ago

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(),
                        ));
                    }
                };
...