Skip to content

Commit

Permalink
Refreshing casper-node dependency, refactoring tests for 'chain_get_e…
Browse files Browse the repository at this point in the history
…ra_info_by_switch_block'
  • Loading branch information
zajko committed Jan 22, 2025
1 parent 3b8c1fb commit c2f3d2e
Show file tree
Hide file tree
Showing 10 changed files with 253 additions and 112 deletions.
100 changes: 50 additions & 50 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ members = [
anyhow = "1"
async-stream = "0.3.4"
async-trait = "0.1.77"
casper-types = { git = "https://github.com/casper-network/casper-node.git", branch = "release-2.0.0-rc6", features = ["json-schema"]}
casper-binary-port = { git = "https://github.com/casper-network/casper-node.git", branch = "release-2.0.0-rc6" }
casper-types = { git = "https://github.com/casper-network/casper-node.git", branch = "dev", features = ["json-schema"]}
casper-binary-port = { git = "https://github.com/casper-network/casper-node.git", branch = "dev" }
casper-event-sidecar = { path = "./event_sidecar", version = "1.0.0" }
casper-event-types = { path = "./types", version = "1.0.0" }
casper-rpc-sidecar = { path = "./rpc_sidecar", version = "1.0.0" }
Expand Down
10 changes: 4 additions & 6 deletions event_sidecar/src/event_stream_server/sse_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,7 @@ fn parse_url_props(
Some(filter) => filter,
None => return Err(create_404(enable_legacy_filters)),
};
let start_from = match parse_query(query) {
Ok(maybe_id) => maybe_id,
Err(error_response) => return Err(error_response),
};
let start_from = parse_query(query)?;
Ok((event_filter, stream_filter, start_from, is_legacy_filter))
}

Expand Down Expand Up @@ -949,6 +946,9 @@ mod tests {
))
.collect();

let ends_with_id = Regex::new(r"\nid:\d*$").unwrap();
let starts_with_data = Regex::new(r"^data:").unwrap();

// Run three cases; where only a single event is duplicated, where five are duplicated, and
// where the whole initial stream (except the `ApiVersion`) is duplicated.
for duplicate_count in &[1, 5, NUM_INITIAL_EVENTS] {
Expand Down Expand Up @@ -1016,8 +1016,6 @@ mod tests {
let expected_data = deduplicated_event.data.clone().unwrap();
let mut received_event_str = received_event.to_string().trim().to_string();

let ends_with_id = Regex::new(r"\nid:\d*$").unwrap();
let starts_with_data = Regex::new(r"^data:").unwrap();
if let Some(id) = deduplicated_event.id {
assert!(received_event_str.ends_with(format!("\nid:{}", id).as_str()));
} else {
Expand Down
Loading

0 comments on commit c2f3d2e

Please sign in to comment.