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

Commit fb3fb16

Browse files
authored
chore: make ethers-solc optional (#1463)
* chore: make ethers-solc optional * chore: update CHANGELOG * add missing requirement * add abigen req
1 parent 0b88e42 commit fb3fb16

File tree

4 files changed

+18
-7
lines changed

4 files changed

+18
-7
lines changed

Diff for: CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@
104104

105105
### Unreleased
106106

107+
- Make `ethers-solc` optional dependency of `ethers`, needs `ethers-solc` feature to activate
108+
[#1463](https://github.com/gakonst/ethers-rs/pull/1463)
107109
- Add `rawMetadata:String` field to configurable contract output
108110
[#1365](https://github.com/gakonst/ethers-rs/pull/1365)
109111
- Use relative source paths and `solc --base-path`

Diff for: Cargo.toml

+13-6
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,9 @@ abigen = ["ethers-contract/abigen"]
7676
### abigen without reqwest
7777
abigen-offline = ["ethers-contract/abigen-offline"]
7878
## solc
79-
solc-async = ["ethers-solc/async"]
80-
solc-full = ["ethers-solc/full"]
81-
solc-tests = ["ethers-solc/tests"]
82-
solc-sha2-asm = ["ethers-solc/asm"]
79+
solc-full = ["ethers-solc", "ethers-solc/full"]
80+
solc-tests = ["ethers-solc", "ethers-solc/tests"]
81+
solc-sha2-asm = ["ethers-solc", "ethers-solc/asm"]
8382

8483
[dependencies]
8584
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-
8887
ethers-providers = { version = "^0.13.0", default-features = false, path = "./ethers-providers" }
8988
ethers-signers = { version = "^0.13.0", default-features = false, path = "./ethers-signers" }
9089
ethers-middleware = { version = "^0.13.0", default-features = false, path = "./ethers-middleware" }
91-
ethers-solc = { version = "^0.13.0", default-features = false, path = "./ethers-solc" }
90+
ethers-solc = { version = "^0.13.0", default-features = false, path = "./ethers-solc", optional = true }
9291
ethers-etherscan = { version = "^0.13.0", default-features = false, path = "./ethers-etherscan" }
9392

9493
[dev-dependencies]
@@ -112,17 +111,25 @@ bytes = "1.1.0"
112111
opt-level = "s"
113112

114113

114+
[[example]]
115+
name = "abigen"
116+
path = "examples/abigen.rs"
117+
required-features = ["ethers-solc"]
118+
115119
[[example]]
116120
name = "contract_human_readable"
117121
path = "examples/contract_human_readable.rs"
122+
required-features = ["ethers-solc"]
118123

119124
[[example]]
120125
name = "contract_with_abi"
121126
path = "examples/contract_with_abi.rs"
127+
required-features = ["ethers-solc"]
122128

123129
[[example]]
124130
name = "contract_with_abi_and_bytecode"
125131
path = "examples/contract_with_abi_and_bytecode.rs"
132+
required-features = ["ethers-solc"]
126133

127134
[[example]]
128135
name = "ipc"
@@ -137,7 +144,7 @@ required-features = ["ledger"]
137144
[[example]]
138145
name = "moonbeam_with_abi"
139146
path = "examples/moonbeam_with_abi.rs"
140-
required-features = ["legacy"]
147+
required-features = ["legacy", "ethers-solc"]
141148

142149
[[example]]
143150
name = "trezor"

Diff for: scripts/examples.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ for file in examples/*.rs; do
2020
continue
2121
fi
2222
echo "running: $file"
23-
cargo r -p ethers --example "$(basename "$name")"
23+
cargo r -p ethers --example "$(basename "$name")" --features "ethers-solc"
2424
done

Diff for: src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ pub mod signers {
114114
pub use ethers_signers::*;
115115
}
116116

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

142143
pub use super::signers::*;
143144

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

146148
pub use super::etherscan::*;

0 commit comments

Comments
 (0)