diff --git a/pkg/arvo/app/aqua.hoon b/pkg/arvo/app/aqua.hoon index efe256f0e7..210a1f3f82 100644 --- a/pkg/arvo/app/aqua.hoon +++ b/pkg/arvo/app/aqua.hoon @@ -84,7 +84,7 @@ =^ cards state ?+ mark ~|([%aqua-bad-mark mark] !!) %aqua-events (poke-aqua-events:ac !<((list aqua-event) vase)) - %pill (poke-pill:ac !<(pill vase)) + %pill (poke-pill:ac !<(pill vase)) %noun (poke-noun:ac !<(* vase)) %azimuth-action (poke-azimuth-action:ac !<(azimuth-action vase)) == @@ -662,34 +662,55 @@ (pe ~bud) :: XX why ~bud? need an example :: %read - ?~ pier=(~(get by ships.piers) from.ae) - (pe from.ae) + ?~ pier=(~(get by ships.piers) ship.from.ae) + (pe ship.from.ae) =/ cash (~(get by namespace.u.pier) path.ae) |- ?^ cash ?: (gth num.ae (lent u.cash)) - (pe from.ae) + (pe ship.from.ae) ::TODO depends on /ted/aqua/ames behavior in a weird indirect way - =/ for=@p `@`(tail for.ae) ::NOTE moons & comets not supported - =; task=task-arvo - ^$(ae [%event for /a/aqua/fine-response task], thus this) - :+ %hear `lane:ames`[%| `@`from.ae] + =/ for=@p `@`(tail lane.for.ae) ::NOTE moons & comets not supported + %- push-events:(pe for) + %- flop =< events + %+ roll u.cash + |= [=yowl:ames i=@ud events=(list unix-event)] + :- +(i) + :_ events + :- /a/aqua/fine-response/[(scot %ud i)] + ^- task-arvo + :+ %hear `lane:ames`[%| `@`ship.from.ae] ^- blob:ames - =/ =shot:ames - ::NOTE dec is important! so dumb!! - (sift-shot:ames `@`(snag (dec num.ae) u.cash)) - ::TODO runtime needs to update rcvr field also - ::NOTE rcvr life is allowed to be wrong - (etch-shot:ames shot(sndr from.ae, rcvr for)) + %- etch-shot:ames + :* [sndr=ship.from.ae rcvr=for] + req=| sam=| + sndr-tick=life.from.ae + rcvr-tick=life.for.ae + origin=~ + content=`@ux`yowl + == + :: =/ pacs=(unit (list yowl:ames)) + =/ =path [%fine %hunk (scot %ud num.ae) '512' path.ae] %+ biff - (peek-once:(pe from.ae) %ax %$ [%fine %message path.ae]) + (peek-once:(pe ship.from.ae) %ax %$ path) (soft (list yowl:ames)) - ?~ pacs (pe from.ae) + ?~ pacs (pe ship.from.ae) + =. u.pacs + :: add request to each response packet payload + :: + =+ pat=(spat path.ae) + =+ wid=(met 3 pat) + %- flop =< blobs + %+ roll u.pacs + |= [=yowl:ames num=_1 blobs=(list @ux)] + :- +(num) + :_ blobs + (can 3 4^num 2^wid wid^`@`pat (met 3 yowl)^yowl ~) =. namespace.u.pier (~(put by namespace.u.pier) path.ae u.pacs) =. ships.piers - (~(put by ships.piers) from.ae u.pier) + (~(put by ships.piers) ship.from.ae u.pier) $(cash pacs, thus this) :: %event diff --git a/pkg/arvo/ted/aqua/ames.hoon b/pkg/arvo/ted/aqua/ames.hoon index b97cb4c0a7..8315eba2ee 100644 --- a/pkg/arvo/ted/aqua/ames.hoon +++ b/pkg/arvo/ted/aqua/ames.hoon @@ -26,12 +26,13 @@ ^- (list card:agent:gall) =/ rcvr=ship (lane-to-ship lan) =/ hear-lane (ship-to-lane sndr) - =/ =shot (sift-shot pac) + =/ =shot (sift-shot pac) ?: &(!sam.shot req.shot) :: is fine request - =/ [=peep =meow] (sift-purr `@ux`content.shot) - ~& fine-request+peep + =/ [%0 =peep] (sift-wail `@ux`content.shot) %+ emit-aqua-events our - [%read [rcvr path.peep] [hear-lane num.peep]]~ + :_ ~ + :- %read + [[[rcvr rcvr-tick.shot] path.peep] [hear-lane sndr-tick.shot] num.peep] %+ emit-aqua-events our [%event rcvr /a/newt/0v1n.2m9vh %hear hear-lane pac]~ :: +lane-to-ship: decode a ship from an aqua lane diff --git a/pkg/base-dev/sur/aquarium.hoon b/pkg/base-dev/sur/aquarium.hoon index 324ad92a8b..27b022b456 100644 --- a/pkg/base-dev/sur/aquarium.hoon +++ b/pkg/base-dev/sur/aquarium.hoon @@ -41,7 +41,7 @@ [%pause-events who=ship] [%snap-ships lab=term hers=(list ship)] [%restore-snap lab=term] - [%read [from=ship =path] [for=lane:ames num=@ud]] + [%read [from=[=ship life=@ubC] =path] for=[=lane:ames life=@ubC] num=@ud] [%event who=ship ue=unix-event] == ::