Skip to content

Commit

Permalink
chore(l2): forbid unwrap (#1290)
Browse files Browse the repository at this point in the history
**Motivation**

Remove all the unwraps from the l2 module

**Description**

- Add `"unwrap_used = "deny"` to all `cargo.toml` files
- Add `allow-unwrap-in-tests = true` to `clippy.toml`
- Add new error types or use existing ones when possible.
- Remove all unwraps, change functions to return `Result<T, E>`, panic
and log when errors are unrecovereable

<!-- Link to issues: Resolves #111, Resolves #222 -->

Closes #1266

---------

Co-authored-by: Leandro Serra <[email protected]>
Co-authored-by: Federico Borello <[email protected]>
  • Loading branch information
3 people authored Nov 27, 2024
1 parent bd97355 commit 745823b
Show file tree
Hide file tree
Showing 16 changed files with 215 additions and 95 deletions.
3 changes: 3 additions & 0 deletions crates/l2/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ rand = "0.8.5"

[lib]
path = "./l2.rs"

[lints.clippy]
unwrap_used = "deny"
1 change: 1 addition & 0 deletions crates/l2/Clippy.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
allow-unwrap-in-tests = true
4 changes: 4 additions & 0 deletions crates/l2/contracts/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ spinoff = "0.8.0"
colored = "2.1.0"
lazy_static = "1.5.0"
tracing.workspace = true
thiserror.workspace = true

ethrex-l2 = { path = "../../l2" }
ethrex-core = { path = "../../common" }

[[bin]]
name = "ethrex_l2_l1_deployer"
path = "./deployer.rs"

[lints.clippy]
unwrap_used = "deny"
Loading

0 comments on commit 745823b

Please sign in to comment.