-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ed9ad6e
commit 3e02d2f
Showing
3 changed files
with
81 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
mod error; | ||
|
||
pub mod explorer_client; | ||
pub mod rpc_node_client; | ||
pub mod server_nodes_manager; | ||
pub mod signer; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#![cfg(feature = "enable-integration-tests")] | ||
use assert_matches::assert_matches; | ||
use chrono::Utc; | ||
use ethereum_types::Address; | ||
|
||
use airdao_gov_user_verifier::explorer_client::{ExplorerClient, ExplorerConfig}; | ||
|
||
#[tokio::test] | ||
async fn test_find_first_transaction_before() -> Result<(), anyhow::Error> { | ||
let client = ExplorerClient::new(ExplorerConfig { | ||
url: "https://explorer-v2-api.ambrosus.io/v2/addresses/".to_owned(), | ||
timeout: std::time::Duration::from_secs(10), | ||
})?; | ||
|
||
let wallet = Address::from( | ||
<[u8; 20]>::try_from(hex::decode("aeE13A8db3e216A364255EFEbA171ce329100876")?).map_err( | ||
|failed_data| { | ||
anyhow::format_err!("Failed to deserialize Address from: {failed_data:?}") | ||
}, | ||
)?, | ||
); | ||
let tx = client | ||
.find_first_transaction_before(wallet, Utc::now()) | ||
.await; | ||
assert_matches!(tx, Ok(Some(_))); | ||
|
||
Ok(()) | ||
} |