eth-watcher: be quieter about parse errors

This commit is contained in:
Philip Monk 2019-12-04 17:58:00 -08:00
parent 73cffdb28f
commit b51eda4f1e
No known key found for this signature in database
GPG Key ID: B66E1F02604E44EC
3 changed files with 14 additions and 12 deletions

View File

@ -124,6 +124,7 @@
=. url.state url.poke =. url.state url.poke
[[(start state [our dap]:bowl) ~] this] [[(start state [our dap]:bowl) ~] this]
== ==
::
++ on-watch ++ on-watch
|= =path |= =path
^- (quip card:agent:gall _this) ^- (quip card:agent:gall _this)

View File

@ -398,7 +398,6 @@
++ thread-fail ++ thread-fail
|= [=yarn =term =tang] |= [=yarn =term =tang]
^- (quip card ^state) ^- (quip card ^state)
%- (slog leaf+"strand {<yarn>} failed" leaf+<term> tang)
=/ =tid (yarn-to-tid yarn) =/ =tid (yarn-to-tid yarn)
=/ fail-cards (thread-say-fail tid term tang) =/ fail-cards (thread-say-fail tid term tang)
=^ cards state (thread-clean yarn) =^ cards state (thread-clean yarn)

View File

@ -126,28 +126,30 @@
=/ m (strand:strandio ,block) =/ m (strand:strandio ,block)
^- form:m ^- form:m
|^ |^
%+ (retry:strandio ,block) `10
=/ m (strand:strandio ,(unit block))
^- form:m
;< =json bind:m ;< =json bind:m
%+ request-rpc url %+ request-rpc url
:- `'block by number' :- `'block by number'
[%eth-get-block-by-number number |] [%eth-get-block-by-number number |]
=/ =block (parse-block json) (pure:m (parse-block json))
?. =(number number.id.block)
(strand-fail:strandio %reorg-detected >number< >block< ~)
(pure:m block)
:: ::
++ parse-block ++ parse-block
|= =json |= =json
^- block ^- (unit block)
=< [[&1 &2] |2] =< ?~(. ~ `[[&1 &2] |2]:u)
^- [@ @ @] ^- (unit [@ @ @])
~| json ~| json
%. json %. json
=, dejs:format =, dejs-soft:format
%- ot %- ot
:~ hash+parse-hex-result:rpc:ethereum :~ hash+parse-hex
number+parse-hex-result:rpc:ethereum number+parse-hex
'parentHash'^parse-hex-result:rpc:ethereum 'parentHash'^parse-hex
== ==
::
++ parse-hex |=(=json `(unit @)`(some (parse-hex-result:rpc:ethereum json)))
-- --
:: ::
++ get-logs-by-hash ++ get-logs-by-hash