graph-store: fully tested mark validation system

This commit is contained in:
Logan Allen 2020-07-28 12:03:09 -07:00
parent a35749e2be
commit 452d6ea4e1
5 changed files with 30 additions and 17 deletions

View File

@ -166,6 +166,7 @@
==
^- graph:store
?< ?=(~ index)
~| "validation of node failed using mark {<mark>}"
?> (validate-graph (gas:orm ~ [i.index node]~) mark)
=* atom i.index
%^ put:orm

View File

@ -1,10 +0,0 @@
:: graph-store|add-nodes: add nodes to a graph at a particular resource
::
/- *graph-store
:- %say
|= $: [now=@da eny=@uvJ =beak]
[[=resource nodes=(map index node) ~] ~]
==
:- %graph-update
^- updates
[%0 now [%add-nodes resource nodes]]

View File

@ -0,0 +1,20 @@
:: graph-store|add-post: add post to a graph
::
/- *graph-store
:- %say
|= $: [now=@da eny=@uvJ =beak]
[[[our=ship name=term] contents=(list content) ~] ~]
==
=/ =post *post
=: author.post our
index.post [now]~
time-sent.post now
contents.post contents
==
::
:- %graph-update
^- update
:+ %0 now
:+ %add-nodes [our name]
%- ~(gas by *(map index node))
~[[[now]~ [post [%empty ~]]]]

View File

@ -1,16 +1,16 @@
/- store=graph-store
|_ [=atom =post:store]
/- *post
|_ i=indexed-post
++ grow
|%
++ noun [atom post]
++ noun i
--
++ grab
|%
++ noun
|= [=^atom =post:store]
^- [^^atom post:store]
?> ?=([@ ~] index.post)
[atom post]
|= p=*
=/ ip ;;(indexed-post p)
?> ?=([@ ~] index.p.ip)
ip
--
::
++ grad %noun

View File

@ -17,6 +17,8 @@
=signatures
==
::
+$ indexed-post [a=atom p=post]
::
+$ validated-portion
$: parent-hash=(unit hash)
author=ship