mirror of
https://github.com/urbit/shrub.git
synced 2025-01-07 05:26:56 +03:00
eth-watcher: ensure logs always sent oldest-first
For easier "this happened, then that happened" on the client side.
This commit is contained in:
parent
e0b564f72f
commit
555eae6e25
@ -19,6 +19,7 @@
|
|||||||
blocks=(list block)
|
blocks=(list block)
|
||||||
==
|
==
|
||||||
::
|
::
|
||||||
|
:: history: newest block first, oldest event first
|
||||||
+$ history (list loglist)
|
+$ history (list loglist)
|
||||||
+$ pending-logs (map number:block loglist)
|
+$ pending-logs (map number:block loglist)
|
||||||
::
|
::
|
||||||
@ -278,7 +279,7 @@
|
|||||||
(rewind [path dog] block)
|
(rewind [path dog] block)
|
||||||
;< [=new=pending-logs =released=loglist] bind:m
|
;< [=new=pending-logs =released=loglist] bind:m
|
||||||
(release-old-events path pending-logs.dog number.id.block)
|
(release-old-events path pending-logs.dog number.id.block)
|
||||||
;< =new=loglist bind:m
|
;< =new=loglist bind:m :: oldest first
|
||||||
(get-logs-by-hash url.dog hash.id.block contracts.dog topics.dog)
|
(get-logs-by-hash url.dog hash.id.block contracts.dog topics.dog)
|
||||||
=. new-pending-logs
|
=. new-pending-logs
|
||||||
(~(put by new-pending-logs) number.id.block new-loglist)
|
(~(put by new-pending-logs) number.id.block new-loglist)
|
||||||
@ -360,7 +361,7 @@
|
|||||||
?: (lth latest-number (add number.dog zoom-margin))
|
?: (lth latest-number (add number.dog zoom-margin))
|
||||||
(pure:m dog)
|
(pure:m dog)
|
||||||
=/ to-number=number:block (sub latest-number zoom-margin)
|
=/ to-number=number:block (sub latest-number zoom-margin)
|
||||||
;< =loglist bind:m
|
;< =loglist bind:m :: oldest first
|
||||||
%: get-logs-by-range
|
%: get-logs-by-range
|
||||||
url.dog
|
url.dog
|
||||||
contracts.dog
|
contracts.dog
|
||||||
@ -461,7 +462,10 @@
|
|||||||
:+ %diff %eth-watcher-diff
|
:+ %diff %eth-watcher-diff
|
||||||
:- %history
|
:- %history
|
||||||
^- loglist
|
^- loglist
|
||||||
(zing history:(~(gut by dogs.state) t.path *watchdog))
|
%- zing
|
||||||
|
%- flop
|
||||||
|
=< history
|
||||||
|
(~(gut by dogs.state) t.path *watchdog)
|
||||||
(pure:m state)
|
(pure:m state)
|
||||||
::
|
::
|
||||||
:: +handle-peek: get diagnostics data
|
:: +handle-peek: get diagnostics data
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
==
|
==
|
||||||
::
|
::
|
||||||
+$ diff
|
+$ diff
|
||||||
$% :: %history: full event log history
|
$% :: %history: full event log history, oldest first
|
||||||
::
|
::
|
||||||
[%history =loglist]
|
[%history =loglist]
|
||||||
:: %log: newly added log
|
:: %log: newly added log
|
||||||
|
Loading…
Reference in New Issue
Block a user