Repository: gakonst/ethers-rs
Pull request #1846 (2022-11-09 03:02:54)

chore(deps): bump serde-aux from 4.0.0 to 4.1.0
Bumps [serde-aux](https://github.com/vityafx/serde-aux) from 4.0.0 to 4.1.0.
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/vityafx/serde-aux/commits">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=serde-aux&package-manager=cargo&previous-version=4.0.0&new-version=4.1.0)](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 fdcafb36..494df0f8 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -3477,9 +3477,9 @@ dependencies = [
 
 [[package]]
 name = "serde-aux"
-version = "4.0.0"
+version = "4.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c79c1a5a310c28bf9f7a4b9bd848553051120d80a5952f993c7eb62f6ed6e4c5"
+checksum = "eb6a3148cb21f1afb585b9ce6aeea9e58bd02c37ddb336277af10396ca3574fd"
 dependencies = [
  "serde",
  "serde_json",
diff --git a/Cargo.toml b/Cargo.toml
index 3702ec50..f6c40001 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -174,3 +174,13 @@ required-features = ["yubi"]
 name = "paginated_logs"
 path = "examples/paginated_logs.rs"
 required-features = ["rustls"]
+
+[[example]]
+name = "subscribe_contract_events"
+path = "examples/subscribe_contract_events.rs"
+required-features = ["rustls", "ws"]
+
+[[example]]
+name = "subscribe_contract_events_with_meta"
+path = "examples/subscribe_contract_events_with_meta.rs"
+required-features = ["rustls", "ws"]
diff --git a/ethers-contract/src/multicall/mod.rs b/ethers-contract/src/multicall/mod.rs
index a8d05145..80f76c8c 100644
--- a/ethers-contract/src/multicall/mod.rs
+++ b/ethers-contract/src/multicall/mod.rs
@@ -28,7 +28,7 @@ pub const MULTICALL_ADDRESS: Address = H160([
 ]);
 
 /// The chain IDs that [`MULTICALL_ADDRESS`] has been deployed to.
-/// Taken from: https://github.com/mds1/multicall#multicall3-contract-addresses
+/// Taken from: <https://github.com/mds1/multicall#multicall3-contract-addresses>
 pub static MULTICALL_SUPPORTED_CHAIN_IDS: Lazy<[U256; 48]> = Lazy::new(|| {
     use Chain::*;
     [
@@ -42,7 +42,7 @@ pub static MULTICALL_SUPPORTED_CHAIN_IDS: Lazy<[U256; 48]> = Lazy::new(|| {
         U256::from(OptimismGoerli),           // OptimismGoerli
         U256::from(OptimismKovan),            // OptimismKovan
         U256::from(Arbitrum),                 // Arbitrum
-        U256::from(421613),                   // ArbitrumGoerli,
+        U256::from(ArbitrumGoerli),           // ArbitrumGoerli,
         U256::from(ArbitrumTestnet),          // Arbitrum Rinkeby
         U256::from(Polygon),                  // Polygon
         U256::from(PolygonMumbai),            // PolygonMumbai
diff --git a/ethers-core/src/types/mod.rs b/ethers-core/src/types/mod.rs
index 3c2aff0e..335f8540 100644
--- a/ethers-core/src/types/mod.rs
+++ b/ethers-core/src/types/mod.rs
@@ -6,7 +6,7 @@ pub type Selector = [u8; 4];
 pub use ethabi::ethereum_types::H256 as TxHash;
 
 pub use ethabi::ethereum_types::{
-    Address, BigEndianHash, Bloom, H128, H160, H256, H32, H512, H64, U128, U256, U64, U512,
+    Address, BigEndianHash, Bloom, H128, H160, H256, H32, H512, H64, U128, U256, U512, U64,
 };
 
 pub mod transaction;
diff --git a/ethers-core/src/utils/mod.rs b/ethers-core/src/utils/mod.rs
index 9aaefc43..1a0b0c1b 100644
--- a/ethers-core/src/utils/mod.rs
+++ b/ethers-core/src/utils/mod.rs
@@ -156,7 +156,7 @@ where
     K: TryInto<Units, Error = ConversionError> + Copy,
 {
     let exponent: u32 = units.try_into()?.as_num();
-    let mut amount_str = amount.to_string().replace("_", "");
+    let mut amount_str = amount.to_string().replace('_', "");
     let dec_len = if let Some(di) = amount_str.find('.') {
         amount_str.remove(di);
         amount_str[di..].len() as u32
diff --git a/ethers-etherscan/Cargo.toml b/ethers-etherscan/Cargo.toml
index 4b306ca0..6916c532 100644
--- a/ethers-etherscan/Cargo.toml
+++ b/ethers-etherscan/Cargo.toml
@@ -23,7 +23,7 @@ ethers-solc = { version = "^1.0.0", path = "../ethers-solc", default-features =
 reqwest = { version = "0.11.12", default-features = false, features = ["json"] }
 serde = { version = "1.0.124", default-features = false, features = ["derive"] }
 serde_json = { version = "1.0.64", default-features = false }
-serde-aux = { version = "4.0.0", default-features = false }
+serde-aux = { version = "4.1.0", default-features = false }
 thiserror = "1.0"
 tracing = "0.1.37"
 semver = "1.0.14"
diff --git a/scripts/examples.sh b/scripts/examples.sh
index 594d639e..ee50628e 100755
--- a/scripts/examples.sh
+++ b/scripts/examples.sh
@@ -10,7 +10,7 @@ ignored=(
   "subscribe_logs"
   "trezor"
   "yubi"
-  "remove_liquidty"
+  "remove_liquidity"
 )
 
 # run all examples
@@ -21,5 +21,5 @@ for file in examples/*.rs; do
     continue
   fi
   echo "running: $file"
-  cargo r -p ethers --example "$(basename "$name")" --features "ethers-solc"
+  cargo r -p ethers --example "$(basename "$name")" --features "ethers-solc rustls ws"
 done


Test patch:
diff --git a/ethers-middleware/tests/signer.rs b/ethers-middleware/tests/signer.rs
index df00babe..efa35ad8 100644
--- a/ethers-middleware/tests/signer.rs
+++ b/ethers-middleware/tests/signer.rs
@@ -147,18 +147,22 @@ async fn typed_txs() {
         assert_eq!(tx.transaction_type, Some(expected.into()));
     }
 
-    let mut nonce = provider.get_transaction_count(address, None).await.unwrap();
-    let tx = TransactionRequest::new().from(address).to(address).nonce(nonce);
-    nonce += 1.into();
-    let tx1 =
-        provider.send_transaction(tx.clone(), Some(BlockNumber::Pending.into())).await.unwrap();
-
-    let tx = tx.clone().nonce(nonce).from(address).to(address).with_access_list(vec![]);
-    nonce += 1.into();
-    let tx2 = provider.send_transaction(tx, Some(BlockNumber::Pending.into())).await.unwrap();
-
-    let tx = Eip1559TransactionRequest::new().from(address).to(address).nonce(nonce);
-    let tx3 = provider.send_transaction(tx, Some(BlockNumber::Pending.into())).await.unwrap();
+    let nonce = provider.get_transaction_count(address, None).await.unwrap();
+    let bn = Some(BlockNumber::Pending.into());
+    let gas_price = provider.get_gas_price().await.unwrap() * 125 / 100;
+
+    let tx = TransactionRequest::new().from(address).to(address).nonce(nonce).gas_price(gas_price);
+    let tx1 = provider.send_transaction(tx.clone(), bn).await.unwrap();
+
+    let tx = tx.clone().from(address).to(address).nonce(nonce + 1).with_access_list(vec![]);
+    let tx2 = provider.send_transaction(tx, bn).await.unwrap();
+
+    let tx = Eip1559TransactionRequest::new()
+        .from(address)
+        .to(address)
+        .nonce(nonce + 2)
+        .max_fee_per_gas(gas_price);
+    let tx3 = provider.send_transaction(tx, bn).await.unwrap();
 
     futures_util::join!(check_tx(tx1, 0), check_tx(tx2, 1), check_tx(tx3, 2),);
 }