chore: make ethers-solc optional (#1463)

* chore: make ethers-solc optional

* chore: update CHANGELOG

* add missing requirement

* add abigen req
This commit is contained in:
Matthias Seitz 2022-07-06 23:11:56 +02:00 committed by GitHub
parent 0b88e4246d
commit fb3fb161c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 7 deletions

View File

@ -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`

View File

@ -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" }
@ -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]
@ -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"
@ -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"

View File

@ -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

View File

@ -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::*;
@ -141,6 +142,7 @@ pub mod prelude {
pub use super::signers::*;
#[cfg(feature = "ethers-solc")]
pub use super::solc::*;
pub use super::etherscan::*;