diff --git a/app/hood.hoon b/app/hood.hoon index a3deb5d671..0db673d704 100644 --- a/app/hood.hoon +++ b/app/hood.hoon @@ -43,7 +43,7 @@ $% {$drum $1 drum-pith-1} :: {$helm $0 helm-pith} :: {$kiln $0 kiln-pith} :: - {$womb $0 pith:womb} :: + {$womb $1 pith:womb} :: {$write $0 pith:write} :: == :: -- :: @@ -167,6 +167,7 @@ ++ poke-womb-rekey (wrap poke-rekey):from-womb ++ poke-womb-report (wrap poke-report):from-womb ++ poke-womb-manage (wrap poke-manage):from-womb +++ poke-womb-manage-old-key (wrap poke-manage-old-key):from-womb ++ poke-womb-release (wrap poke-release):from-womb ++ poke-womb-reinvite (wrap poke-reinvite):from-womb ++ poke-womb-replay-log (wrap poke-replay-log):from-womb diff --git a/gen/hood/manage-old-key.hoon b/gen/hood/manage-old-key.hoon new file mode 100644 index 0000000000..3b60501e01 --- /dev/null +++ b/gen/hood/manage-old-key.hoon @@ -0,0 +1,13 @@ +:: +:::: /hoon/manage-old-key/hood/gen + :: +/? 310 +:: +:::: + !: +:- %say +|= $: {now/@da eny/@uvI bec/beak} + {{who/@p key/@ $~} $~} + == +:- %womb-manage-old-key +[who key] diff --git a/lib/womb.hoon b/lib/womb.hoon index bc41eabaf9..c425d49cb2 100644 --- a/lib/womb.hoon +++ b/lib/womb.hoon @@ -95,12 +95,13 @@ :::: :: :: :: :: :: |% -++ part {$womb $0 pith} :: womb state +++ part {$womb $1 pith} :: womb state ++ pith :: womb content $: boss/(unit ship) :: outside master bureau/(map passcode balance) :: active invitations office/property :: properties managed hotel/(map (each ship mail) client) :: everyone we know + recycling/(map ship @) :: old ticket keys == :: -- :: :: :: :: @@ -499,17 +500,21 @@ |= {a/knot b/knot} ^- {him/@ tik/@} [him=(rash a old-phon) tik=(rash b old-phon)] :: -++ check-ticket - |= {a/@ b/@} ^- ? - =(b `@p`!!) +++ check-old-ticket + |= {a/ship b/@pG} ^- (unit ?) + %+ bind (~(get by recycling) (sein a)) + |= key/@ ^- ? + =(b `@p`(end 6 1 (shaf %tick (mix a (shax key))))) :: ++ peek-x-ticket |= tyl/path ^- (unit (unit {$womb-tick-info ?($fail $good $used)})) ?. ?=({@ @ $~} tyl) ~|(bad-path+tyl !!) =+ [him tik]=(parse-ticket i.tyl i.t.tyl) - :^ ~ ~ %womb-tick-info - ?. (check-ticket i.tyl i.t.tyl) %fail + %+ bind (check-old-ticket him tik) + |= gud/? + :+ ~ %womb-tick-info + ?. gud %fail ?. (~(has by bureau) (shas %tick tik)) %good %used @@ -542,6 +547,12 @@ $ticket (peek-x-ticket +.tyl) == :: +++ poke-manage-old-key :: add to recyclable tickets + |= {a/ship b/@} + =< abet + ?> |(=(our src) =([~ src] boss)) :: privileged + .(recycling (~(put by recycling) a b)) +:: ++ poke-manage :: add to property |= a/(list ship) =< abet @@ -696,7 +707,7 @@ =. log-transaction (log-transaction %claim-old +<) ?> =(src src) =+ [him tik]=(parse-ticket him-t tik-t) - ?> (check-ticket him tik) + ?> (need (check-old-ticket him tik)) =+ pas=(shas %tick tik) ?: (~(has by bureau) pas) ~|(already-claimed+[him-t tik-t] !!) @@ -711,7 +722,7 @@ ?> =(src src) (claim-any aut her) :: -++ claim-any +++ claim-any :: register |= {aut/passcode her/@p} =; claimed :: =. claimed (emit.claimed %wait $~) :: XX delay ack