-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also corrects links pointing to branches to point to commits.
- Loading branch information
1 parent
ba657e2
commit 70fe524
Showing
3 changed files
with
23 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
use std::sync::OnceLock; | ||
use tokio::sync::Mutex; | ||
|
||
use monero_address::{Network, MoneroAddress}; | ||
|
||
// monero-rpc doesn't include a transport | ||
// We can't include the simple-request crate there as then we'd have a cyclical dependency | ||
// Accordingly, we test monero-rpc here (implicitly testing the simple-request transport) | ||
use monero_simple_request_rpc::*; | ||
|
||
static SEQUENTIAL: OnceLock<Mutex<()>> = OnceLock::new(); | ||
|
||
const ADDRESS: &str = | ||
"4B33mFPMq6mKi7Eiyd5XuyKRVMGVZz1Rqb9ZTyGApXW5d1aT7UBDZ89ewmnWFkzJ5wPd2SFbn313vCT8a4E2Qf4KQH4pNey"; | ||
|
||
#[tokio::test] | ||
async fn test_rpc() { | ||
use monero_rpc::Rpc; | ||
|
||
let guard = SEQUENTIAL.get_or_init(|| Mutex::new(())).lock().await; | ||
|
||
let rpc = | ||
SimpleRequestRpc::new("http://serai:[email protected]:18081".to_string()).await.unwrap(); | ||
|
||
|
@@ -53,12 +60,16 @@ async fn test_rpc() { | |
} | ||
assert_eq!(blocks, actual_blocks); | ||
} | ||
|
||
drop(guard); | ||
} | ||
|
||
#[tokio::test] | ||
async fn test_decoy_rpc() { | ||
use monero_rpc::{Rpc, DecoyRpc}; | ||
|
||
let guard = SEQUENTIAL.get_or_init(|| Mutex::new(())).lock().await; | ||
|
||
let rpc = | ||
SimpleRequestRpc::new("http://serai:[email protected]:18081".to_string()).await.unwrap(); | ||
|
||
|
@@ -101,6 +112,8 @@ async fn test_decoy_rpc() { | |
#[allow(clippy::reversed_empty_ranges)] | ||
rpc.get_output_distribution(1 .. 0).await.unwrap_err(); | ||
} | ||
|
||
drop(guard); | ||
} | ||
|
||
// This test passes yet requires a mainnet node, which we don't have reliable access to in CI. | ||
|
@@ -109,6 +122,8 @@ async fn test_decoy_rpc() { | |
async fn test_zero_out_tx_o_indexes() { | ||
use monero_rpc::Rpc; | ||
let guard = SEQUENTIAL.get_or_init(|| Mutex::new(())).lock().await; | ||
let rpc = SimpleRequestRpc::new("https://node.sethforprivacy.com".to_string()).await.unwrap(); | ||
assert_eq!( | ||
|
@@ -123,5 +138,7 @@ async fn test_zero_out_tx_o_indexes() { | |
.unwrap(), | ||
Vec::<u64>::new() | ||
); | ||
drop(guard); | ||
} | ||
*/ |
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