Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.
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
5 changes: 3 additions & 2 deletions dna/anchors/anchors.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ function anchor(anchor){
debug('anchorTypeGet ' + JSON.stringify(anchorTypeGet));
debug('<mermaid>' + App.Agent.String + '-->>DHT:Check to see if ' + anchor.anchorType + ' has been setup</mermaid>');
if(anchorTypeGet === null){
var rootAnchorTypeHash = get(makeHash('anchor', rootAnchortype));
var rootAnchorTypeHash = makeHash('anchor', rootAnchortype);
debug('<mermaid>' + App.Agent.String + '-->>DHT:Check to see if the Root of all anchors has been setup</mermaid>');
if (rootAnchorTypeHash === null){
if (get(rootAnchorTypeHash) === null){
rootAnchorTypeHash = commit('anchor', rootAnchortype);
debug('<mermaid>' + App.Agent.String + '->>' + App.Agent.String + ':commit Root of all anchors to local chain</mermaid>');
debug('<mermaid>' + App.Agent.String + '->>DHT:Publish Root of all anchors</mermaid>');
Expand All @@ -25,6 +25,7 @@ function anchor(anchor){
debug('<mermaid>' + App.Agent.String + '->>' + App.Agent.String + ':commit ' + anchor.anchorType + ' to local chain</mermaid>');
debug('<mermaid>' + App.Agent.String + '->>DHT:Publish ' + anchor.anchorType + '</mermaid>');
// debug('Anchor Type Created: ' + anchorTypeHash)

commit('anchor_link', { Links:[{Base: rootAnchorTypeHash, Link: anchorTypeHash, Tag: anchorType.anchorType}]});
debug('<mermaid>' + App.Agent.String + '->>DHT:Link ' + anchor.anchorType + ' to Root of all anchors</mermaid>');

Expand Down
10 changes: 10 additions & 0 deletions test/anchors.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
"Err": "",
"Regexp": ""
},
{
"Convey":"Ask for an anchor that is not there again...",
"Zome": "anchors",
"FnName": "anchor",
"Input": {"anchorType": "test2", "anchorText": "Will"},
"Output": "%h1%",
"Exposure":"public",
"Err": "",
"Regexp": ""
},
{
"Convey":"Check to see if an anchor exists",
"Zome": "anchors",
Expand Down