Skip to content

Commit

Permalink
Fixed doc comment
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Oct 4, 2023
1 parent bfe19ee commit 526dc18
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions EXERCISES.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,10 @@ Go into `dnas/lobby/integrity_zomes/private_publication/src/properties.rs`:
3. Add a `Properties` struct, with only a `progenitor` field of type `AgentPubKeyB64`.

- Annotate this struct with `#[derive(Serialize, Deserialize, Debug, SerializedBytes)]`.
- Create an extern function `progenitor` that doesn't have any input parameters and that returns the `AgentPubKey` for the progenitor of this DNA.
- Get the serialized properties with `dna_info()?.properties`.
- Create an extern function `progenitor` that doesn't have any input parameters and that returns an `ExternResult<AgentPubKey>` with the `AgentPubKey` for the progenitor of this DNA.
- Get the serialized properties with `dna_info()?.modifiers.properties`.
- Transform that serialized properties type into our `Properties` struct.
- You can deserialize any type that is annotated with `SerializedBytes` using `try_from`: `Properties::try_from(serialized_bytes).map_err(|err| wasm_error!(err))?`
- Convert the `AgentPubKeyB64` into an `AgentPubKey` with `AgentPubKey::from()`.

Now go into `dnas/private_publication/integrity_zomes/private_publication/src/validation.rs`. There you can see boilerplate that allows for the genesis self-check and for different validations for the two kinds of entries present in that DNA.
Expand Down

0 comments on commit 526dc18

Please sign in to comment.