Skip to content

Commit

Permalink
support alloy errors (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
supernovahs authored Jul 18, 2024
1 parent a8d726f commit 29e17a6
Show file tree
Hide file tree
Showing 12 changed files with 543 additions and 446 deletions.
78 changes: 2 additions & 76 deletions Cargo.lock

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

1 change: 1 addition & 0 deletions crates/chainio/clients/avsregistry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ tracing.workspace = true
alloy-network.workspace = true
alloy-signer.workspace = true
alloy-signer-local.workspace = true
alloy-contract.workspace = true
[lints]
workspace = true

Expand Down
16 changes: 16 additions & 0 deletions crates/chainio/clients/avsregistry/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
use alloy_contract::Error as AlloyError;
use eigen_client_elcontracts::error::ElContractsError;
use thiserror::Error;

/// Error returned by AvsRegistry
Expand Down Expand Up @@ -126,4 +128,18 @@ pub enum AvsRegistryError {
/// Failed to subscribe to logs
#[error("Could not subscribe to logs ")]
SubscribeLogs,

/// Alloy errors
#[error("Alloy contract error: {0}")]
AlloyContractError(#[from] AlloyError),

/// ElContractsError compatibility
#[error("ElContractsError: {0}")]
ElContractsError(String),
}

impl From<ElContractsError> for AvsRegistryError {
fn from(err: ElContractsError) -> Self {
AvsRegistryError::ElContractsError(err.to_string())
}
}
Loading

0 comments on commit 29e17a6

Please sign in to comment.