From 2ad6bf98059ac7c75c628acba27c3f4e52c9d497 Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 17 Jan 2024 12:13:52 +0100 Subject: [PATCH] chore: replace some from with try_from calls --- crates/cast/bin/cmd/estimate.rs | 2 +- crates/cast/bin/cmd/run.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/cast/bin/cmd/estimate.rs b/crates/cast/bin/cmd/estimate.rs index c3352cab35b8..6089f0153fd7 100644 --- a/crates/cast/bin/cmd/estimate.rs +++ b/crates/cast/bin/cmd/estimate.rs @@ -80,7 +80,7 @@ impl EstimateArgs { let EstimateArgs { from, to, sig, args, value, rpc, etherscan, command } = self; let figment = Figment::from(Config::figment()).merge(etherscan).merge(rpc); - let config = Config::from_provider(figment); + let config = Config::try_from(figment)?; let provider = utils::get_provider(&config)?; let chain = utils::get_chain(config.chain, &provider).await?; diff --git a/crates/cast/bin/cmd/run.rs b/crates/cast/bin/cmd/run.rs index 8f13706e647b..fb7ae35cba07 100644 --- a/crates/cast/bin/cmd/run.rs +++ b/crates/cast/bin/cmd/run.rs @@ -82,7 +82,7 @@ impl RunArgs { let figment = Config::figment_with_root(find_project_root_path(None).unwrap()).merge(self.rpc); let evm_opts = figment.extract::()?; - let mut config = Config::from_provider(figment).sanitized(); + let mut config = Config::try_from(figment)?.sanitized(); let compute_units_per_second = if self.no_rate_limit { Some(u64::MAX) } else { self.compute_units_per_second };