mirror of
https://github.com/urbit/shrub.git
synced 2025-01-03 10:02:32 +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)
|
||||
==
|
||||
::
|
||||
:: history: newest block first, oldest event first
|
||||
+$ history (list loglist)
|
||||
+$ pending-logs (map number:block loglist)
|
||||
::
|
||||
@ -278,7 +279,7 @@
|
||||
(rewind [path dog] block)
|
||||
;< [=new=pending-logs =released=loglist] bind:m
|
||||
(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)
|
||||
=. new-pending-logs
|
||||
(~(put by new-pending-logs) number.id.block new-loglist)
|
||||
@ -360,7 +361,7 @@
|
||||
?: (lth latest-number (add number.dog zoom-margin))
|
||||
(pure:m dog)
|
||||
=/ to-number=number:block (sub latest-number zoom-margin)
|
||||
;< =loglist bind:m
|
||||
;< =loglist bind:m :: oldest first
|
||||
%: get-logs-by-range
|
||||
url.dog
|
||||
contracts.dog
|
||||
@ -461,7 +462,10 @@
|
||||
:+ %diff %eth-watcher-diff
|
||||
:- %history
|
||||
^- loglist
|
||||
(zing history:(~(gut by dogs.state) t.path *watchdog))
|
||||
%- zing
|
||||
%- flop
|
||||
=< history
|
||||
(~(gut by dogs.state) t.path *watchdog)
|
||||
(pure:m state)
|
||||
::
|
||||
:: +handle-peek: get diagnostics data
|
||||
|
@ -22,7 +22,7 @@
|
||||
==
|
||||
::
|
||||
+$ diff
|
||||
$% :: %history: full event log history
|
||||
$% :: %history: full event log history, oldest first
|
||||
::
|
||||
[%history =loglist]
|
||||
:: %log: newly added log
|
||||
|
Loading…
Reference in New Issue
Block a user