chore: add changelog for #427 changes (#428)

This commit is contained in:
Georgios Konstantopoulos 2021-09-03 17:50:50 +03:00 committed by GitHub
parent bc89878e92
commit 520645c48b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 0 deletions

View File

@ -4,6 +4,8 @@
### Unreleased
* Allow configuring the optimizer & passing arbitrary arguments to solc [#427](https://github.com/gakonst/ethers-rs/pull/427)
### 0.5.2
* Correctly RLP Encode transactions as received from the mempool ([#415](https://github.com/gakonst/ethers-rs/pull/415))

View File

@ -210,6 +210,22 @@ impl Solc {
}
/// Sets the optimizer runs (default = 200). None indicates no optimization
///
/// ```rust,no_run
/// use ethers_core::utils::Solc;
///
/// // No optimization
/// let contracts = Solc::new("./contracts/*")
/// .optimizer(None)
/// .build().unwrap();
///
/// // Some(200) is default, optimizer on with 200 runs
/// // .arg() allows passing arbitrary args to solc command
/// let optimized_contracts = Solc::new("./contracts/*")
/// .optimizer(Some(200))
/// .arg("--metadata-hash=none")
/// .build().unwrap();
/// ```
pub fn optimizer(mut self, runs: Option<usize>) -> Self {
self.optimizer = runs;
self