|
1 | 1 | use {
|
2 | 2 | crate::auth::cacao::CacaoError,
|
3 |
| - alloy_primitives::Address, |
4 |
| - alloy_provider::{network::Ethereum, Provider, ReqwestProvider}, |
5 |
| - alloy_rpc_types::{TransactionInput, TransactionRequest}, |
6 |
| - alloy_sol_types::{sol, SolConstructor}, |
| 3 | + alloy::{ |
| 4 | + primitives::Address, |
| 5 | + providers::{network::Ethereum, Provider, ReqwestProvider}, |
| 6 | + rpc::types::{TransactionInput, TransactionRequest}, |
| 7 | + sol, |
| 8 | + sol_types::SolConstructor, |
| 9 | + }, |
7 | 10 | url::Url,
|
8 | 11 | };
|
9 | 12 |
|
@@ -42,20 +45,17 @@ pub async fn verify_eip6492(
|
42 | 45 | let transaction_request =
|
43 | 46 | TransactionRequest::default().input(TransactionInput::new(bytes.into()));
|
44 | 47 |
|
45 |
| - let result = provider |
46 |
| - .call(&transaction_request, Default::default()) |
47 |
| - .await |
48 |
| - .map_err(|e| { |
49 |
| - if let Some(error_response) = e.as_error_resp() { |
50 |
| - if error_response.message == "execution reverted" { |
51 |
| - CacaoError::Verification |
52 |
| - } else { |
53 |
| - CacaoError::Eip6492Internal(e) |
54 |
| - } |
| 48 | + let result = provider.call(&transaction_request).await.map_err(|e| { |
| 49 | + if let Some(error_response) = e.as_error_resp() { |
| 50 | + if error_response.message == "execution reverted" { |
| 51 | + CacaoError::Verification |
55 | 52 | } else {
|
56 | 53 | CacaoError::Eip6492Internal(e)
|
57 | 54 | }
|
58 |
| - })?; |
| 55 | + } else { |
| 56 | + CacaoError::Eip6492Internal(e) |
| 57 | + } |
| 58 | + })?; |
59 | 59 |
|
60 | 60 | let magic = result.first();
|
61 | 61 | if let Some(magic) = magic {
|
@@ -84,8 +84,10 @@ mod test {
|
84 | 84 | EIP1271_MOCK_CONTRACT,
|
85 | 85 | },
|
86 | 86 | },
|
87 |
| - alloy_primitives::{address, b256, Uint}, |
88 |
| - alloy_sol_types::{SolCall, SolValue}, |
| 87 | + alloy::{ |
| 88 | + primitives::{address, b256, Uint}, |
| 89 | + sol_types::{SolCall, SolValue}, |
| 90 | + }, |
89 | 91 | k256::ecdsa::SigningKey,
|
90 | 92 | };
|
91 | 93 |
|
|
0 commit comments