Skip to content

Commit

Permalink
Merge pull request #358 from yoshidan/remove_ethers
Browse files Browse the repository at this point in the history
Remove deprecated ethers crate
  • Loading branch information
yoshidan authored Mar 7, 2025
2 parents 3a56292 + ad4a5db commit 8d3e6db
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 336 deletions.
4 changes: 0 additions & 4 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ yanked = "warn"
# A list of advisory IDs to ignore. Note that ignored advisories will still
# output a note when they are encountered.
ignore = [
# TODO remove deprecated ehters crate
"RUSTSEC-2024-0384",
"RUSTSEC-2025-0009"
]
# Threshold for security vulnerabilities, any vulnerability with a CVSS score
# lower than the range specified will be ignored. Note that ignored advisories
Expand Down Expand Up @@ -184,7 +181,6 @@ skip-tree = [
{ name = "regex-automata" },
{ name = "windows-sys" },
{ name = "reqwest" },
{ name = "ethers"},
{ name = "tonic"},
]

Expand Down
13 changes: 1 addition & 12 deletions kms/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "gcloud-kms"
version = "1.0.0"
version = "1.1.0"
edition = "2021"
authors = ["yoshidan <[email protected]>"]
repository = "https://github.com/yoshidan/google-cloud-rust/tree/main/kms"
Expand All @@ -19,23 +19,13 @@ google-cloud-auth = { package = "gcloud-auth", optional = true, version = "1.0.0
google-cloud-googleapis = { package = "gcloud-googleapis", version="1.0.0", path = "../googleapis", features=["kms"]}
google-cloud-gax = { package = "gcloud-gax", version = "1.0.0", path = "../foundation/gax"}
tracing = "0.1"
thiserror = "1.0"
prost-types = "0.13"

# ethereum
ethers-core = { version = "2.0", optional = true}
ethers-signers = { version = "2.0", optional = true}
async-trait = { version = "0.1", optional = true }
k256 = { version = "0.13", features = ["pem"], optional = true}

[dev-dependencies]
tokio = { version="1.32", features=["rt-multi-thread"] }
serial_test = "3.1"
tracing-subscriber = { version="0.3.17", features=["env-filter"]}
ctor = "0.1"
google-cloud-auth = { package = "gcloud-auth", path = "../foundation/auth", default-features=false }
hex-literal = "0.4"
ethers = "2.0"

[features]
default = ["default-tls", "auth"]
Expand All @@ -44,4 +34,3 @@ rustls-tls = ["google-cloud-auth?/rustls-tls"]
trace = []
auth = ["google-cloud-auth"]
external-account = ["google-cloud-auth?/external-account"]
eth = ["ethers-core", "ethers-signers", "async-trait", "k256"]
36 changes: 0 additions & 36 deletions kms/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,41 +113,5 @@
//!}
//!```
//!
//! ### Ethereum Integration
//!
//! Enable 'eth' feature.
//! google-cloud-kms = { version="version", features=["eth"] }
//!
//! ```
//! use ethers::prelude::SignerMiddleware;
//! use ethers::providers::{Http, Middleware, Provider};
//! use ethers_core::types::{TransactionReceipt, TransactionRequest};
//! use ethers_signers::Signer as EthSigner;
//! use google_cloud_kms::client::Client;
//! use google_cloud_kms::signer::ethereum::{Error, Signer};
//!
//! pub async fn send_bnb(client: Client, key_name: &str, rpc_node: &str) {
//!
//! // BSC testnet
//! let chain_id = 97;
//!
//! let signer = Signer::new(client, key_name, chain_id, None).await.unwrap();
//! let provider = Provider::<Http>::try_from(rpc_node).unwrap();
//! let signer_address = signer.address();
//!
//! let eth_client = SignerMiddleware::new_with_provider_chain(provider, signer).await.unwrap();
//!
//! let tx = TransactionRequest::new()
//! .to(signer_address)
//! .value(100_000_000_000_000_u128)
//! .gas(1_500_000_u64)
//! .gas_price(4_000_000_000_u64)
//! .chain_id(chain_id);
//!
//! let res = eth_client.send_transaction(tx, None).await.unwrap();
//! let receipt: TransactionReceipt = res.confirmations(3).await.unwrap().unwrap();
//! }
//! ```
pub mod client;
pub mod grpc;
pub mod signer;
279 changes: 0 additions & 279 deletions kms/src/signer/ethereum.rs

This file was deleted.

2 changes: 0 additions & 2 deletions kms/src/signer/mod.rs

This file was deleted.

4 changes: 1 addition & 3 deletions storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "MIT"
name = "gcloud-storage"
readme = "README.md"
repository = "https://github.com/yoshidan/google-cloud-rust/tree/main/storage"
version = "1.0.0"
version = "1.0.1"

[lib]
doctest = false
Expand Down Expand Up @@ -52,8 +52,6 @@ google-cloud-metadata = {package = "gcloud-metadata", optional = true, version =
[dev-dependencies]
ctor = "0.1.26"
google-cloud-auth = { package = "gcloud-auth", path = "../foundation/auth", default-features = false}
reqwest-retry = "0.7.0"
retry-policies = "0.4.0"
serial_test = "3.1"
tokio = {version = "1.32", features = ["rt-multi-thread"]}
tracing-subscriber = {version = "0.3.17", features = ["env-filter"]}
Expand Down

0 comments on commit 8d3e6db

Please sign in to comment.