diff --git a/pkg/arvo/lib/test/ames-gall.hoon b/pkg/arvo/lib/test/ames-gall.hoon index 9450fc8d66..ca0a9f4a90 100644 --- a/pkg/arvo/lib/test/ames-gall.hoon +++ b/pkg/arvo/lib/test/ames-gall.hoon @@ -1,11 +1,13 @@ /+ *test, test-pub, test-sub -/= ames /sys/vane/ames +/= ames-raw /sys/vane/ames /= gall-raw /sys/vane/gall :: +=/ ames-bunt (ames-raw ~zod) =/ gall-bunt (gall-raw ~zod) :: |% -++ gall-gate _(make-gall ~zod) ++$ gall-gate _(make-gall ~zod) ++$ ames-gate _nec:ames-nec-bud ++ nec-bud =/ a ames-nec-bud =/ gall-nec (make-gall ~nec) @@ -49,11 +51,28 @@ |= [=gall-gate =wire =duct =sign-arvo =roof] %. [wire duct dud=~ sign-arvo] take:(gall-gate now=~1111.1.1 eny=`@`0xdead.beef roof) +:: +ames-check-call: run gall task, assert produces expected-moves +:: +++ ames-check-call + |= $: =ames-gate + [now=@da eny=@ =roof] + [=duct task=(hobo task:ames)] + expected-moves=(list move:ames-bunt) + == + ^- [tang ^ames-gate] + =/ ames-core (ames-gate now eny roof) + =^ moves ames-gate (call:ames-core duct dud=~ task) + [(expect-eq !>(expected-moves) !>(moves)) ames-gate] +:: +++ ames-call + |= [=ames-gate =duct task=(hobo task:ames) =roof] + %. [duct dud=~ task] + call:(ames-gate now=~1111.1.1 eny=`@`0xdead.beef roof) :: ++ ames-nec-bud :: create ~nec :: - =/ nec (ames ~nec) + =/ nec (ames-raw ~nec) =. now.nec ~1111.1.1 =. eny.nec 0xdead.beef =. life.ames-state.nec 2 @@ -63,7 +82,7 @@ =/ nec-sec sec:ex:crypto-core.ames-state.nec :: create ~bud :: - =/ bud (ames ~bud) + =/ bud (ames-raw ~bud) =. now.bud ~1111.1.1 =. eny.bud 0xbeef.dead =. life.ames-state.bud 3 @@ -72,8 +91,8 @@ =/ bud-pub pub:ex:crypto-core.ames-state.bud =/ bud-sec sec:ex:crypto-core.ames-state.bud :: - =/ nec-sym (derive-symmetric-key:ames bud-pub nec-sec) - =/ bud-sym (derive-symmetric-key:ames nec-pub bud-sec) + =/ nec-sym (derive-symmetric-key:ames-raw bud-pub nec-sec) + =/ bud-sym (derive-symmetric-key:ames-raw nec-pub bud-sec) ?> =(nec-sym bud-sym) :: tell ~nec about ~bud :: diff --git a/pkg/arvo/tests/sys/grq.hoon b/pkg/arvo/tests/sys/grq.hoon index 5eb1358ba3..3f4844fa69 100644 --- a/pkg/arvo/tests/sys/grq.hoon +++ b/pkg/arvo/tests/sys/grq.hoon @@ -31,7 +31,34 @@ == == :- t2 |. :- %| - =/ t3 ~ + =^ t3 ames.nec + %: ames-check-call:v ames.nec + [~1111.1.1 0xdead.beef *roof] + [~[/sys/way/~bud/pub /init] %plea ~bud %g /ge/pub %pub [%0 %s /foo]] + :~ :- ~[//unix] + :* %give %send [%& ~nec] + 0x79ca.8314.59aa.4ee3.b4bf.9f31.8a0b.1ba1.e19d.7b83. + 84a0.209b.2000.193c.d818.2da8.9309.759f.9e8c.b88e. + 1cb8.8400.0200.0132.e478.8000 + == + :- ~[/ames] [%pass /pump/~bud/0 %b %wait ~1111.1.1..00.00.01] + == + == + :- t3 |. :- %| + =^ t4 ames.nec + %: ames-check-call:v ames.bud + [~1111.1.2 0xbeef.dead *roof] + :- ~[//unix] + :* %hear [%& ~nec] + 0x79ca.8314.59aa.4ee3.b4bf.9f31.8a0b.1ba1.e19d.7b83. + 84a0.209b.2000.193c.d818.2da8.9309.759f.9e8c.b88e. + 1cb8.8400.0200.0132.e478.8000 + == + :~ :- ~[//unix] [%pass /qos %d %flog %text "; ~nec is your neighbor"] + :- ~[//unix] + [%pass /bone/~nec/0/1 %g %plea ~nec %g /ge/pub %pub [%0 %s /foo]] + == + == :: =^ t3 gall.nec :: %: gall-check-take:v gall.nec :: [~1111.1.2 0xdead.beef *roof] @@ -40,5 +67,5 @@ :: [%g %deal [~nec ~bud] %pub %watch /foo] :: ~ :: == - :- t3 |. :- %& ~ + :- t4 |. :- %& ~ --