mirror of
https://github.com/urbit/shrub.git
synced 2024-12-01 06:35:32 +03:00
graph-store: fully tested mark validation system
This commit is contained in:
parent
a35749e2be
commit
452d6ea4e1
@ -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
|
||||
|
@ -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]]
|
20
pkg/arvo/gen/graph-store/add-post.hoon
Normal file
20
pkg/arvo/gen/graph-store/add-post.hoon
Normal 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 ~]]]]
|
@ -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
|
||||
|
@ -17,6 +17,8 @@
|
||||
=signatures
|
||||
==
|
||||
::
|
||||
+$ indexed-post [a=atom p=post]
|
||||
::
|
||||
+$ validated-portion
|
||||
$: parent-hash=(unit hash)
|
||||
author=ship
|
||||
|
Loading…
Reference in New Issue
Block a user