Skip to content

Commit

Permalink
fixes h-REA#246 test/process
Browse files Browse the repository at this point in the history
  • Loading branch information
Connoropolous committed Apr 26, 2022
1 parent f55a9cc commit 811645e
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

5 changes: 5 additions & 0 deletions zomes/rea_intent/lib/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ edition = "2018"

[dependencies]
paste = "1.0"

# :TODO: remove if removing debug outputs from this crate
# :DUPE: hdk-rust-revid
hdk = "0.0.124"

hdk_records = { path = "../../../lib/hdk_records" }
hdk_semantic_indexes_client_lib = { path = "../../../lib/hdk_semantic_indexes/client" }
hc_zome_rea_intent_storage = { path = "../storage" }
Expand Down
6 changes: 4 additions & 2 deletions zomes/rea_intent/lib/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ pub fn handle_create_intent<S>(entry_def_id: S, intent: CreateRequest) -> Record

// handle link fields
if let CreateRequest { input_of: MaybeUndefined::Some(input_of), .. } = &intent {
create_index!(intent.input_of(input_of), process.intended_inputs(&base_address))?;
let e = create_index!(intent.input_of(input_of), process.intended_inputs(&base_address))?;
hdk::prelude::debug!("handle_create_intent::input_of::create_index!: {:?}", e);
};
if let CreateRequest { output_of: MaybeUndefined::Some(output_of), .. } = &intent {
create_index!(intent.output_of(output_of), process.intended_outputs(&base_address))?;
let e = create_index!(intent.output_of(output_of), process.intended_outputs(&base_address))?;
hdk::prelude::debug!("handle_create_intent::output_of::create_index!: {:?}", e);
};

// return entire record structure
Expand Down
11 changes: 11 additions & 0 deletions zomes/rea_intent/zome_idx_planning/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@
use hdk_semantic_indexes_zome_derive::index_zome;
use hc_zome_rea_intent_rpc::*;

// :TODO: remove this; should not be necessary since all these types are imported
// along with their entry_def! in dependent crates
#[hdk_extern]
fn entry_defs(_: ()) -> ExternResult<EntryDefsCallbackResult> {
Ok(EntryDefsCallbackResult::from(vec![
PathEntry::entry_def(),
IntentAddress::entry_def(),
ProcessAddress::entry_def(),
]))
}

#[index_zome]
struct Intent {
satisfied_by: Local<satisfaction, satisfies>,
Expand Down
2 changes: 2 additions & 0 deletions zomes/rea_process/zome_idx_observation/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ use hc_zome_rea_process_rpc::*;
fn entry_defs(_: ()) -> ExternResult<EntryDefsCallbackResult> {
Ok(EntryDefsCallbackResult::from(vec![
PathEntry::entry_def(),
IntentAddress::entry_def(),
CommitmentAddress::entry_def(),
ProcessAddress::entry_def(),
EconomicEventAddress::entry_def(),
]))
Expand Down

0 comments on commit 811645e

Please sign in to comment.