graph-store: respond to ted's review

This commit is contained in:
Logan Allen 2020-07-21 11:04:18 -07:00
parent 520bf417c7
commit 85d086e6d6
3 changed files with 4 additions and 6 deletions

View File

@ -145,18 +145,18 @@
=* node +.i.node-list
%_ $
node-list t.node-list
graph (add-node-at-index graph index node ~ mark)
graph (add-node-at-index graph index node mark)
==
::
++ add-node-at-index
=| parent-hash=(unit hash:store)
|= $: =graph:store
=index:store
=node:store
parent-hash=(unit hash:store)
mark=(unit mark:store)
==
^- graph:store
?~ index graph
?< ?=(~ index)
?> (validate-graph (gas:orm ~ [i.index node]~) mark)
=* atom i.index
%^ put:orm
@ -167,7 +167,7 @@
?~ t.index
=* p post.node
=/ =validated-portion:store
[parent-hash author.p index.p time-sent.p contents.p]
[parent-hash author.p time-sent.p contents.p]
=/ =hash:store (mug validated-portion)
?~ hash.p node
~| "hash of post does not match calculated hash"

View File

@ -8,7 +8,6 @@
?> (check-balance:((ordered-map key value) ord) b)
b
::
+$ mark term
+$ graph ((mop atom node) gth)
+$ marked-graph [p=graph q=(unit mark)]
::

View File

@ -21,7 +21,6 @@
+$ validated-portion
$: parent-hash=(unit hash)
author=ship
=index
time-sent=time
contents=(list content)
==