Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

chore: make ethers-solc optional #1463

Merged
merged 4 commits into from
Jul 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@

### Unreleased

- Make `ethers-solc` optional dependency of `ethers`, needs `ethers-solc` feature to activate
[#1463](https://github.com/gakonst/ethers-rs/pull/1463)
- Add `rawMetadata:String` field to configurable contract output
[#1365](https://github.com/gakonst/ethers-rs/pull/1365)
- Use relative source paths and `solc --base-path`
Expand Down
19 changes: 13 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,9 @@ abigen = ["ethers-contract/abigen"]
### abigen without reqwest
abigen-offline = ["ethers-contract/abigen-offline"]
## solc
solc-async = ["ethers-solc/async"]
solc-full = ["ethers-solc/full"]
solc-tests = ["ethers-solc/tests"]
solc-sha2-asm = ["ethers-solc/asm"]
solc-full = ["ethers-solc", "ethers-solc/full"]
solc-tests = ["ethers-solc", "ethers-solc/tests"]
solc-sha2-asm = ["ethers-solc", "ethers-solc/asm"]

[dependencies]
ethers-addressbook = { version = "^0.13.0", default-features = false, path = "./ethers-addressbook" }
Expand All @@ -88,7 +87,7 @@ ethers-core = { version = "^0.13.0", default-features = false, path = "./ethers-
ethers-providers = { version = "^0.13.0", default-features = false, path = "./ethers-providers" }
ethers-signers = { version = "^0.13.0", default-features = false, path = "./ethers-signers" }
ethers-middleware = { version = "^0.13.0", default-features = false, path = "./ethers-middleware" }
ethers-solc = { version = "^0.13.0", default-features = false, path = "./ethers-solc" }
ethers-solc = { version = "^0.13.0", default-features = false, path = "./ethers-solc", optional = true }
ethers-etherscan = { version = "^0.13.0", default-features = false, path = "./ethers-etherscan" }

[dev-dependencies]
Expand All @@ -112,17 +111,25 @@ bytes = "1.1.0"
opt-level = "s"


[[example]]
name = "abigen"
path = "examples/abigen.rs"
required-features = ["ethers-solc"]

[[example]]
name = "contract_human_readable"
path = "examples/contract_human_readable.rs"
required-features = ["ethers-solc"]

[[example]]
name = "contract_with_abi"
path = "examples/contract_with_abi.rs"
required-features = ["ethers-solc"]

[[example]]
name = "contract_with_abi_and_bytecode"
path = "examples/contract_with_abi_and_bytecode.rs"
required-features = ["ethers-solc"]

[[example]]
name = "ipc"
Expand All @@ -137,7 +144,7 @@ required-features = ["ledger"]
[[example]]
name = "moonbeam_with_abi"
path = "examples/moonbeam_with_abi.rs"
required-features = ["legacy"]
required-features = ["legacy", "ethers-solc"]

[[example]]
name = "trezor"
Expand Down
2 changes: 1 addition & 1 deletion scripts/examples.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ for file in examples/*.rs; do
continue
fi
echo "running: $file"
cargo r -p ethers --example "$(basename "$name")"
cargo r -p ethers --example "$(basename "$name")" --features "ethers-solc"
done
2 changes: 2 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ pub mod signers {
pub use ethers_signers::*;
}

#[cfg(feature = "ethers-solc")]
#[doc = include_str!("../assets/SOLC_README.md")]
pub mod solc {
pub use ethers_solc::*;
Expand Down Expand Up @@ -141,6 +142,7 @@ pub mod prelude {

pub use super::signers::*;

#[cfg(feature = "ethers-solc")]
pub use super::solc::*;

pub use super::etherscan::*;
Expand Down