Skip to content
This repository has been archived by the owner on Oct 19, 2024. It is now read-only.

Commit

Permalink
chore: cargo fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed Oct 9, 2021
1 parent f530288 commit 5bfa8ec
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ pub(crate) fn imports(name: &str) -> TokenStream {
quote! {
#![allow(clippy::enum_variant_names)]
#![allow(dead_code)]
#![allow(clippy::redundant_clone)]
#![allow(clippy::type_complexity)]
#![allow(unused_imports)]
#doc
Expand Down
6 changes: 3 additions & 3 deletions ethers-contract/tests/contract.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@



#![allow(unused)]
mod common;
pub use common::*;
use ethers_contract::{abigen, ContractFactory, EthAbiType};
use ethers_core::types::{Filter, ValueOrArray, H256};

#[cfg(not(feature = "celo"))]
mod eth_tests {
Expand Down
4 changes: 2 additions & 2 deletions ethers-core/src/types/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,13 +258,13 @@ mod celo_tests {
#[test]
fn block_without_snark_data() {
let block = r#"{"extraData":"0xd983010000846765746889676f312e31332e3130856c696e7578000000000000f8b2c0c080b841cfa11585812ec794c4baa46178690971b3c72e367211d68a9ea318ff500c5aeb7099cafc965240e3b57cf7355341cf76bdca74530334658370d2df7b2e030ab200f582027db017810fa05b4f35927f968f6be1a61e322d4ace3563feb8a489690a91c031fda640c55c216f6712a7bdde994338a5610080f58203ffb093cd643f5154979952791ff714eb885df0f18012f2211fb8c29a8947130dc3adf4ecb48a3c4a142a0faa51e5c60b048180","gasUsed":"0xbef6","hash":"0x37ac2818e50e61f0566caea102ed98677f2552fa86fed53443315ed11fe0eaad","logsBloom":"0x00000800000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000100000000000000000000000000000000000000000000000000000000000000080000000000001020000400000000000000000000000000000000000000000000000000000000000080000000000000000000000000400000000000000000000000000000000000000100000040004000000000000800000000000000000084000000000000000000000000000000000020000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000","miner":"0xcda518f6b5a797c3ec45d37c65b83e0b0748edca","number":"0x1b4","parentHash":"0xa6b4775f600c2981f9142cbc1361db02c7ba8c185a1110537b255356876301a2","randomness":{"committed":"0x049e84c89f1aa0e3a770b2545b05a30eb814dae322e7247fd2bf27e6cacb1f51","revealed":"0x5a8826bf59a7ed1ee86a9d6464fa9c1fcece78ffa7cf32b11a03ad251ddcefe6"},"receiptsRoot":"0x1724dc3e7c2bfa03974c1deedf5ea20ad30b72e25f3c62fbb5fd06fc107068d7","size":"0x3a0","stateRoot":"0xc45fa03e69dccb54b4981d23d77328ab8906ddd7a0d8238b9c54ae1a14df4d1c","timestamp":"0x5e90166d","totalDifficulty":"0x1b5","transactions":[{"blockHash":"0x37ac2818e50e61f0566caea102ed98677f2552fa86fed53443315ed11fe0eaad","blockNumber":"0x1b4","from":"0x456f41406b32c45d59e539e4bba3d7898c3584da","gas":"0x1312d00","gasPrice":"0x174876e800","feeCurrency":null,"gatewayFeeRecipient":null,"gatewayFee":"0x0","hash":"0xf7b1b588b1fc03305f556805812273d80fb61fc0ba7f812de27189e95c5ecfc5","input":"0xed385274000000000000000000000000b9ff7ab50a2f0fd3e2fb2814b016ac90c91df98f03386ba30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000be951906eba2aa800000","nonce":"0x147","to":"0xa12a699c641cc875a7ca57495861c79c33d293b4","transactionIndex":"0x0","value":"0x0","v":"0x15e08","r":"0x5787d040d09a34cb2b9ffcd096be7fe66aa6a3ed0632f182d1f3045640a9ef8b","s":"0x7897f58740f2a1c645826579106a620c306fc56381520ae2f28880bb284c4abd"}],"transactionsRoot":"0xbc8cb40b809914b9cd735b12e9b1802cf5d85de5223a22bbdb249a7e8b45ec93"}"#;
let block: Block<Transaction> = serde_json::from_str(&block).unwrap();
let block: Block<Transaction> = serde_json::from_str(block).unwrap();
assert_eq!(block.epoch_snark_data, None);
}

#[test]
fn block_with_snark_data() {
let block = r#"{"extraData":"0xd983010000846765746889676f312e31332e3130856c696e7578000000000000f8b2c0c080b841cfa11585812ec794c4baa46178690971b3c72e367211d68a9ea318ff500c5aeb7099cafc965240e3b57cf7355341cf76bdca74530334658370d2df7b2e030ab200f582027db017810fa05b4f35927f968f6be1a61e322d4ace3563feb8a489690a91c031fda640c55c216f6712a7bdde994338a5610080f58203ffb093cd643f5154979952791ff714eb885df0f18012f2211fb8c29a8947130dc3adf4ecb48a3c4a142a0faa51e5c60b048180","gasUsed":"0xbef6","hash":"0x37ac2818e50e61f0566caea102ed98677f2552fa86fed53443315ed11fe0eaad","logsBloom":"0x00000800000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000100000000000000000000000000000000000000000000000000000000000000080000000000001020000400000000000000000000000000000000000000000000000000000000000080000000000000000000000000400000000000000000000000000000000000000100000040004000000000000800000000000000000084000000000000000000000000000000000020000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000","miner":"0xcda518f6b5a797c3ec45d37c65b83e0b0748edca","number":"0x1b4","parentHash":"0xa6b4775f600c2981f9142cbc1361db02c7ba8c185a1110537b255356876301a2","randomness":{"committed":"0x049e84c89f1aa0e3a770b2545b05a30eb814dae322e7247fd2bf27e6cacb1f51","revealed":"0x5a8826bf59a7ed1ee86a9d6464fa9c1fcece78ffa7cf32b11a03ad251ddcefe6"},"receiptsRoot":"0x1724dc3e7c2bfa03974c1deedf5ea20ad30b72e25f3c62fbb5fd06fc107068d7","size":"0x3a0","stateRoot":"0xc45fa03e69dccb54b4981d23d77328ab8906ddd7a0d8238b9c54ae1a14df4d1c","timestamp":"0x5e90166d","totalDifficulty":"0x1b5","transactions":[{"blockHash":"0x37ac2818e50e61f0566caea102ed98677f2552fa86fed53443315ed11fe0eaad","blockNumber":"0x1b4","from":"0x456f41406b32c45d59e539e4bba3d7898c3584da","gas":"0x1312d00","gasPrice":"0x174876e800","feeCurrency":null,"gatewayFeeRecipient":null,"gatewayFee":"0x0","hash":"0xf7b1b588b1fc03305f556805812273d80fb61fc0ba7f812de27189e95c5ecfc5","input":"0xed385274000000000000000000000000b9ff7ab50a2f0fd3e2fb2814b016ac90c91df98f03386ba30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000be951906eba2aa800000","nonce":"0x147","to":"0xa12a699c641cc875a7ca57495861c79c33d293b4","transactionIndex":"0x0","value":"0x0","v":"0x15e08","r":"0x5787d040d09a34cb2b9ffcd096be7fe66aa6a3ed0632f182d1f3045640a9ef8b","s":"0x7897f58740f2a1c645826579106a620c306fc56381520ae2f28880bb284c4abd"}],"transactionsRoot":"0xbc8cb40b809914b9cd735b12e9b1802cf5d85de5223a22bbdb249a7e8b45ec93","epochSnarkData":{"bitmap": "0x01a72267ae3fe9fffb","signature": "0xcd803565d415c14b42d3aee51c5de1f6fd7d33cd036f03178c104c787a6ceafb8dd2b357d5fb5992fc2a23706625c800"}}"#;
let _block: Block<Transaction> = serde_json::from_str(&block).unwrap();
let _block: Block<Transaction> = serde_json::from_str(block).unwrap();
}
}
1 change: 1 addition & 0 deletions ethers-core/src/types/log.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ impl From<H256> for FilterBlockOption {
}
}

#[allow(clippy::derivable_impls)]
impl Default for FilterBlockOption {
fn default() -> Self {
FilterBlockOption::Range {
Expand Down
2 changes: 1 addition & 1 deletion ethers-etherscan/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,6 @@ mod tests {
.optimization(true)
.runs(200);

let resp = client.submit_contract_verification(&contract).await;
let _resp = client.submit_contract_verification(&contract).await;
}
}
5 changes: 3 additions & 2 deletions ethers-middleware/tests/signer.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused)]
use ethers_providers::{Http, JsonRpcClient, Middleware, Provider};

use ethers_core::{
Expand Down Expand Up @@ -368,9 +369,9 @@ impl TestWallets {

pub fn next(&self) -> LocalWallet {
let idx = self.next.fetch_add(1, std::sync::atomic::Ordering::SeqCst);
let wallet = self.get(idx);

// println!("Got wallet {:?}", wallet.address());
wallet
self.get(idx)
}

pub fn get<T: Into<u32>>(&self, idx: T) -> LocalWallet {
Expand Down
1 change: 1 addition & 0 deletions ethers-middleware/tests/transformer.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![cfg(not(target_arch = "wasm32"))]
#![allow(unused)]
use ethers_contract::{BaseContract, ContractFactory};
use ethers_core::{
types::*,
Expand Down
4 changes: 2 additions & 2 deletions ethers-signers/src/aws/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ impl<'a> AwsSigner<'a> {
where
T: AsRef<str>,
{
Ok(request_get_pubkey(&self.kms, key_id)
Ok(request_get_pubkey(self.kms, key_id)
.await
.map(utils::decode_pubkey)??)
}
Expand All @@ -207,7 +207,7 @@ impl<'a> AwsSigner<'a> {
where
T: AsRef<str>,
{
Ok(request_sign_digest(&self.kms, key_id, digest)
Ok(request_sign_digest(self.kms, key_id, digest)
.await
.map(utils::decode_signature)??)
}
Expand Down
6 changes: 3 additions & 3 deletions ethers-signers/src/aws/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ pub(super) fn rsig_to_ethsig(sig: &RSig) -> EthSig {
let v = (v + 27) as u64;
let r_bytes: FieldBytes = sig.r().into();
let s_bytes: FieldBytes = sig.s().into();
let r = U256::from_big_endian(&r_bytes.as_slice());
let s = U256::from_big_endian(&s_bytes.as_slice());
let r = U256::from_big_endian(r_bytes.as_slice());
let s = U256::from_big_endian(s_bytes.as_slice());
EthSig { r, s, v }
}

Expand Down Expand Up @@ -82,7 +82,7 @@ pub(super) fn decode_pubkey(resp: GetPublicKeyResponse) -> Result<VerifyingKey,
.ok_or_else(|| AwsSignerError::from("Pubkey not found in response".to_owned()))?;

let spk = spki::SubjectPublicKeyInfo::try_from(raw.as_ref())?;
let key = VerifyingKey::from_sec1_bytes(&spk.subject_public_key)?;
let key = VerifyingKey::from_sec1_bytes(spk.subject_public_key)?;

Ok(key)
}
Expand Down
4 changes: 2 additions & 2 deletions ethers-signers/src/ledger/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl LedgerEthereum {
&self,
derivation: &DerivationType,
) -> Result<Address, LedgerError> {
let data = APDUData::new(&Self::path_to_bytes(&derivation));
let data = APDUData::new(&Self::path_to_bytes(derivation));
let transport = self.transport.lock().await;
Self::get_address_with_path_transport(&transport, derivation).await
}
Expand All @@ -75,7 +75,7 @@ impl LedgerEthereum {
transport: &Ledger,
derivation: &DerivationType,
) -> Result<Address, LedgerError> {
let data = APDUData::new(&Self::path_to_bytes(&derivation));
let data = APDUData::new(&Self::path_to_bytes(derivation));

let command = APDUCommand {
ins: INS::GET_PUBLIC_KEY as u8,
Expand Down
6 changes: 2 additions & 4 deletions ethers-signers/src/ledger/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ use crate::Signer;
use app::LedgerEthereum;
use async_trait::async_trait;
use ethers_core::types::{
transaction::eip2718::TypedTransaction,
transaction::eip712::{EIP712Domain, Eip712},
Address, Signature,
transaction::eip2718::TypedTransaction, transaction::eip712::Eip712, Address, Signature,
};
use types::{LedgerError, INS};
use types::LedgerError;

#[cfg_attr(target_arch = "wasm32", async_trait(?Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_trait)]
Expand Down
1 change: 1 addition & 0 deletions ethers-signers/src/ledger/types.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(clippy::upper_case_acronyms)]
//! Helpers for interacting with the Ethereum Ledger App
//! [Official Docs](https://github.com/LedgerHQ/app-ethereum/blob/master/doc/ethapp.asc)
use std::fmt;
Expand Down

0 comments on commit 5bfa8ec

Please sign in to comment.