Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Panic handling #34

Merged
merged 3 commits into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ bollard = { version = "0.17.1" }
futures = "0.3"
hex = { version = "0.4.3", default-features = false, features = ["serde"] }
jsonrpsee = { version = "0.24.2", features = ["http-client", "ws-client"] }
log-panics = { version = "2", features = ["with-backtrace"] }
rand = "0.8"
serde = { version = "1.0.192", default-features = false, features = ["alloc", "derive"] }
serde_json = { version = "1.0", default-features = false }
Expand Down
4 changes: 1 addition & 3 deletions src/framework.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl TestFramework {
}

pub async fn init_nodes(&mut self) -> Result<()> {
// Use first node config for now, as we expect citrea nodes to interact only with this main node for now.
// Use first node config for now, as citrea nodes are expected to interact only with this main node for now.
// Additional bitcoin node are solely used for simulating a bitcoin network and tx propagation/re-orgs
let bitcoin_config = &self.ctx.config.bitcoin[0];

Expand Down Expand Up @@ -525,7 +525,5 @@ fn setup_logging() {
.with(env_filter)
.try_init();
}

log_panics::init();
});
}
7 changes: 1 addition & 6 deletions src/test_case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,7 @@ impl<T: TestCase> TestCaseRunner<T> {
match result {
Ok(Ok(())) => Ok(()),
Ok(Err(e)) => Err(e),
Err(panic_error) => {
let panic_msg = panic_error
.downcast_ref::<String>()
.map_or_else(|| "Unknown panic".to_string(), ToString::to_string);
bail!(panic_msg)
}
Err(panic_error) => panic::resume_unwind(panic_error),
}
}

Expand Down
Loading