Skip to content

Commit

Permalink
Include entries in chain dump
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbrisebois committed Aug 6, 2024
1 parent 8719a9e commit 10e5d9b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions dnas/deepkey/zomelets/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
Zomelet,
CellZomelets,
} from '@spartan-hc/zomelets'; // approx. 7kb
import msgpack from '@msgpack/msgpack';
import {
Signature,
SignedAction,
Expand Down Expand Up @@ -99,6 +100,16 @@ const functions = {

return result.map( record => {
record.signed_action = SignedAction(record.signed_action);

if ( record.entry?.Present?.entry ) {
if ( record.entry.Present.entry_type === "App" )
record.entry.Present.content = msgpack.decode( record.entry.Present.entry );
else if ( record.entry.Present.entry_type === "Agent" )
record.entry.Present.content = new AgentPubKey( record.entry.Present.entry );
else if ( record.entry.Present.entry_type === "CapGrant" )
record.entry.Present.content = null;
}

return record;
});
},
Expand Down
2 changes: 1 addition & 1 deletion zomes/deepkey_csr/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ pub fn query_whole_chain() -> ExternResult<Vec<Record>> {
Ok(
query(
ChainQueryFilter::new()
// .include_entries(true)
.include_entries(true)
)?
)
}

0 comments on commit 10e5d9b

Please sign in to comment.