After re-installing, My zome now looks like this:
#![feature(proc_macro_hygiene)]
use hdk::prelude::*;
use hdk_proc_macros::zome;
// see https://developer.holochain.org/api/0.0.51-alpha1/hdk/ for info on using the hdk library
// This is a sample zome that defines an entry type "MyEntry" that can be committed to the
// agent's chain via the exposed function create_my_entry
#[derive(Serialize, Deserialize, Debug, DefaultJson, Clone)]
pub struct MyEntry {
content: String,
}
#[zome]
mod my_zome {
#[init]
fn init() {
Ok(())
}
#[validate_agent]
pub fn validate_agent(validation_data: EntryValidationData<AgentId>) {
Ok(())
}
#[entry_def]
fn my_entry_def() -> ValidatingEntryType {
entry!(
name: "my_entry",
description: "this is a same entry defintion",
sharing: Sharing::Public,
validation_package: || {
hdk::ValidationPackageDefinition::Entry
},
validation: | _validation_data: hdk::EntryValidationData<MyEntry>| {
Ok(())
}
)
}
#[zome_fn("hc_public")]
fn create_my_entry(entry: MyEntry) -> ZomeApiResult<Address> {
let entry = Entry::App("my_entry".into(), entry.into());
let address = hdk::commit_entry(&entry)?;
Ok(address)
}
#[zome_fn("hc_public")]
fn get_my_entry(address: Address) -> ZomeApiResult<Option<Entry>> {
hdk::get_entry(&address)
}
}
Is this correct? Still looks like the old version?
hc --version still gives: hc 0.0.51-alpha1 but holochain --version gives holochain 0.0.1. So which version is it?! lol
Cheers
D.