Skip to content

Commit

Permalink
tests: grab history as part of test_client setup
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuef committed Jun 21, 2021
1 parent f5d0b81 commit 91fccd2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/client/utils/test_utils/test_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

use super::read_network_conn_info;
use crate::client::Client;
use crate::retry_loop_for_pattern;
use crate::types::{Keypair, Token};
use crate::{retry_loop, retry_loop_for_pattern};
use anyhow::Result;
use std::str::FromStr;
use std::sync::Once;
Expand Down Expand Up @@ -43,6 +43,8 @@ pub async fn create_test_client_with(optional_keypair: Option<Keypair>) -> Resul
let client = Client::new(optional_keypair.clone(), None, Some(contact_info)).await?;

if optional_keypair.is_none() {
// get history, will only be Ok when we have _some_ history, aka test tokens
retry_loop!(client.get_history());
// check we have some balance, 10 test coins
let _ = retry_loop_for_pattern!(client.get_balance(),
Ok(balance) if *balance == Token::from_str("10")?)?;
Expand Down

0 comments on commit 91fccd2

Please sign in to comment.