From 8891ed38b4be6e77189fd189eb754f2498c5b8d7 Mon Sep 17 00:00:00 2001 From: Georgios Konstantopoulos Date: Sat, 21 Aug 2021 15:34:21 +0300 Subject: [PATCH] chore: pull ethers to top level directory (#398) * chore: pull up ethers to top level directory * chore: enable ws feature when running examples * chore: fix paths * chore: enable ipc feature when running examples --- Cargo.toml | 81 +++++++++++++++++-- ethers-contract/Cargo.toml | 2 +- ethers-core/Cargo.toml | 2 +- ethers-middleware/Cargo.toml | 2 +- ethers-providers/Cargo.toml | 2 +- ethers-signers/Cargo.toml | 2 +- ethers/Cargo.toml | 66 --------------- {ethers/examples => examples}/abigen.rs | 0 {ethers/examples => examples}/contract.sol | 0 .../examples => examples}/contract_abi.json | 0 .../contract_human_readable.rs | 2 +- .../contract_with_abi.rs | 4 +- .../contract_with_abi_and_structs.rs | 0 {ethers/examples => examples}/ens.rs | 0 {ethers/examples => examples}/ipc.rs | 0 {ethers/examples => examples}/ledger.rs | 0 {ethers/examples => examples}/local_signer.rs | 0 {ethers/examples => examples}/mnemonic.rs | 0 {ethers/examples => examples}/sign.rs | 0 {ethers/examples => examples}/transfer_eth.rs | 0 {ethers/examples => examples}/watch_blocks.rs | 0 {ethers/examples => examples}/yubi.rs | 0 {ethers/src => src}/lib.rs | 2 +- {ethers/tests => tests}/major_contracts.rs | 0 24 files changed, 83 insertions(+), 82 deletions(-) delete mode 100644 ethers/Cargo.toml rename {ethers/examples => examples}/abigen.rs (100%) rename {ethers/examples => examples}/contract.sol (100%) rename {ethers/examples => examples}/contract_abi.json (100%) rename {ethers/examples => examples}/contract_human_readable.rs (97%) rename {ethers/examples => examples}/contract_with_abi.rs (95%) rename {ethers/examples => examples}/contract_with_abi_and_structs.rs (100%) rename {ethers/examples => examples}/ens.rs (100%) rename {ethers/examples => examples}/ipc.rs (100%) rename {ethers/examples => examples}/ledger.rs (100%) rename {ethers/examples => examples}/local_signer.rs (100%) rename {ethers/examples => examples}/mnemonic.rs (100%) rename {ethers/examples => examples}/sign.rs (100%) rename {ethers/examples => examples}/transfer_eth.rs (100%) rename {ethers/examples => examples}/watch_blocks.rs (100%) rename {ethers/examples => examples}/yubi.rs (100%) rename {ethers/src => src}/lib.rs (98%) rename {ethers/tests => tests}/major_contracts.rs (100%) diff --git a/Cargo.toml b/Cargo.toml index c4a9afbd..f923b5e5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,10 +1,77 @@ -[workspace] +[package] +name = "ethers" +version = "0.4.1" +authors = ["Georgios Konstantopoulos "] +license = "MIT OR Apache-2.0" +edition = "2018" +readme = "../README.md" +documentation = "https://docs.rs/ethers" +repository = "https://github.com/gakonst/ethers-rs" +homepage = "https://docs.rs/ethers" +description = """ +Complete Ethereum library and wallet implementation in Rust. +""" +[workspace] members = [ - "./ethers", - "./ethers-contract", - "./ethers-providers", - "./ethers-signers", - "./ethers-core", - "./ethers-middleware", + "ethers-contract", + "ethers-providers", + "ethers-signers", + "ethers-core", + "ethers-middleware", ] + + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] + +[package.metadata.playground] +features = ["full"] + +[features] +celo = [ + "ethers-core/celo", + "ethers-providers/celo", + "ethers-signers/celo", + "ethers-contract/celo", + "ethers-middleware/celo", + "legacy" +] + +legacy = [ + "ethers-core/legacy", + "ethers-contract/legacy" +] + +# individual features per sub-crate +## core +setup = ["ethers-core/setup"] +## providers +ws = ["ethers-providers/ws"] +ipc = ["ethers-providers/ipc"] +rustls = ["ethers-providers/rustls"] +openssl = ["ethers-providers/openssl"] +## signers +ledger = ["ethers-signers/ledger"] +yubi = ["ethers-signers/yubi"] +## contracts +abigen = ["ethers-contract/abigen"] + + +[dependencies] +ethers-contract = { version = "0.4.7", default-features = false, path = "./ethers-contract" } +ethers-core = { version = "0.4.8", default-features = false, path = "./ethers-core", features = ["setup"] } +ethers-providers = { version = "0.4.6", default-features = false, path = "./ethers-providers" } +ethers-signers = { version = "0.4.6", default-features = false, path = "./ethers-signers" } +ethers-middleware = { version = "0.4.8", default-features = false, path = "./ethers-middleware" } + +[dev-dependencies] +ethers-contract = { version = "0.4.7", default-features = false, path = "./ethers-contract", features = ["abigen"] } +ethers-providers = { version = "0.4.6", default-features = false, path = "./ethers-providers", features = ["ws", "ipc"] } + +anyhow = "1.0.39" +rand = "0.8.4" +serde = { version = "1.0.124", features = ["derive"] } +serde_json = "1.0.64" +tokio = { version = "1.5", features = ["macros", "rt-multi-thread"] } diff --git a/ethers-contract/Cargo.toml b/ethers-contract/Cargo.toml index 74139ad6..5f0b550d 100644 --- a/ethers-contract/Cargo.toml +++ b/ethers-contract/Cargo.toml @@ -24,7 +24,7 @@ futures-util = { version = "0.3.16" } hex = { version = "0.4.3", default-features = false, features = ["std"] } [dev-dependencies] -ethers = { version = "0.4.0", path = "../ethers" } +ethers = { version = "0.4.0", path = ".." } ethers-providers = { version = "0.4.6", path = "../ethers-providers", default-features = false, features = ["ws"] } ethers-signers = { version = "0.4.6", path = "../ethers-signers" } ethers-middleware = { version = "0.4.8", path = "../ethers-middleware" } diff --git a/ethers-core/Cargo.toml b/ethers-core/Cargo.toml index c92eacf7..679e6c1b 100644 --- a/ethers-core/Cargo.toml +++ b/ethers-core/Cargo.toml @@ -36,7 +36,7 @@ tokio = { version = "1.5", default-features = false, optional = true} futures-util = { version = "0.3.16", optional = true } [dev-dependencies] -ethers = { version = "0.4.0", path = "../ethers" } +ethers = { version = "0.4.0", path = ".." } serde_json = { version = "1.0.64", default-features = false } bincode = { version = "1.3.3", default-features = false } diff --git a/ethers-middleware/Cargo.toml b/ethers-middleware/Cargo.toml index bb87f608..bc6f363f 100644 --- a/ethers-middleware/Cargo.toml +++ b/ethers-middleware/Cargo.toml @@ -35,7 +35,7 @@ serde_json = { version = "1.0.64", default-features = false } tokio = { version = "1.5" } [dev-dependencies] -ethers = { version = "0.4.0", path = "../ethers" } +ethers = { version = "0.4.0", path = ".." } hex = { version = "0.4.3", default-features = false, features = ["std"] } rand = { version = "0.8.4", default-features = false } tokio = { version = "1.5", default-features = false, features = ["rt", "macros", "time"] } diff --git a/ethers-providers/Cargo.toml b/ethers-providers/Cargo.toml index dcb678e4..5497b121 100644 --- a/ethers-providers/Cargo.toml +++ b/ethers-providers/Cargo.toml @@ -43,7 +43,7 @@ tokio-util = { version = "0.6.7", default-features = false, features = ["io"], o bytes = { version = "1.0.1", default-features = false, optional = true } [dev-dependencies] -ethers = { version = "0.4.0", path = "../ethers" } +ethers = { version = "0.4.0", path = ".." } tokio = { version = "1.5", default-features = false, features = ["rt", "macros"] } tempfile = "3.2.0" diff --git a/ethers-signers/Cargo.toml b/ethers-signers/Cargo.toml index 9a8a5838..ccc82497 100644 --- a/ethers-signers/Cargo.toml +++ b/ethers-signers/Cargo.toml @@ -37,7 +37,7 @@ tracing-futures = { version = "0.2.5", optional = true } spki = { version = "0.4.0", optional = true } [dev-dependencies] -ethers = { version = "0.4.0", path = "../ethers" } +ethers = { version = "0.4.0", path = ".." } yubihsm = { version = "0.39.0", features = ["secp256k1", "usb", "mockhsm"] } tempfile = "3.2.0" diff --git a/ethers/Cargo.toml b/ethers/Cargo.toml deleted file mode 100644 index a001271f..00000000 --- a/ethers/Cargo.toml +++ /dev/null @@ -1,66 +0,0 @@ -[package] -name = "ethers" -version = "0.4.1" -authors = ["Georgios Konstantopoulos "] -license = "MIT OR Apache-2.0" -edition = "2018" -readme = "../README.md" -documentation = "https://docs.rs/ethers" -repository = "https://github.com/gakonst/ethers-rs" -homepage = "https://docs.rs/ethers" -description = """ -Complete Ethereum library and wallet implementation in Rust. -""" - -[package.metadata.docs.rs] -all-features = true -rustdoc-args = ["--cfg", "docsrs"] - -[package.metadata.playground] -features = ["full"] - -[features] -celo = [ - "ethers-core/celo", - "ethers-providers/celo", - "ethers-signers/celo", - "ethers-contract/celo", - "ethers-middleware/celo", - "legacy" -] - -legacy = [ - "ethers-core/legacy", - "ethers-contract/legacy" -] - -# individual features per sub-crate -## core -setup = ["ethers-core/setup"] -## providers -ws = ["ethers-providers/ws"] -ipc = ["ethers-providers/ipc"] -rustls = ["ethers-providers/rustls"] -openssl = ["ethers-providers/openssl"] -## signers -ledger = ["ethers-signers/ledger"] -yubi = ["ethers-signers/yubi"] -## contracts -abigen = ["ethers-contract/abigen"] - - -[dependencies] -ethers-contract = { version = "0.4.7", default-features = false, path = "../ethers-contract" } -ethers-core = { version = "0.4.8", default-features = false, path = "../ethers-core", features = ["setup"] } -ethers-providers = { version = "0.4.6", default-features = false, path = "../ethers-providers" } -ethers-signers = { version = "0.4.6", default-features = false, path = "../ethers-signers" } -ethers-middleware = { version = "0.4.8", default-features = false, path = "../ethers-middleware" } - -[dev-dependencies] -ethers-contract = { version = "0.4.7", default-features = false, path = "../ethers-contract", features = ["abigen"] } - -anyhow = "1.0.39" -rand = "0.8.4" -serde = { version = "1.0.124", features = ["derive"] } -serde_json = "1.0.64" -tokio = { version = "1.5", features = ["macros", "rt-multi-thread"] } diff --git a/ethers/examples/abigen.rs b/examples/abigen.rs similarity index 100% rename from ethers/examples/abigen.rs rename to examples/abigen.rs diff --git a/ethers/examples/contract.sol b/examples/contract.sol similarity index 100% rename from ethers/examples/contract.sol rename to examples/contract.sol diff --git a/ethers/examples/contract_abi.json b/examples/contract_abi.json similarity index 100% rename from ethers/examples/contract_abi.json rename to examples/contract_abi.json diff --git a/ethers/examples/contract_human_readable.rs b/examples/contract_human_readable.rs similarity index 97% rename from ethers/examples/contract_human_readable.rs rename to examples/contract_human_readable.rs index 7c6f43cc..fe519895 100644 --- a/ethers/examples/contract_human_readable.rs +++ b/examples/contract_human_readable.rs @@ -19,7 +19,7 @@ abigen!( #[tokio::main] async fn main() -> Result<()> { - // 1. compile the contract (note this requires that you are inside the `ethers/examples` directory) and launch ganache + // 1. compile the contract (note this requires that you are inside the `examples` directory) and launch ganache let (compiled, ganache) = compile_and_launch_ganache(Solc::new("**/contract.sol"), Ganache::new()).await?; let contract = compiled diff --git a/ethers/examples/contract_with_abi.rs b/examples/contract_with_abi.rs similarity index 95% rename from ethers/examples/contract_with_abi.rs rename to examples/contract_with_abi.rs index d02e219c..fa314e48 100644 --- a/ethers/examples/contract_with_abi.rs +++ b/examples/contract_with_abi.rs @@ -9,13 +9,13 @@ use std::{convert::TryFrom, sync::Arc, time::Duration}; // definition in human readable format abigen!( SimpleContract, - "./ethers/examples/contract_abi.json", + "./examples/contract_abi.json", event_derives(serde::Deserialize, serde::Serialize) ); #[tokio::main] async fn main() -> Result<()> { - // 1. compile the contract (note this requires that you are inside the `ethers/examples` directory) and launch ganache + // 1. compile the contract (note this requires that you are inside the `examples` directory) and launch ganache let (compiled, ganache) = compile_and_launch_ganache(Solc::new("**/contract.sol"), Ganache::new()).await?; diff --git a/ethers/examples/contract_with_abi_and_structs.rs b/examples/contract_with_abi_and_structs.rs similarity index 100% rename from ethers/examples/contract_with_abi_and_structs.rs rename to examples/contract_with_abi_and_structs.rs diff --git a/ethers/examples/ens.rs b/examples/ens.rs similarity index 100% rename from ethers/examples/ens.rs rename to examples/ens.rs diff --git a/ethers/examples/ipc.rs b/examples/ipc.rs similarity index 100% rename from ethers/examples/ipc.rs rename to examples/ipc.rs diff --git a/ethers/examples/ledger.rs b/examples/ledger.rs similarity index 100% rename from ethers/examples/ledger.rs rename to examples/ledger.rs diff --git a/ethers/examples/local_signer.rs b/examples/local_signer.rs similarity index 100% rename from ethers/examples/local_signer.rs rename to examples/local_signer.rs diff --git a/ethers/examples/mnemonic.rs b/examples/mnemonic.rs similarity index 100% rename from ethers/examples/mnemonic.rs rename to examples/mnemonic.rs diff --git a/ethers/examples/sign.rs b/examples/sign.rs similarity index 100% rename from ethers/examples/sign.rs rename to examples/sign.rs diff --git a/ethers/examples/transfer_eth.rs b/examples/transfer_eth.rs similarity index 100% rename from ethers/examples/transfer_eth.rs rename to examples/transfer_eth.rs diff --git a/ethers/examples/watch_blocks.rs b/examples/watch_blocks.rs similarity index 100% rename from ethers/examples/watch_blocks.rs rename to examples/watch_blocks.rs diff --git a/ethers/examples/yubi.rs b/examples/yubi.rs similarity index 100% rename from ethers/examples/yubi.rs rename to examples/yubi.rs diff --git a/ethers/src/lib.rs b/src/lib.rs similarity index 98% rename from ethers/src/lib.rs rename to src/lib.rs index 3bc18299..1c28b5b6 100644 --- a/ethers/src/lib.rs +++ b/src/lib.rs @@ -25,7 +25,7 @@ //! ``` //! //! Examples on how you can use the types imported by the prelude can be found in -//! the [`examples` directory of the repository](https://github.com/gakonst/ethers-rs/tree/master/ethers/examples) +//! the [`examples` directory of the repository](https://github.com/gakonst/ethers-rs/tree/master/examples) //! and in the `tests/` directories of each crate. //! //! # Quick explanation of each module in ascending order of abstraction diff --git a/ethers/tests/major_contracts.rs b/tests/major_contracts.rs similarity index 100% rename from ethers/tests/major_contracts.rs rename to tests/major_contracts.rs