updates the |snap:dawn gates to produce units

This commit is contained in:
Joe Bryan 2018-12-07 02:06:54 -05:00
parent 4508aa9c95
commit 5bedf98b77
2 changed files with 19 additions and 17 deletions

View File

@ -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
::

View File

@ -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