mirror of
https://github.com/urbit/shrub.git
synced 2024-11-28 22:33:06 +03:00
graph-store: respond to ted's review
This commit is contained in:
parent
520bf417c7
commit
85d086e6d6
@ -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"
|
||||
|
@ -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)]
|
||||
::
|
||||
|
@ -21,7 +21,6 @@
|
||||
+$ validated-portion
|
||||
$: parent-hash=(unit hash)
|
||||
author=ship
|
||||
=index
|
||||
time-sent=time
|
||||
contents=(list content)
|
||||
==
|
||||
|
Loading…
Reference in New Issue
Block a user