From 6de49c7528db6dd65270ecc753245dfb97ed5887 Mon Sep 17 00:00:00 2001 From: rouzwelt Date: Fri, 24 May 2024 03:23:41 +0000 Subject: [PATCH] Update mod.rs --- src/erc165/mod.rs | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/src/erc165/mod.rs b/src/erc165/mod.rs index db8e111..23968ed 100644 --- a/src/erc165/mod.rs +++ b/src/erc165/mod.rs @@ -137,24 +137,23 @@ mod tests { .send() .await .expect("failed to deploy NonERC165 test contract"); - let contract_address = ethers_address_to_alloy(contract.address()); - assert!(!supports_erc165_check1(&client, contract_address).await); + assert!( + !supports_erc165_check1(&client, ethers_address_to_alloy(contract.address())).await + ); let contract = InvalidERC165::deploy(wallet_signer.clone(), ()) .expect("failed to deploy InvalidERC165 test contract") .send() .await .expect("failed to deploy InvalidERC165 test contract"); - let contract_address = ethers_address_to_alloy(contract.address()); - assert!(supports_erc165_check1(&client, contract_address).await); + assert!(supports_erc165_check1(&client, ethers_address_to_alloy(contract.address())).await); let contract = ERC165Supported::deploy(wallet_signer.clone(), ()) .expect("failed to deploy ERC165Supported test contract") .send() .await .expect("failed to deploy ERC165Supported test contract"); - let contract_address = ethers_address_to_alloy(contract.address()); - assert!(supports_erc165_check1(&client, contract_address).await); + assert!(supports_erc165_check1(&client, ethers_address_to_alloy(contract.address())).await); } #[tokio::test] @@ -175,16 +174,16 @@ mod tests { .send() .await .expect("failed to deploy ERC165Supported test contract"); - let contract_address = ethers_address_to_alloy(contract.address()); - assert!(supports_erc165_check2(&client, contract_address).await); + assert!(supports_erc165_check2(&client, ethers_address_to_alloy(contract.address())).await); let contract = InvalidERC165::deploy(wallet_signer.clone(), ()) .expect("failed to deploy InvalidERC165 test contract") .send() .await .expect("failed to deploy InvalidERC165 test contract"); - let contract_address = ethers_address_to_alloy(contract.address()); - assert!(!supports_erc165_check2(&client, contract_address).await); + assert!( + !supports_erc165_check2(&client, ethers_address_to_alloy(contract.address())).await + ); } #[tokio::test] @@ -205,23 +204,20 @@ mod tests { .send() .await .expect("failed to deploy NonERC165 test contract"); - let contract_address = ethers_address_to_alloy(contract.address()); - assert!(!supports_erc165(&client, contract_address).await); + assert!(!supports_erc165(&client, ethers_address_to_alloy(contract.address())).await); let contract = InvalidERC165::deploy(wallet_signer.clone(), ()) .expect("failed to deploy InvalidERC165 test contract") .send() .await .expect("failed to deploy InvalidERC165 test contract"); - let contract_address = ethers_address_to_alloy(contract.address()); - assert!(!supports_erc165(&client, contract_address).await); + assert!(!supports_erc165(&client, ethers_address_to_alloy(contract.address())).await); let contract = ERC165Supported::deploy(wallet_signer.clone(), ()) .expect("failed to deploy ERC165Supported test contract") .send() .await .expect("failed to deploy ERC165Supported test contract"); - let contract_address = ethers_address_to_alloy(contract.address()); - assert!(supports_erc165(&client, contract_address).await); + assert!(supports_erc165(&client, ethers_address_to_alloy(contract.address())).await); } }