Skip to content

Conversation

@tbenr
Copy link
Contributor

@tbenr tbenr commented Nov 22, 2018

fixes #6601

@ghost
Copy link

ghost commented Nov 22, 2018

Pull Request Checklist

  • Have you updated the documentation, if impacted (e.g. docs.status.im)?

@status-comment-bot
Copy link

#1 CI BUILD SUCCESSFUL in 22 min and counting (cb09646b2cde2d2889c4e9850742965b6336d9b1)

Android(e2e) iOS MacOS AppImage Windows

@tbenr
Copy link
Contributor Author

tbenr commented Nov 22, 2018

@jeluard I ended up supporting topics definition like that: every topic can be:

  • direct topic, given by the extension itself (single value or vector)
    • examples:
      • "0x29f31b934498b0deabbe211b01cc30eee6475abf0f0d553e7eb8ca71deeb24b3"
      • ["0x29f31b934498b0deabbe211b01cc30eee6475abf0f0d553e7eb8ca71deeb24b3" "0xd7d1b6cffe566fcd240948f87999b06b8879e7fbfcf9d29362eda4395c1fa32e"]
  • by eventid and params
    • examples:
      • {:event "Transfer" :params ["address" "address" "uint256"]}
  • by indexed param values
    • examples:
      • {:type "uint256" :values ["125"]}
      • {:type "address" :values ["0x299b18709d4aacbda99048721448f65893a0c73a" "0x94eaa5fa6b313968b2abd6da375ef28077d95d53"]}

putting all together, it is possible to use the new event as follows:

[ethereum/log {:fromBlock "0x4431D0"
               :toBlock "latest"
               :address ["0x2542F9D12B39a8F63C23A1f88948FA75303cBa3A" "0x869CD9C7D178254cD6ACF448737D7Eed2CA7E839"]
               :topics [{:event "Transfer" :params ["address" "address" "uint256"]}
                        {:type "address" :values ["0x299b18709d4aacbda99048721448f65893a0c73a" "0x94eaa5fa6b313968b2abd6da375ef28077d95d53"]}
                        nil
                        {:type "uint256" :values ["0x3fd"]}]                 
               :on-result [put-tbtest]}]

some considerations:

  • the EDN for the event is not deeply checking the different options so it wont be able to verify at "installation time" the correctness of the different topics definition. It is not enforcing the "eventid and params" definition to be used in topic[0] only.
  • for the "eventid and params" topic definition, I just realize it is not possible to use it in a vector of (when you want to search for different event logs in one call). I can implement it.
  • result is taken as it is and sent to the on-success event.

@jeluard
Copy link
Contributor

jeluard commented Nov 22, 2018

@tbenr Wow very nice work!

for the "eventid and params" topic definition, I just realize it is not possible to use it in a vector of (when you want to search for different event logs in one call). I can implement it.

That would be really cool!

Any chance you have some small extension that would demo it's usage?

@tbenr
Copy link
Contributor Author

tbenr commented Nov 22, 2018

@jeluard thanks!

Any chance you have some small extension that would demo it's usage?

I was actually a very basic\non-sense extension to test it. Let me try to clean it up.

That would be really cool!

👍

@jeluard
Copy link
Contributor

jeluard commented Nov 23, 2018

@tbenr When you are done, you might be interested with those issues too :

:)

@tbenr
Copy link
Contributor Author

tbenr commented Nov 23, 2018

@jeluard sure:) already applied for the ENS integration.
btw after rebasing to latest develop commits, i'm facing a bad java exception at runtime when i run the event (the event is executed, by the way)

java.lang.IllegalArgumentException: Don't know how to create ISeq from: com.cognitect.transit.impl.TaggedValueImpl

I have to check what's happening (if you have any hint...)

@jeluard
Copy link
Contributor

jeluard commented Nov 23, 2018

@tbenr Doesn't ring a bell right now. I don't see how it could be related to your PR. Maybe the extension you are using?

@tbenr
Copy link
Contributor Author

tbenr commented Nov 23, 2018

could be... in the weekend i'll figure out and make the final PR.

@jeluard btw the extension is: https://status-im.github.io/pluto/try.html?hash=QmPmydboqsmkuRg5DZZUEM7p4n5XNXtRgwwQc7tTa75fT4

@tbenr tbenr force-pushed the Add-ethereum/log-events branch from cb09646 to 023bd05 Compare November 24, 2018 01:32
@tbenr
Copy link
Contributor Author

tbenr commented Nov 24, 2018

@jeluard a dummy extension containing some usage examples is here:

https://status-im.github.io/pluto/try.html?hash=QmfAWruXYfDzZVD59qWNL8DAxqsmpaFrsDeyd2gxJuuDRt

A grammar for data manipulation

@status-comment-bot
Copy link

#2 CI BUILD SUCCESSFUL in 20 min and counting (023bd05046f5ddd64a1e24c1c31b0032016d5510)

Android(e2e) iOS MacOS AppImage Windows

@jeluard
Copy link
Contributor

jeluard commented Nov 24, 2018

Fantastic job @tbenr ! Can I just ask you to remove the package-lock.json from the commit before I merge?

@jeluard
Copy link
Contributor

jeluard commented Nov 24, 2018

Oh also please rename ethereum.log to ethereum.logs :)

@tbenr tbenr force-pushed the Add-ethereum/log-events branch from 023bd05 to 8cceeeb Compare November 24, 2018 20:43
@tbenr
Copy link
Contributor Author

tbenr commented Nov 24, 2018

@jeluard thanks!

last commit includes:

  • ethereum.log to ethereum.logs renaming
  • removed wrong file :)
  • some tests

this is the updated sample extension: https://status-im.github.io/pluto/try.html?hash=Qmb7opEFGGTrjo6mt5DxjfZUJFLKEDFsTVsfb7LyTv7sxp

A grammar for data manipulation

@status-comment-bot
Copy link

#3 CI BUILD SUCCESSFUL in 22 min and counting (8cceeebe1839c1864ded872879703d0d651b2a9c)

Android(e2e) iOS MacOS AppImage Windows

@jeluard
Copy link
Contributor

jeluard commented Nov 25, 2018

@tbenr Awesome thanks!

Signed-off-by: Julien Eluard <julien.eluard@gmail.com>
@jeluard jeluard force-pushed the Add-ethereum/log-events branch from 8cceeeb to 2d5c4e3 Compare November 25, 2018 20:03
@jeluard jeluard merged commit 2d5c4e3 into status-im:develop Nov 25, 2018
@status-comment-bot
Copy link

#4 CI BUILD SUCCESSFUL in 21 min and counting (2d5c4e3)

Android(e2e) iOS MacOS AppImage Windows

@tbenr tbenr deleted the Add-ethereum/log-events branch November 25, 2018 20:29
@andytudhope
Copy link
Contributor

Hey @tbenr please will you update your Eth address in Gitcoin so that I can pay out this bounty? Currently it will not let me do so.

@tbenr
Copy link
Contributor Author

tbenr commented Nov 26, 2018

@andytudhope it was already in my account, in any case I updated it.

This was referenced Nov 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects
Archived in project

Development

Successfully merging this pull request may close these issues.

Add ethereum/log events

6 participants