chore: clippy
This commit is contained in:
parent
5f2de7b99d
commit
376b8ce5d7
|
@ -40,7 +40,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<M: Middleware> std::fmt::Display for MwErr<M> {
|
impl<M: Middleware> std::fmt::Display for MwErr<M> {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, _f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ impl<M: Middleware> Middleware for NonClone<M> {
|
||||||
// It exists to ensure that trait bounds on contract internal behave as
|
// It exists to ensure that trait bounds on contract internal behave as
|
||||||
// expected. It should not be run
|
// expected. It should not be run
|
||||||
fn it_compiles() {
|
fn it_compiles() {
|
||||||
let (abi, bytecode) = compile_contract("SimpleStorage", "SimpleStorage.sol");
|
let (abi, _bytecode) = compile_contract("SimpleStorage", "SimpleStorage.sol");
|
||||||
|
|
||||||
// launch anvil
|
// launch anvil
|
||||||
let anvil = Anvil::new().spawn();
|
let anvil = Anvil::new().spawn();
|
||||||
|
@ -138,11 +138,11 @@ async fn deploy_and_call_contract() {
|
||||||
let contract_call =
|
let contract_call =
|
||||||
contract.connect(client2.clone()).method::<_, H256>("setValue", "hi".to_owned()).unwrap();
|
contract.connect(client2.clone()).method::<_, H256>("setValue", "hi".to_owned()).unwrap();
|
||||||
let calldata = contract_call.calldata().unwrap();
|
let calldata = contract_call.calldata().unwrap();
|
||||||
let gas_estimate = contract_call.estimate_gas().await.unwrap();
|
let _gas_estimate = contract_call.estimate_gas().await.unwrap();
|
||||||
let contract_call = contract_call.legacy();
|
let contract_call = contract_call.legacy();
|
||||||
let pending_tx = contract_call.send().await.unwrap();
|
let pending_tx = contract_call.send().await.unwrap();
|
||||||
let tx = client.get_transaction(*pending_tx).await.unwrap().unwrap();
|
let tx = client.get_transaction(*pending_tx).await.unwrap().unwrap();
|
||||||
let tx_receipt = pending_tx.await.unwrap().unwrap();
|
let _tx_receipt = pending_tx.await.unwrap().unwrap();
|
||||||
assert_eq!(last_sender.clone().call().await.unwrap(), addr2);
|
assert_eq!(last_sender.clone().call().await.unwrap(), addr2);
|
||||||
assert_eq!(get_value.clone().call().await.unwrap(), "hi");
|
assert_eq!(get_value.clone().call().await.unwrap(), "hi");
|
||||||
assert_eq!(tx.input, calldata);
|
assert_eq!(tx.input, calldata);
|
||||||
|
@ -761,7 +761,7 @@ async fn multicall_aggregate() {
|
||||||
|
|
||||||
// string revert
|
// string revert
|
||||||
let string_revert =
|
let string_revert =
|
||||||
reverting_contract.method::<_, H256>("stringRevert", ("String".to_string())).unwrap();
|
reverting_contract.method::<_, H256>("stringRevert", "String".to_string()).unwrap();
|
||||||
multicall.clear_calls().add_call(string_revert, true);
|
multicall.clear_calls().add_call(string_revert, true);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
multicall.call::<(String,)>().await.unwrap_err().as_revert().unwrap()[4..],
|
multicall.call::<(String,)>().await.unwrap_err().as_revert().unwrap()[4..],
|
||||||
|
@ -778,7 +778,7 @@ async fn multicall_aggregate() {
|
||||||
|
|
||||||
// custom error with data revert
|
// custom error with data revert
|
||||||
let custom_error_with_data =
|
let custom_error_with_data =
|
||||||
reverting_contract.method::<_, H256>("customErrorWithData", ("Data".to_string())).unwrap();
|
reverting_contract.method::<_, H256>("customErrorWithData", "Data".to_string()).unwrap();
|
||||||
multicall.clear_calls().add_call(custom_error_with_data, true);
|
multicall.clear_calls().add_call(custom_error_with_data, true);
|
||||||
let err = multicall.call::<(Bytes,)>().await.unwrap_err();
|
let err = multicall.call::<(Bytes,)>().await.unwrap_err();
|
||||||
let bytes = err.as_revert().unwrap();
|
let bytes = err.as_revert().unwrap();
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#![allow(unused_imports)]
|
||||||
|
|
||||||
use ethers_contract::ContractFactory;
|
use ethers_contract::ContractFactory;
|
||||||
use ethers_core::{abi::Abi, types::*, utils::parse_ether};
|
use ethers_core::{abi::Abi, types::*, utils::parse_ether};
|
||||||
use ethers_middleware::signer::SignerMiddleware;
|
use ethers_middleware::signer::SignerMiddleware;
|
||||||
|
|
Loading…
Reference in New Issue