mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 18:12:47 +03:00
refactors %clay +apply-foreign-update, fixing error messages
This commit is contained in:
parent
3f3f623226
commit
b4a0fee135
@ -1805,49 +1805,52 @@
|
|||||||
==
|
==
|
||||||
^+ +>
|
^+ +>
|
||||||
=< wake
|
=< wake
|
||||||
=+ ^- nut/(map tako yaki)
|
:: hit: updated commit-hashes by @ud case
|
||||||
%- molt ^- (list (pair tako yaki))
|
::
|
||||||
%+ turn ~(tap in lar)
|
=/ hit (~(uni by hit.dom) gar)
|
||||||
|= yak/yaki
|
:: nut: new commit-hash/commit pairs
|
||||||
[r.yak yak]
|
::
|
||||||
=+ ^- nat/(map lobe blob)
|
=/ nut
|
||||||
%- molt ^- (list (pair lobe blob))
|
(turn ~(tap in lar) |=(=yaki [r.yaki yaki]))
|
||||||
%+ turn ~(tap in bar)
|
:: hut: updated commits by hash
|
||||||
|= bol/blob
|
::
|
||||||
[p.bol bol]
|
=/ hut (~(gas by hut.ran) nut)
|
||||||
~| :* %bad-foreign-update
|
:: nat: new blob-hash/blob pairs
|
||||||
:* gar=gar
|
::
|
||||||
let=let
|
=/ nat
|
||||||
nut=(~(run by nut) ,~)
|
(turn ~(tap in bar) |=(=blob [p.blob blob]))
|
||||||
nat=(~(run by nat) ,~)
|
:: lat: updated blobs by hash
|
||||||
|
::
|
||||||
|
=/ lat (~(gas by lat.ran) nat)
|
||||||
|
:: traverse updated state and sanity check
|
||||||
|
::
|
||||||
|
=+ ~| :* %bad-foreign-update
|
||||||
|
[gar=gar let=let nut=(turn nut head) nat=(turn nat head)]
|
||||||
|
[hitdom=hit.dom letdom=let.dom]
|
||||||
==
|
==
|
||||||
:* hitdom=hit.dom
|
?: =(0 let)
|
||||||
letdom=let.dom
|
~
|
||||||
hutran=(~(run by hut.ran) ,~)
|
=/ =aeon 1
|
||||||
latran=(~(run by lat.ran) ,~)
|
|- ^- ~
|
||||||
==
|
=/ =tako
|
||||||
==
|
~| [%missing-aeon aeon] (~(got by hit) aeon)
|
||||||
=+ hit=(~(uni by hit.dom) gar)
|
=/ =yaki
|
||||||
=+ let=let
|
~| [%missing-tako tako] (~(got by hut) tako)
|
||||||
=+ hut=(~(uni by hut.ran) nut)
|
=+ %+ turn
|
||||||
=+ lat=(~(uni by lat.ran) nat)
|
~(tap by q.yaki)
|
||||||
=+ ?: =(0 let) ~
|
|= [=path =lobe]
|
||||||
=+ yon=`aeon`1 :: sanity check
|
~| [%missing-blob path lobe]
|
||||||
|-
|
?> (~(has by lat) lobe)
|
||||||
~| yon=yon
|
|
||||||
=+ tak=(~(got by hit) yon)
|
|
||||||
=+ yak=(~(got by hut) tak)
|
|
||||||
=+ %- ~(urn by q.yak)
|
|
||||||
|= {pax/path lob/lobe}
|
|
||||||
~| [pax=path lob=lobe]
|
|
||||||
(~(got by lat) lob)
|
|
||||||
?: =(let yon)
|
|
||||||
~
|
~
|
||||||
$(yon +(yon))
|
?: =(let aeon)
|
||||||
|
~
|
||||||
|
$(aeon +(aeon))
|
||||||
|
:: persist updated state
|
||||||
|
::
|
||||||
%= +>.$
|
%= +>.$
|
||||||
|
let.dom (max let let.dom)
|
||||||
lim (max (fall lem lim) lim)
|
lim (max (fall lem lim) lim)
|
||||||
hit.dom hit
|
hit.dom hit
|
||||||
let.dom (max let let.dom)
|
|
||||||
hut.ran hut
|
hut.ran hut
|
||||||
lat.ran lat
|
lat.ran lat
|
||||||
==
|
==
|
||||||
|
Loading…
Reference in New Issue
Block a user