Skip to content
This repository has been archived by the owner on Aug 14, 2019. It is now read-only.

More accurately represent Ethereum RPC filter topics #1079

Merged
merged 2 commits into from
Feb 22, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 23 additions & 6 deletions sys/zuse.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -7884,14 +7884,14 @@
fro=(unit block)
tob=(unit block)
adr=(list address)
top=(list octs)
top=(list ?(@ux (list @ux)))
==
[%eth-get-filter-logs fid=@ud]
$: %eth-get-logs
fro=(unit block)
tob=(unit block)
adr=(list address)
top=(list octs)
top=(list ?(@ux (list @ux)))
==
[%eth-get-filter-changes fid=@ud]
[%eth-send-raw-transaction dat=@ux]
Expand Down Expand Up @@ -8031,8 +8031,8 @@
(turn adr.req (cork address-to-hex tape))
::
?~ top.req ~
:^ ~ 'topics' %a
(turn `(list octs)`top.req :(cork render-hex-bytes prefix-hex tape))
:+ ~ 'topics'
(topics-to-json top.req)
==
::
%eth-get-filter-logs
Expand All @@ -8058,8 +8058,8 @@
(turn adr.req (cork address-to-hex tape))
::
?~ top.req ~
:^ ~ 'topics' %a
(turn `(list octs)`top.req :(cork render-hex-bytes prefix-hex tape))
:+ ~ 'topics'
(topics-to-json top.req)
==
::
%eth-get-filter-changes
Expand Down Expand Up @@ -8102,6 +8102,23 @@
%label s+l.dob
==
::
++ topics-to-json
|= tos=(list ?(@ux (list @ux)))
^- json
:- %a
=/ ttj
;: cork
(cury render-hex-bytes 32)
prefix-hex
tape:enjs:format
==
%+ turn tos
|= t=?(@ (list @))
?@ t
?: =(0 t) ~
(ttj `@`t)
a+(turn t ttj)
::
:: parsing responses
::
::TODO ++ parse-response |= json ^- response
Expand Down