Skip to content

Commit

Permalink
fix: ensure world address is always present to filter events
Browse files Browse the repository at this point in the history
  • Loading branch information
glihm committed Mar 13, 2024
1 parent dc165cf commit 440cbb6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/sozo/src/ops/events.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pub async fn execute(
let chain_id = provider.chain_id().await?;
let chain_id =
parse_cairo_short_string(&chain_id).with_context(|| "Cannot parse chain_id as string")?;
let world_address = world.address(env_metadata.as_ref())?;

Check warning on line 38 in bin/sozo/src/ops/events.rs

View check run for this annotation

Codecov / codecov/patch

bin/sozo/src/ops/events.rs#L38

Added line #L38 was not covered by tests

let events_map = if !json {
let deployed_manifest = manifest_dir
Expand All @@ -60,7 +61,7 @@ pub async fn execute(
events.map(|e| vec![e.iter().map(|event| starknet_keccak(event.as_bytes())).collect()]);

let provider = starknet.provider(env_metadata.as_ref())?;
let event_filter = EventFilter { from_block, to_block, address: world.world_address, keys };
let event_filter = EventFilter { from_block, to_block, address: Some(world_address), keys };

Check warning on line 64 in bin/sozo/src/ops/events.rs

View check run for this annotation

Codecov / codecov/patch

bin/sozo/src/ops/events.rs#L64

Added line #L64 was not covered by tests

let res = provider.get_events(event_filter, continuation_token, chunk_size).await?;

Expand Down

0 comments on commit 440cbb6

Please sign in to comment.