From 5bedf98b77a13fdcfd8a214d22308afb7d7fc5a7 Mon Sep 17 00:00:00 2001 From: Joe Bryan Date: Fri, 7 Dec 2018 02:06:54 -0500 Subject: [PATCH] updates the |snap:dawn gates to produce units --- sys/zuse.hoon | 28 +++++++++++++++------------- tests/sys/zuse/dawn.hoon | 8 ++++---- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/sys/zuse.hoon b/sys/zuse.hoon index 5ac674701..eaa316a72 100644 --- a/sys/zuse.hoon +++ b/sys/zuse.hoon @@ -8361,14 +8361,18 @@ :: ++ bloq |= snap=snapshot:jael - ^- @ud + ^- (unit @ud) + =- ?:(?=(%| -.out) ~ (some p.out)) + ^= out %- mule |. latest-block.snap :: +czar:snap:dawn: extract galaxy table :: ++ czar |= snap=snapshot:jael - ^- (map ship [=life =pass]) - %- malt + ^- (unit (map ship [=life =pass])) + =- ?:(?=(%| -.out) ~ (some p.out)) + ^= out %- mule |. + %- ~(gas by *(map ship [=life =pass])) %+ turn (gulf 0 255) |= gal=@ ^- [ship [life pass]] @@ -8379,26 +8383,24 @@ :: ++ hull |= [who=ship snap=snapshot:jael] - ^- hull:constitution:ethe - =/ res (~(get by hul.eth.snap) who) - ?~ res - ~& ['hull not found in snapshot; can\'t verify' who=who] - !! - u.res + ^- (unit hull:constitution:ethe) + (~(get by hul.eth.snap) who) :: +turf:snap:dawn: extract network domains :: ++ turf |= snap=snapshot:jael - ^- (list ^turf) + ^- (unit (list ^turf)) + =- ?:(?=(%| -.out) ~ (some p.out)) + ^= out %- mule |. %+ murn - ^- (list (pair)) + ^- (list host:eyre) %+ murn ^- (list @t) ~[pri sec ter]:dns.eth.snap |= dom=@t - ^- (unit (pair)) + ^- (unit host:eyre) (rush dom thos:de-purl:html) - |=([* a=*] ((soft ^turf) a)) + |=(a=host:eyre ?:(?=(%| -.a) ~ (some p.a))) -- :: +veri:dawn: validate keys, life, discontinuity, &c :: diff --git a/tests/sys/zuse/dawn.hoon b/tests/sys/zuse/dawn.hoon index fd88ca9d8..cbd08fe19 100644 --- a/tests/sys/zuse/dawn.hoon +++ b/tests/sys/zuse/dawn.hoon @@ -189,22 +189,22 @@ :: ++ test-snap-bloq %+ expect-eq - !> 4.230.000 + !> [~ 4.230.000] !> (bloq:snap:dawn snap) :: ++ test-snap-hull %+ expect-eq - !> hul + !> [~ hul] !> (hull:snap:dawn ~zod snap) :: ++ test-snap-czar %+ expect-eq !> 256 - !> ~(wyt by (czar:snap:dawn snap)) + !> ~(wyt by (need (czar:snap:dawn snap))) :: ++ test-snap-turf %+ expect-eq - !> `(list turf)`~[~['org' 'urbit'] ~['org' 'urbit']] + !> [~ `(list turf)`~[~['org' 'urbit'] ~['org' 'urbit']]] !> (turf:snap:dawn snap) :: ++ test-veri-good