From 0a2e721d7f81d6b5bd5922200596384b7c4ed78f Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Wed, 22 Jul 2020 13:32:47 -0700 Subject: [PATCH] graph-store: move over to +sham from +mug --- pkg/arvo/app/graph-store.hoon | 12 ++++++------ pkg/arvo/lib/signatures.hoon | 8 -------- pkg/arvo/sur/post.hoon | 3 +-- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/pkg/arvo/app/graph-store.hoon b/pkg/arvo/app/graph-store.hoon index 71a3453565..df7f3fd802 100644 --- a/pkg/arvo/app/graph-store.hoon +++ b/pkg/arvo/app/graph-store.hoon @@ -177,7 +177,7 @@ =* p post.node =/ =validated-portion:store [parent-hash author.p time-sent.p contents.p] - =/ =hash:store (mug validated-portion) + =/ =hash:store `@ux`(sham validated-portion) ?~ hash.p node ~| "hash of post does not match calculated hash" ?> =(hash u.hash.p) @@ -413,7 +413,7 @@ /(scot %p our.bowl)/[q.byk.bowl]/(scot %da now.bowl)/[u.mark] == %+ roll (tap:orm graph) - |= [[=atom:store =node:store] out=?] + |= [[=atom =node:store] out=?] ?& out =(%& -:(mule |.((vale:dais [atom post.node])))) ?- -.children.node @@ -450,8 +450,8 @@ [%x %graph-subset @ @ @ @ ~] =/ =ship (slav %p i.t.t.path) =/ =term i.t.t.t.path - =/ start=(unit atom:store) (rush i.t.t.t.t.path dem:ag) - =/ end=(unit atom:store) (rush i.t.t.t.t.t.path dem:ag) + =/ start=(unit atom) (rush i.t.t.t.t.path dem:ag) + =/ end=(unit atom) (rush i.t.t.t.t.t.path dem:ag) =/ graph=(unit marked-graph:store) (~(get by graphs) [ship term]) ?~ graph ~ @@ -490,8 +490,8 @@ [%x %node-children-subset @ @ @ @ @ *] =/ =ship (slav %p i.t.t.path) =/ =term i.t.t.t.path - =/ start=(unit atom:store) (rush i.t.t.t.t.path dem:ag) - =/ end=(unit atom:store) (rush i.t.t.t.t.t.path dem:ag) + =/ start=(unit atom) (rush i.t.t.t.t.path dem:ag) + =/ end=(unit atom) (rush i.t.t.t.t.t.path dem:ag) =/ =index:store (turn t.t.t.t.t.t.path |=(=cord (slav %ud cord))) =/ node=(unit node:store) (get-node ship term index) diff --git a/pkg/arvo/lib/signatures.hoon b/pkg/arvo/lib/signatures.hoon index 62c7ca87e4..6c42b3721c 100644 --- a/pkg/arvo/lib/signatures.hoon +++ b/pkg/arvo/lib/signatures.hoon @@ -12,14 +12,6 @@ our life :: -:: sha256 noun hash -:: -++ sha256-mug - |= yux/* ^- @ux ^- @ - ?@ yux - (shax yux) - (shax (jam yux)) -:: ++ is-signature-valid |= [=signature =hash now=time] ^- ? diff --git a/pkg/arvo/sur/post.hoon b/pkg/arvo/sur/post.hoon index 43ea66a732..dc35f7fa1e 100644 --- a/pkg/arvo/sur/post.hoon +++ b/pkg/arvo/sur/post.hoon @@ -1,10 +1,9 @@ /- *resource |% -+$ atom @u +$ index (list atom) +$ uid [=resource =index] :: -:: mug hash of +validated-portion +:: +sham (half sha-256) hash of +validated-portion +$ hash @ux :: +$ signature [p=@ux q=ship r=life]