Repository: gakonst/ethers-rs
Pull request #790 (2022-01-14 03:17:51)

chore(deps): bump getrandom from 0.2.3 to 0.2.4
Bumps [getrandom](https://github.com/rust-random/getrandom) from 0.2.3 to 0.2.4.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/rust-random/getrandom/blob/master/CHANGELOG.md">getrandom's changelog</a>.</em></p>
<blockquote>
<h2>[0.2.4] - 2021-12-13</h2>
<h3>Changed</h3>
<ul>
<li>Use explicit imports in the <code>js</code> backend <a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/220">#220</a></li>
<li>Use <code>/dev/urandom</code> on Redox instead of <code>rand:</code> <a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/222">#222</a></li>
<li>Use <code>NonZeroU32::new_unchecked</code> to convert wasi error <a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/233">#233</a></li>
</ul>
<h3>Added</h3>
<ul>
<li>SOLID targets (<code>*-kmc-solid_*</code>) support <a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/235">#235</a></li>
<li>Limited Hermit (<code>x86_64-unknown-hermit</code>) support <a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/236">#236</a></li>
</ul>
<p><a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/220">#220</a>: <a href="https://github-redirect.dependabot.com/rust-random/getrandom/pull/220">rust-random/getrandom#220</a>
<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/222">#222</a>: <a href="https://github-redirect.dependabot.com/rust-random/getrandom/pull/222">rust-random/getrandom#222</a>
<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/233">#233</a>: <a href="https://github-redirect.dependabot.com/rust-random/getrandom/pull/233">rust-random/getrandom#233</a>
<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/235">#235</a>: <a href="https://github-redirect.dependabot.com/rust-random/getrandom/pull/235">rust-random/getrandom#235</a>
<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/236">#236</a>: <a href="https://github-redirect.dependabot.com/rust-random/getrandom/pull/236">rust-random/getrandom#236</a></p>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/rust-random/getrandom/commit/b9c7c0c13d76eead06c4433368fd5c45bdbe7651"><code>b9c7c0c</code></a> Release v0.2.4 (<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/238">#238</a>)</li>
<li><a href="https://github.com/rust-random/getrandom/commit/9110af54d199cbdba541039012e218a2223b744f"><code>9110af5</code></a> Fix get_rng_fd comment typo (<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/240">#240</a>)</li>
<li><a href="https://github.com/rust-random/getrandom/commit/ec445bb0acb738a7cc97102084292fe6f18d2afc"><code>ec445bb</code></a> Added x86_64-unknown-hermit support (<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/236">#236</a>)</li>
<li><a href="https://github.com/rust-random/getrandom/commit/f5e33009edc2ac5ea59f7dde68709e9572b94458"><code>f5e3300</code></a> Add SOLID target support (<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/235">#235</a>)</li>
<li><a href="https://github.com/rust-random/getrandom/commit/0d0404be5a7f5024301b433b0941920318309ff8"><code>0d0404b</code></a> Use <code>NonZeroU32::new_unchecked</code> to convert wasi error (<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/233">#233</a>)</li>
<li><a href="https://github.com/rust-random/getrandom/commit/e4004f41faed8ec4f6336cfab8ea11e18102392d"><code>e4004f4</code></a> redox: Switch to /dev/urandom (<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/222">#222</a>)</li>
<li><a href="https://github.com/rust-random/getrandom/commit/30308ae845b0bf3839e5a92120559eaf56048c28"><code>30308ae</code></a> js: Explictly list all dependancies used with the &quot;js&quot; feature (<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/220">#220</a>)</li>
<li><a href="https://github.com/rust-random/getrandom/commit/dcf452bb14f55abdc7dde94c8bb4880dbec581f9"><code>dcf452b</code></a> fix some typos (<a href="https://github-redirect.dependabot.com/rust-random/getrandom/issues/218">#218</a>)</li>
<li>See full diff in <a href="https://github.com/rust-random/getrandom/compare/v0.2.3...v0.2.4">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=getrandom&package-manager=cargo&previous-version=0.2.3&new-version=0.2.4)](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/Cargo.lock b/Cargo.lock
index 6208f448..8486b960 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -480,7 +480,7 @@ dependencies = [
  "bs58",
  "coins-core",
  "digest 0.9.0",
- "getrandom 0.2.3",
+ "getrandom 0.2.4",
  "hmac",
  "k256",
  "lazy_static",
@@ -497,7 +497,7 @@ checksum = "8f473ea37dfc9d2cb94fdde50c3d41f28c3f384b367573d66386fea38d76d466"
 dependencies = [
  "bitvec 0.17.4",
  "coins-bip32",
- "getrandom 0.2.3",
+ "getrandom 0.2.4",
  "hex",
  "hmac",
  "pbkdf2 0.8.0",
@@ -1144,7 +1144,7 @@ dependencies = [
  "cfg-if 1.0.0",
  "dunce",
  "ethers-core",
- "getrandom 0.2.3",
+ "getrandom 0.2.4",
  "hex",
  "once_cell",
  "proc-macro2",
@@ -1336,7 +1336,7 @@ dependencies = [
  "ethers-core",
  "fs_extra",
  "futures-util",
- "getrandom 0.2.3",
+ "getrandom 0.2.4",
  "glob",
  "hex",
  "home",
@@ -1590,9 +1590,9 @@ dependencies = [
 
 [[package]]
 name = "getrandom"
-version = "0.2.3"
+version = "0.2.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753"
+checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c"
 dependencies = [
  "cfg-if 1.0.0",
  "js-sys",
@@ -2694,7 +2694,7 @@ version = "0.6.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7"
 dependencies = [
- "getrandom 0.2.3",
+ "getrandom 0.2.4",
 ]
 
 [[package]]
@@ -2755,7 +2755,7 @@ version = "0.4.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64"
 dependencies = [
- "getrandom 0.2.3",
+ "getrandom 0.2.4",
  "redox_syscall",
 ]
 
@@ -3907,7 +3907,7 @@ version = "0.8.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7"
 dependencies = [
- "getrandom 0.2.3",
+ "getrandom 0.2.4",
  "serde",
 ]
 
diff --git a/ethers-providers/src/lib.rs b/ethers-providers/src/lib.rs
index 66547cec..696fa8c4 100644
--- a/ethers-providers/src/lib.rs
+++ b/ethers-providers/src/lib.rs
@@ -480,6 +480,14 @@ pub trait Middleware: Sync + Send + Debug {
         self.inner().trace_call(req, trace_type, block).await.map_err(FromErr::from)
     }
 
+    async fn trace_call_many<T: Into<TypedTransaction> + Send + Sync>(
+        &self,
+        req: Vec<(T, Vec<TraceType>)>,
+        block: Option<BlockNumber>,
+    ) -> Result<Vec<BlockTrace>, Self::Error> {
+        self.inner().trace_call_many(req, block).await.map_err(FromErr::from)
+    }
+
     /// Traces a call to `eth_sendRawTransaction` without making the call, returning the traces
     async fn trace_raw_transaction(
         &self,
diff --git a/ethers-providers/src/provider.rs b/ethers-providers/src/provider.rs
index 8d2617cb..516986e8 100644
--- a/ethers-providers/src/provider.rs
+++ b/ethers-providers/src/provider.rs
@@ -797,6 +797,19 @@ impl<P: JsonRpcClient> Middleware for Provider<P> {
         self.request("trace_call", [req, trace_type, block]).await
     }
 
+    /// Executes given calls and returns a number of possible traces for each call
+    async fn trace_call_many<T: Into<TypedTransaction> + Send + Sync>(
+        &self,
+        req: Vec<(T, Vec<TraceType>)>,
+        block: Option<BlockNumber>,
+    ) -> Result<Vec<BlockTrace>, ProviderError> {
+        let req: Vec<(TypedTransaction, Vec<TraceType>)> =
+            req.into_iter().map(|(tx, trace_type)| (tx.into(), trace_type)).collect();
+        let req = utils::serialize(&req);
+        let block = utils::serialize(&block.unwrap_or(BlockNumber::Latest));
+        self.request("trace_callMany", [req, block]).await
+    }
+
     /// Traces a call to `eth_sendRawTransaction` without making the call, returning the traces
     async fn trace_raw_transaction(
         &self,
@@ -1434,4 +1447,42 @@ mod tests {
             provider.fee_history(10u64, BlockNumber::Latest, &[10.0, 40.0]).await.unwrap();
         dbg!(&history);
     }
+
+    #[tokio::test]
+    #[ignore]
+    async fn test_trace_call_many() {
+        // TODO: Implement ErigonInstance, so it'd be possible to test this.
+        let provider = Provider::new(Ws::connect("ws://127.0.0.1:8545").await.unwrap());
+        let traces = provider
+            .trace_call_many(
+                vec![
+                    (
+                        TransactionRequest::new()
+                            .from(Address::zero())
+                            .to("0x0000000000000000000000000000000000000001"
+                                .parse::<H160>()
+                                .unwrap())
+                            .value(U256::from(10000000000000000u128)),
+                        vec![TraceType::StateDiff],
+                    ),
+                    (
+                        TransactionRequest::new()
+                            .from(
+                                "0x0000000000000000000000000000000000000001"
+                                    .parse::<H160>()
+                                    .unwrap(),
+                            )
+                            .to("0x0000000000000000000000000000000000000002"
+                                .parse::<H160>()
+                                .unwrap())
+                            .value(U256::from(10000000000000000u128)),
+                        vec![TraceType::StateDiff],
+                    ),
+                ],
+                None,
+            )
+            .await
+            .unwrap();
+        dbg!(traces);
+    }
 }


Test patch:
diff --git a/ethers-contract/tests/contract.rs b/ethers-contract/tests/contract.rs
index 8748af2b..17bfe11e 100644
--- a/ethers-contract/tests/contract.rs
+++ b/ethers-contract/tests/contract.rs
@@ -570,12 +570,12 @@ mod eth_tests {
         };
 
         let derived_foo_bar = deriveeip712test_mod::FooBar {
-            foo: foo_bar.foo.clone(),
-            bar: foo_bar.bar.clone(),
+            foo: foo_bar.foo,
+            bar: foo_bar.bar,
             fizz: foo_bar.fizz.clone(),
-            buzz: foo_bar.buzz.clone(),
+            buzz: foo_bar.buzz,
             far: foo_bar.far.clone(),
-            out: foo_bar.out.clone(),
+            out: foo_bar.out,
         };
 
         let sig = wallet.sign_typed_data(&foo_bar).await.expect("failed to sign typed data");