From ce20adcd0bde552eba97d6126e2eee8db42ad18f Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Wed, 10 Jul 2024 10:58:25 +0200 Subject: [PATCH] chore(deps): trim cli-util crate deps (#9410) --- Cargo.lock | 5 +++-- crates/cli/util/Cargo.toml | 20 +++++++++++++------- crates/cli/util/src/load_secret_key.rs | 9 ++++++--- crates/cli/util/src/parsers.rs | 6 +++--- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1494c0d9d..3aecbb1c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6671,11 +6671,12 @@ dependencies = [ name = "reth-cli-util" version = "1.0.1" dependencies = [ + "alloy-eips", + "alloy-primitives", "eyre", "proptest", + "rand 0.8.5", "reth-fs-util", - "reth-network", - "reth-primitives", "secp256k1", "thiserror", ] diff --git a/crates/cli/util/Cargo.toml b/crates/cli/util/Cargo.toml index f38421bc0..4d958cdb9 100644 --- a/crates/cli/util/Cargo.toml +++ b/crates/cli/util/Cargo.toml @@ -6,18 +6,24 @@ rust-version.workspace = true license.workspace = true homepage.workspace = true repository.workspace = true -exclude.workspace = true + +[lints] +workspace = true [dependencies] +# reth reth-fs-util.workspace = true -reth-network.workspace = true -reth-primitives.workspace = true -secp256k1.workspace = true + +# eth +alloy-primitives.workspace = true +alloy-eips.workspace = true + +secp256k1 = { workspace = true, features = ["rand"] } +rand.workspace = true + +# misc thiserror.workspace = true eyre.workspace = true [dev-dependencies] proptest.workspace = true - -[lints] -workspace = true diff --git a/crates/cli/util/src/load_secret_key.rs b/crates/cli/util/src/load_secret_key.rs index a8b401bbb..25da0e066 100644 --- a/crates/cli/util/src/load_secret_key.rs +++ b/crates/cli/util/src/load_secret_key.rs @@ -1,6 +1,4 @@ use reth_fs_util::{self as fs, FsPathError}; -use reth_network::config::rng_secret_key; -use reth_primitives::hex::encode as hex_encode; use secp256k1::{Error as SecretKeyBaseError, SecretKey}; use std::{ io, @@ -8,6 +6,11 @@ use std::{ }; use thiserror::Error; +/// Convenience function to create a new random [`SecretKey`] +pub fn rng_secret_key() -> SecretKey { + SecretKey::new(&mut rand::thread_rng()) +} + /// Errors returned by loading a [`SecretKey`], including IO errors. #[derive(Error, Debug)] pub enum SecretKeyError { @@ -50,7 +53,7 @@ pub fn get_secret_key(secret_key_path: &Path) -> Result eyre::Result