Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moved time related utils to testing utils
- Loading branch information
Showing
3 changed files
with
25 additions
and
23 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 |
---|---|---|
|
@@ -4,6 +4,7 @@ pub mod grpc; | |
mod legacy; | ||
mod logger; | ||
mod rest; | ||
pub mod time; | ||
mod verifier; | ||
|
||
pub mod explorer; | ||
|
21 changes: 21 additions & 0 deletions
21
testing/jormungandr-testing-utils/src/testing/node/time.rs
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,21 @@ | ||
use crate::testing::node::explorer::Explorer; | ||
|
||
pub fn wait_for_epoch(epoch_id: u64, mut explorer: Explorer) { | ||
explorer.enable_logs(); | ||
while explorer | ||
.status() | ||
.unwrap() | ||
.data | ||
.unwrap() | ||
.status | ||
.latest_block | ||
.date | ||
.epoch | ||
.id | ||
.parse::<u64>() | ||
.unwrap() | ||
< epoch_id | ||
{ | ||
std::thread::sleep(std::time::Duration::from_secs(1)); | ||
} | ||
} |