Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): bump ethers #4573

Merged
merged 4 commits into from
Mar 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
543 changes: 206 additions & 337 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion anvil/src/eth/sign.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl Signer for DevSigner {
let signer = self.accounts.get(address).ok_or(BlockchainError::NoSignerAvailable)?;
let ethers_tx: EthersTypedTransactionRequest = request.clone().into();

let signature = signer.sign_transaction_sync(&ethers_tx);
let signature = signer.sign_transaction_sync(&ethers_tx)?;

build_typed_transaction(request, signature)
}
Expand Down
2 changes: 1 addition & 1 deletion anvil/src/genesis.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ pub mod secret_key {
if s.is_empty() {
return Ok(None)
}
SecretKey::from_be_bytes(s.as_ref())
SecretKey::from_bytes(s.as_ref().into())
.map_err(de::Error::custom)
.map(Into::into)
.map(Some)
Expand Down
2 changes: 1 addition & 1 deletion anvil/tests/it/ganache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ fn ganache_wallet2() -> LocalWallet {

fn wallet(key_str: &str) -> LocalWallet {
let key_hex = hex::decode(key_str).expect("could not parse as hex");
let key = SecretKey::from_be_bytes(&key_hex).expect("did not get private key");
let key = SecretKey::from_bytes(key_hex.as_slice().into()).expect("did not get private key");
key.into()
}

Expand Down
2 changes: 1 addition & 1 deletion anvil/tests/it/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ async fn can_respect_nonces() {

// ensure the listener for ready transactions times out
let mut listener = api.new_ready_transactions();
let res = timeout(Duration::from_millis(1500), async move { listener.next().await }).await;
let res = timeout(Duration::from_millis(1500), listener.next()).await;
res.unwrap_err();

// send with the actual nonce which is mined immediately
Expand Down
4 changes: 2 additions & 2 deletions chisel/src/executor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1304,7 +1304,7 @@ mod tests {
]
};

let ref mut source = source();
let source = &mut source();

let array_expressions: &[(&str, ParamType)] = &[
("[1, 2, 3]", fixed_array(ParamType::Uint(256), 3)),
Expand Down Expand Up @@ -1524,7 +1524,7 @@ mod tests {
let input = input.trim_end().trim_end_matches(';').to_string() + ";";
let (mut _s, _) = s.clone_with_new_line(input).unwrap();
*s = _s.clone();
let ref mut s = _s;
let s = &mut _s;

if let Err(e) = s.parse() {
for err in e {
Expand Down
2 changes: 1 addition & 1 deletion evm/src/executor/inspector/cheatcodes/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ fn broadcast_key(
let mut bytes: [u8; 32] = [0; 32];
private_key.to_big_endian(&mut bytes);

let key = SigningKey::from_bytes(&bytes).map_err(|err| err.to_string().encode())?;
let key = SigningKey::from_bytes((&bytes).into()).map_err(|err| err.to_string().encode())?;
let wallet = LocalWallet::from(key).with_chain_id(chain_id.as_u64());

let new_origin = wallet.address();
Expand Down
4 changes: 2 additions & 2 deletions evm/src/executor/inspector/cheatcodes/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ fn sign(private_key: U256, digest: H256, chain_id: U256) -> Result<Bytes, Bytes>
let wallet = LocalWallet::from(key).with_chain_id(chain_id.as_u64());

// The `ecrecover` precompile does not use EIP-155
let sig = wallet.sign_hash(digest);
let sig = wallet.sign_hash(digest).map_err(|err| err.to_string().encode())?;
let recovered = sig.recover(digest).map_err(|err| err.to_string().encode())?;

assert_eq!(recovered, wallet.address());
Expand Down Expand Up @@ -324,7 +324,7 @@ pub fn parse_private_key(private_key: U256) -> Result<SigningKey, Bytes> {
let mut bytes: [u8; 32] = [0; 32];
private_key.to_big_endian(&mut bytes);

SigningKey::from_bytes(&bytes).map_err(|err| err.to_string().encode().into())
SigningKey::from_bytes((&bytes).into()).map_err(|err| err.to_string().encode().into())
}

// Determines if the gas limit on a given call was manually set in the script and should therefore
Expand Down