mirror of
https://github.com/ilyakooo0/urbit.git
synced 2025-01-03 04:40:50 +03:00
eth-watcher: be quieter about parse errors
This commit is contained in:
parent
73cffdb28f
commit
b51eda4f1e
@ -124,6 +124,7 @@
|
||||
=. url.state url.poke
|
||||
[[(start state [our dap]:bowl) ~] this]
|
||||
==
|
||||
::
|
||||
++ on-watch
|
||||
|= =path
|
||||
^- (quip card:agent:gall _this)
|
||||
|
@ -398,7 +398,6 @@
|
||||
++ thread-fail
|
||||
|= [=yarn =term =tang]
|
||||
^- (quip card ^state)
|
||||
%- (slog leaf+"strand {<yarn>} failed" leaf+<term> tang)
|
||||
=/ =tid (yarn-to-tid yarn)
|
||||
=/ fail-cards (thread-say-fail tid term tang)
|
||||
=^ cards state (thread-clean yarn)
|
||||
|
@ -126,28 +126,30 @@
|
||||
=/ m (strand:strandio ,block)
|
||||
^- form:m
|
||||
|^
|
||||
%+ (retry:strandio ,block) `10
|
||||
=/ m (strand:strandio ,(unit block))
|
||||
^- form:m
|
||||
;< =json bind:m
|
||||
%+ request-rpc url
|
||||
:- `'block by number'
|
||||
[%eth-get-block-by-number number |]
|
||||
=/ =block (parse-block json)
|
||||
?. =(number number.id.block)
|
||||
(strand-fail:strandio %reorg-detected >number< >block< ~)
|
||||
(pure:m block)
|
||||
(pure:m (parse-block json))
|
||||
::
|
||||
++ parse-block
|
||||
|= =json
|
||||
^- block
|
||||
=< [[&1 &2] |2]
|
||||
^- [@ @ @]
|
||||
^- (unit block)
|
||||
=< ?~(. ~ `[[&1 &2] |2]:u)
|
||||
^- (unit [@ @ @])
|
||||
~| json
|
||||
%. json
|
||||
=, dejs:format
|
||||
=, dejs-soft:format
|
||||
%- ot
|
||||
:~ hash+parse-hex-result:rpc:ethereum
|
||||
number+parse-hex-result:rpc:ethereum
|
||||
'parentHash'^parse-hex-result:rpc:ethereum
|
||||
:~ hash+parse-hex
|
||||
number+parse-hex
|
||||
'parentHash'^parse-hex
|
||||
==
|
||||
::
|
||||
++ parse-hex |=(=json `(unit @)`(some (parse-hex-result:rpc:ethereum json)))
|
||||
--
|
||||
::
|
||||
++ get-logs-by-hash
|
||||
|
Loading…
Reference in New Issue
Block a user