Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 30 additions & 26 deletions bootstrap-languages/p-diff-sync/hc-dna/Cargo.lock

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

Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ itertools = "0.10.3"
perspective_diff_sync_integrity = { path = "../perspective_diff_sync_integrity" }
sha2 = "0.10.5"

hdi = { version = "0.6.2", git = "https://github.com/coasys/holochain.git", branch = "0.5.2-coasys" }
hdk = { version = "0.5.2", git = "https://github.com/coasys/holochain.git", branch = "0.5.2-coasys" }
holochain_serialized_bytes = { version = "=0.0.56", git = "https://github.com/holochain/holochain-serialization"}
hdi = { version = "0.6.6", git = "https://github.com/coasys/holochain.git", branch = "0.5.6-coasys" }
hdk = { version = "0.5.6", git = "https://github.com/coasys/holochain.git", branch = "0.5.6-coasys" }
holochain_serialized_bytes = "=0.0.56"

[features]
test = []
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ derive_more = "0"
serde = "1"
chrono = { version = "0.4.38", default-features = false, features = ["clock", "std", "oldtime", "serde"] }

hdi = { version = "0.6.2", git = "https://github.com/coasys/holochain.git", branch = "0.5.2-coasys" }
hdk = { version = "0.5.2", git = "https://github.com/coasys/holochain.git", branch = "0.5.2-coasys" }
holochain_serialized_bytes = { version = "=0.0.56", git = "https://github.com/holochain/holochain-serialization"}
holo_hash = { version = "0.5.2", git = "https://github.com/coasys/holochain.git", branch = "0.5.2-coasys" }
hdi = { version = "0.6.6", git = "https://github.com/coasys/holochain.git", branch = "0.5.6-coasys" }
hdk = { version = "0.5.6", git = "https://github.com/coasys/holochain.git", branch = "0.5.6-coasys" }
holochain_serialized_bytes = "=0.0.56"
holo_hash = { version = "0.5.6", git = "https://github.com/coasys/holochain.git", branch = "0.5.6-coasys" }
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,34 @@ impl OnlineAgent {
.map_err(|error| wasm_error!(WasmErrorInner::Host(String::from(error))))
}
}

#[hdk_extern]
pub fn validate(op: Op) -> ExternResult<ValidateCallbackResult> {
match op {
Op::StoreRecord(StoreRecord { record }) => {
// Only care about our PerspectiveDiffEntryReference entries
let maybe_entry = record
.entry()
.to_app_option::<PerspectiveDiffEntryReference>();

if let Ok(Some(pdiff_ref)) = maybe_entry {
if let Some(parents) = pdiff_ref.parents {
let mut missing: Vec<AnyDhtHash> = Vec::new();
for parent_action_hash in parents {
// Ensure each declared parent exists and is valid in the source chain/DHT
if must_get_valid_record(parent_action_hash.clone()).is_err() {
missing.push(parent_action_hash.into());
}
}
if !missing.is_empty() {
return Ok(ValidateCallbackResult::UnresolvedDependencies(UnresolvedDependencies::Hashes(missing)));
}
}
}

Ok(ValidateCallbackResult::Valid)
}
// For all other ops in this zome we accept by default
_ => Ok(ValidateCallbackResult::Valid),
}
}
2 changes: 1 addition & 1 deletion cli/mainnet_seed.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"did:key:z6MkvPpWxwXAnLtMcoc9sX7GEoJ96oNnQ3VcQJRLspNJfpE7"
],
"knownLinkLanguages": [
"QmzSYwdiuaBqw812TNcudpKwvU5U3HM9tdxWqjhkp26XEc228xe"
"QmzSYwdaPHA3WJKSzVAi3REGhMhos9E3RNtE2Xw1PA5FUvvpvuB"
],
"directMessageLanguage": "QmzSYwdob1TwkrGs5SzpS6UF2NpNBBzd3XSy2HpmaDnRPivNcE9",
"agentLanguage": "QmzSYwdZDdgxiyE8crozqbxoBP52h6ocMdDq2S2mg4ScjzVLWKQ",
Expand Down
2 changes: 1 addition & 1 deletion rust-executor/src/mainnet_seed.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"did:key:z6MkvPpWxwXAnLtMcoc9sX7GEoJ96oNnQ3VcQJRLspNJfpE7"
],
"knownLinkLanguages": [
"QmzSYwdiuaBqw812TNcudpKwvU5U3HM9tdxWqjhkp26XEc228xe"
"QmzSYwdaPHA3WJKSzVAi3REGhMhos9E3RNtE2Xw1PA5FUvvpvuB"
],
"directMessageLanguage": "QmzSYwdob1TwkrGs5SzpS6UF2NpNBBzd3XSy2HpmaDnRPivNcE9",
"agentLanguage": "QmzSYwdZDdgxiyE8crozqbxoBP52h6ocMdDq2S2mg4ScjzVLWKQ",
Expand Down