Skip to content

Commit

Permalink
Revert "substitute error generator PoC to zksync-error"
Browse files Browse the repository at this point in the history
This reverts commit 0a54dae.
  • Loading branch information
sayon committed Feb 3, 2025
1 parent fe7f69c commit caf6f7b
Show file tree
Hide file tree
Showing 13 changed files with 1,550 additions and 1,504 deletions.
169 changes: 72 additions & 97 deletions Cargo.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ tracing-subscriber = { version = "0.3", features = [
"local-time",
] }
url = "2.5.4"
zksync-error-description = { git = "https://github.com/matter-labs/zksync-error", branch = "main" }
zksync-error-codegen = { git = "https://github.com/matter-labs/zksync-error", branch = "main", package = "zksync-error-codegen" }
zksync-error-description = { git = "https://github.com/sayon/error-codegen-poc", branch = "main" }
zksync-error-codegen = { git = "https://github.com/sayon/error-codegen-poc", branch = "main", package = "zksync-error-codegen" }
strum = "0.26.3"
strum_macros = "0.26.4"

Expand Down
6 changes: 3 additions & 3 deletions crates/zksync_error/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ edition = "2021"
[dependencies]
lazy_static = "1.5.0"
serde = { version = "1.0.210", features = [ "derive", "rc" ] }
serde_json = "1.0.128"
serde_json = { version = "1.0.128" }
strum = "0.26.3"
strum_macros = "0.26.4"
zksync-error-description = { git = "https://github.com/matter-labs/zksync-error", branch = "main"}
anyhow = "1.0"
zksync-error-description = { git = "https://github.com/sayon/error-codegen-poc", branch = "main"}

15 changes: 11 additions & 4 deletions crates/zksync_error/src/documentation.rs
Original file line number Diff line number Diff line change
@@ -1,28 +1,35 @@

Check warning on line 1 in crates/zksync_error/src/documentation.rs

View workflow job for this annotation

GitHub Actions / lint

Diff in /home/runner/work/anvil-zksync/anvil-zksync/crates/zksync_error/src/documentation.rs
//!
//! AUTOGENERATED BASED ON A SET OF JSON FILES, DO NOT EDIT MANUALLY
//!
use lazy_static::lazy_static;
use zksync_error_description::ErrorHierarchy;

Check warning on line 7 in crates/zksync_error/src/documentation.rs

View workflow job for this annotation

GitHub Actions / lint

Diff in /home/runner/work/anvil-zksync/anvil-zksync/crates/zksync_error/src/documentation.rs

lazy_static! {
pub static ref model: ErrorHierarchy = get_model();
pub static ref model : ErrorHierarchy = get_model();
}


fn get_model() -> ErrorHierarchy {
zksync_error_description::ErrorHierarchy::from_str(include_str!(
"../resources/error-model-dump.json"
))
zksync_error_description::ErrorHierarchy::from_str(include_str!("../resources/error-model-dump.json"))
}

#[derive(Debug)]
pub enum DocumentationError {

Check warning on line 19 in crates/zksync_error/src/documentation.rs

View workflow job for this annotation

GitHub Actions / lint

Diff in /home/runner/work/anvil-zksync/anvil-zksync/crates/zksync_error/src/documentation.rs
IncompleteModel(String),

}

impl std::fmt::Display for DocumentationError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_fmt(format_args!("{self:#?}"))
}
}
impl std::error::Error for DocumentationError {}

pub trait Documented {
type Documentation;

Check warning on line 32 in crates/zksync_error/src/documentation.rs

View workflow job for this annotation

GitHub Actions / lint

Diff in /home/runner/work/anvil-zksync/anvil-zksync/crates/zksync_error/src/documentation.rs
fn get_documentation(&self) -> Result<Option<Self::Documentation>, DocumentationError>;
}

Loading

0 comments on commit caf6f7b

Please sign in to comment.