mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-11-11 04:48:00 +03:00
Update parsing of event logs to assume up-to-date RPC API spec.
This commit is contained in:
parent
4ed365a263
commit
7e74cd3bb7
@ -146,21 +146,23 @@
|
||||
?> ?=(%s -.j)
|
||||
(hex-to-num p.j)
|
||||
::
|
||||
++ parse-eth-get-filter-changes-res
|
||||
++ parse-event-logs
|
||||
(ar:dejs:format parse-event-log)
|
||||
::
|
||||
++ parse-event-log
|
||||
=, dejs:format
|
||||
|= j=json
|
||||
=- ((ar -) j)
|
||||
|= cha=json
|
||||
^- filter-change
|
||||
=- ((ot -) cha)
|
||||
:~ =- [type+(cu - so)]
|
||||
|= m=@t
|
||||
?. =(m 'mined') ~
|
||||
=- `((ot -) cha) ::TODO not sure if elegant or hacky.
|
||||
|= log=json
|
||||
^- event-log
|
||||
=- ((ot -) log)
|
||||
:~ =- ['logIndex'^(cu - (mu so))]
|
||||
|= li=(unit @t)
|
||||
?~ li ~
|
||||
=- `((ot -) log) ::TODO not sure if elegant or hacky.
|
||||
:~ 'logIndex'^(cu hex-to-num so)
|
||||
'transactionIndex'^(cu hex-to-num so)
|
||||
'blockHash'^(cu hex-to-num so)
|
||||
'transactionHash'^(cu hex-to-num so)
|
||||
'blockNumber'^(cu hex-to-num so)
|
||||
'blockHash'^(cu hex-to-num so)
|
||||
==
|
||||
::
|
||||
address+(cu hex-to-num so)
|
||||
|
@ -48,12 +48,14 @@
|
||||
==
|
||||
::
|
||||
++ filter-change
|
||||
++ event-log
|
||||
$: :: null for pending logs
|
||||
$= mined %- unit
|
||||
$: log-index=@ud
|
||||
transaction-index=@ud
|
||||
block-hash=@ux
|
||||
transaction-hash=@ux
|
||||
block-number=@ud
|
||||
block-hash=@ux
|
||||
==
|
||||
::
|
||||
address=@ux
|
||||
|
Loading…
Reference in New Issue
Block a user