Skip to content

Commit

Permalink
refactor: remove etherscan identifier (#628)
Browse files Browse the repository at this point in the history
  • Loading branch information
agostbiro authored Aug 28, 2024
1 parent ea913d1 commit 0748836
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 299 deletions.
2 changes: 0 additions & 2 deletions Cargo.lock

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

2 changes: 0 additions & 2 deletions crates/foundry/evm/traces/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ version.workspace = true
edition.workspace = true

[dependencies]
foundry-block-explorers.workspace = true
foundry-common.workspace = true
foundry-config.workspace = true
foundry-evm-core.workspace = true

alloy-dyn-abi = { workspace = true, features = ["arbitrary", "eip712"] }
Expand Down
275 changes: 0 additions & 275 deletions crates/foundry/evm/traces/src/identifier/etherscan.rs

This file was deleted.

22 changes: 2 additions & 20 deletions crates/foundry/evm/traces/src/identifier/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,10 @@ use std::borrow::Cow;
use alloy_json_abi::JsonAbi;
use alloy_primitives::Address;
use foundry_common::{ArtifactId, ContractsByArtifact};
use foundry_config::{Chain, Config};

mod local;
pub use local::LocalTraceIdentifier;

mod etherscan;
pub use etherscan::EtherscanIdentifier;

mod signatures;
pub use signatures::{SignaturesIdentifier, SingleSignaturesIdentifier};

Expand Down Expand Up @@ -43,8 +39,6 @@ pub trait TraceIdentifier {
pub struct TraceIdentifiers<'a> {
/// The local trace identifier.
pub local: Option<LocalTraceIdentifier<'a>>,
/// The optional Etherscan trace identifier.
pub etherscan: Option<EtherscanIdentifier>,
}

impl Default for TraceIdentifiers<'_> {
Expand All @@ -62,20 +56,14 @@ impl TraceIdentifier for TraceIdentifiers<'_> {
if let Some(local) = &mut self.local {
identities.extend(local.identify_addresses(addresses.clone()));
}
if let Some(etherscan) = &mut self.etherscan {
identities.extend(etherscan.identify_addresses(addresses));
}
identities
}
}

impl<'a> TraceIdentifiers<'a> {
/// Creates a new, empty instance.
pub const fn new() -> Self {
Self {
local: None,
etherscan: None,
}
Self { local: None }
}

/// Sets the local identifier.
Expand All @@ -84,14 +72,8 @@ impl<'a> TraceIdentifiers<'a> {
self
}

/// Sets the etherscan identifier.
pub fn with_etherscan(mut self, config: &Config, chain: Option<Chain>) -> eyre::Result<Self> {
self.etherscan = EtherscanIdentifier::new(config, chain)?;
Ok(self)
}

/// Returns `true` if there are no set identifiers.
pub fn is_empty(&self) -> bool {
self.local.is_none() && self.etherscan.is_none()
self.local.is_none()
}
}

0 comments on commit 0748836

Please sign in to comment.