diff --git a/lib/ethereum.hoon b/lib/ethereum.hoon index 75e1838d9..e2ba0fcee 100644 --- a/lib/ethereum.hoon +++ b/lib/ethereum.hoon @@ -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) diff --git a/sur/ethereum.hoon b/sur/ethereum.hoon index eed89da96..35fcd4029 100644 --- a/sur/ethereum.hoon +++ b/sur/ethereum.hoon @@ -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