mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-09-20 15:08:34 +03:00
azimuth: process snapshot on-load
This commit is contained in:
parent
1950736518
commit
583d5f5063
@ -21,7 +21,7 @@
|
||||
=, jael
|
||||
|%
|
||||
+$ app-state
|
||||
$: %2
|
||||
$: %3
|
||||
url=@ta
|
||||
=net
|
||||
whos=(set ship)
|
||||
@ -97,13 +97,35 @@
|
||||
=^ cards state
|
||||
(%*(run-logs do nas.state *^state:naive) logs.state)
|
||||
[(jael-update:do (to-udiffs:do cards)) state]
|
||||
?> ?=(%2 -.old-state)
|
||||
[cards-1 this(state old-state)]
|
||||
=^ cards-2 old-state
|
||||
?. ?=(%2 -.old-state)
|
||||
`old-state
|
||||
:: replace naive state and indices with snapshot
|
||||
::
|
||||
++ app-states $%(state-0 state-1 app-state)
|
||||
=: nas.old-state nas.snap
|
||||
own.old-state owners.snap
|
||||
spo.old-state sponsors.snap
|
||||
logs.old-state ~
|
||||
==
|
||||
=/ points=@ud ~(wyt by points.nas.old-state)
|
||||
%- %- slog :_ ~
|
||||
:- %leaf
|
||||
"ship: processing azimuth snapshot ({<points>} points)"
|
||||
=/ snap-cards=udiffs:point (run-state:do id.snap points.nas.old-state)
|
||||
:_ [%3 +.old-state]
|
||||
;: welp
|
||||
cards-1
|
||||
(jael-update:do snap-cards)
|
||||
:: start getting new logs after the last id:block in the snapshot
|
||||
::
|
||||
+$ state-1
|
||||
$: %1
|
||||
start:do
|
||||
==
|
||||
?> ?=(%3 -.old-state)
|
||||
[cards-2 this(state old-state)]
|
||||
::
|
||||
++ app-states $%(state-0 state-1-2 app-state)
|
||||
+$ state-1-2
|
||||
$: ?(%1 %2)
|
||||
url=@ta
|
||||
=net
|
||||
whos=(set ship)
|
||||
@ -143,10 +165,6 @@
|
||||
==
|
||||
`this
|
||||
==
|
||||
?: =(%eth-logs mark)
|
||||
=+ !<(logs=(list event-log:rpc:ethereum) vase)
|
||||
=. logs.state logs
|
||||
$(mark %noun, vase !>(%rerun))
|
||||
::
|
||||
?. ?=(%azimuth-poke mark)
|
||||
(on-poke:def mark vase)
|
||||
|
Loading…
Reference in New Issue
Block a user