question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add a "listen for event" function

See original GitHub issue

Overview

This is something I would have liked to see some additional functionality in brownie from.

Specification

Maybe the API looks something like:

from ape import networks

event = networks.listen_for_event(contract_address, event_name, timeout=200)

I made a custom edition of this in my chainlink-mix would be great for ape to have this built-in.

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
unparalleled-jscommented, Aug 10, 2022

OK yeah reading more closely, you are trying to basically have an async type deal that waits for a log and then carries on with something else once it arrives, right?

0reactions
fubuloubucommented, Aug 9, 2022

@fubuloubu How would the query manager help here? These are all new logs coming in and that are not yet entered into an any DB

To get the historicial logs from query manager, and then wait on any new ones stays as it is today

Read more comments on GitHub >

github_iconTop Results From Across the Web

EventTarget.addEventListener() - Web APIs | MDN
The method addEventListener() works by adding a function, or an object that implements EventListener , to the list of event listeners for ...
Read more >
JavaScript HTML DOM EventListener - W3Schools
The addEventListener() method allows you to add event listeners on any HTML DOM object such as HTML elements, the HTML document, the window...
Read more >
How to Add an Event Handler to an Event of the Element in JS
To add an event handler to an event of an element, you use the addEventListener() method of the element object: element.addEventListener(type,eventListener);.
Read more >
How to Use Event Listeners in JavaScript - MakeUseOf
You can listen for events on any element in the DOM. JavaScript has an addEventListener() function that you can call on any element...
Read more >
JavaScript Event Listeners Ultimate Guide
To set up an event listener you just need to have a variable that references an element and then call the addEventListener function...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found