Repository: gakonst/ethers-rs
Pull request #845 (2022-01-31 03:10:58)

chore(deps): bump elliptic-curve from 0.11.10 to 0.11.12
Bumps [elliptic-curve](https://github.com/RustCrypto/traits) from 0.11.10 to 0.11.12.
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/RustCrypto/traits/commit/ce1ea2f8e2de728857cf0d6993b1b3e7d4eeb372"><code>ce1ea2f</code></a> elliptic-curve v0.11.12</li>
<li><a href="https://github.com/RustCrypto/traits/commit/204c9be96aec71beda98f87c590ed58e02f51b10"><code>204c9be</code></a> elliptic-curve v0.11.11</li>
<li>See full diff in <a href="https://github.com/RustCrypto/traits/compare/elliptic-curve-v0.11.10...elliptic-curve-v0.11.12">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=elliptic-curve&package-manager=cargo&previous-version=0.11.10&new-version=0.11.12)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5ed9c6c6..a92aa447 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -38,6 +38,8 @@
 
 ### Unreleased
 
+- Fix flatten replacement target location
+  [#846](https://github.com/gakonst/ethers-rs/pull/846)
 - Fix duplicate files during flattening
   [#813](https://github.com/gakonst/ethers-rs/pull/813)
 - Add ability to flatten file imports
diff --git a/Cargo.lock b/Cargo.lock
index a9890c29..3513ed1c 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1016,9 +1016,9 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
 
 [[package]]
 name = "elliptic-curve"
-version = "0.11.10"
+version = "0.11.12"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "23f80ad035a844638d4ce3d4a27ef4e00f2304e1a37f9f43c6a3c73622f39e79"
+checksum = "25b477563c2bfed38a3b7a60964c49e058b2510ad3f12ba3483fd8f62c2306d6"
 dependencies = [
  "base16ct",
  "crypto-bigint",
diff --git a/ethers-core/Cargo.toml b/ethers-core/Cargo.toml
index 904600b5..788ffe0a 100644
--- a/ethers-core/Cargo.toml
+++ b/ethers-core/Cargo.toml
@@ -17,7 +17,7 @@ rlp-derive = { version = "0.1.0", default-features = false }
 
 # crypto
 ecdsa = { version = "0.13.4", default-features = false, features = ["std"] }
-elliptic-curve = { version = "0.11.10", default-features = false }
+elliptic-curve = { version = "0.11.12", default-features = false }
 generic-array = { version = "0.14.5", default-features = false }
 k256 = { version = "0.10.2", default-features = false, features = ["keccak256", "ecdsa"] }
 rand = { version = "0.8.4", default-features = false }
diff --git a/ethers-signers/Cargo.toml b/ethers-signers/Cargo.toml
index d2487488..b34bf8e2 100644
--- a/ethers-signers/Cargo.toml
+++ b/ethers-signers/Cargo.toml
@@ -21,7 +21,7 @@ coins-bip39 = "0.6.0"
 coins-ledger = { version = "0.6.0", default-features = false, optional = true }
 hex = { version = "0.4.3", default-features = false, features = ["std"] }
 async-trait = { version = "0.1.50", default-features = false }
-elliptic-curve = { version = "0.11.10", default-features = false }
+elliptic-curve = { version = "0.11.12", default-features = false }
 sha2 = { version = "0.9.8", default-features = false }
 rand = { version = "0.8.4", default-features = false }
 yubihsm = { version = "0.40.0", features = ["secp256k1", "http", "usb"], optional = true }
diff --git a/ethers-solc/src/resolver.rs b/ethers-solc/src/resolver.rs
index e2c8403d..fce1c88d 100644
--- a/ethers-solc/src/resolver.rs
+++ b/ethers-solc/src/resolver.rs
@@ -485,7 +485,8 @@ impl<T> SolDataUnit<T> {
     pub fn loc_by_offset(&self, offset: isize) -> (usize, usize) {
         (
             offset.saturating_add(self.loc.start as isize) as usize,
-            offset.saturating_add(self.loc.end as isize) as usize,
+            // make the end location exclusive
+            offset.saturating_add(self.loc.end as isize + 1) as usize,
         )
     }
 }


Test patch:
diff --git a/ethers-solc/tests/project.rs b/ethers-solc/tests/project.rs
index c50fd3eb..f7b362d7 100644
--- a/ethers-solc/tests/project.rs
+++ b/ethers-solc/tests/project.rs
@@ -376,4 +376,5 @@ fn can_flatten_file_with_duplicates() {
     assert_eq!(result.matches("contract Foo {").count(), 1);
     assert_eq!(result.matches("contract Bar {").count(), 1);
     assert_eq!(result.matches("contract FooBar {").count(), 1);
+    assert_eq!(result.matches(";").count(), 1);
 }