feat(cast): subscribe to logs using websockets#5743
feat(cast): subscribe to logs using websockets#5743Evalir merged 4 commits intofoundry-rs:masterfrom
Conversation
|
hey @bernard-wagner just merged #5571 — should be good to continue |
83e6f12 to
13ee448
Compare
|
@Evalir open question: Should this be a separate command or should it use a |
|
hmm i think |
Evalir
left a comment
There was a problem hiding this comment.
will give a more thorough review later!
crates/cast/src/filters.rs
Outdated
| use foundry_common::abi::{get_event, parse_tokens}; | ||
| use itertools::Itertools; | ||
|
|
||
| /// First tries to parse the `sig_or_topic` as an event signature. If successful, `topics_or_args` |
There was a problem hiding this comment.
do these docs go here? unsure if they correspond to build_filter
c3394ca to
1bb5bde
Compare
1bb5bde to
97cc692
Compare
|
@Evalir apologies for all the force pushes. Moved to |
82ec012 to
97cc692
Compare
Evalir
left a comment
There was a problem hiding this comment.
lgtm bar failing tests—will rerun them as they seem like spurious network failures
* feat(cast): subscribe to logs * undo generic signal * fix tokio signal feature --------- Co-authored-by: Enrique Ortiz <hi@enriqueortiz.dev>
Follows on #5571
Motivation
It is useful to monitor for events emitted.
Solution
Introduces:
cast subscribeBuilding on the introduction of websockets, allow subscribing to events using the same syntax as
cast logs.Some additional changes
to_jsonlogic to support streaming.Moved filter logic from
logs.rstofilters.rsto enable reuse.If
--to-blockis specified, subscribe tonewHeadsand exits loop when target block has been reached.