Skip to content

Commit 7edfa82

Browse files
author
Zoran Cvetkov
committed
address review comments
1 parent 0c5b0e8 commit 7edfa82

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

tests/tests/integration_tests.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ async fn test_remove_then_update(ctx: TestContext) -> anyhow::Result<()> {
807807
}
808808

809809
async fn test_subgraph_grafting(ctx: TestContext) -> anyhow::Result<()> {
810-
async fn get_bloock_hash(block_number: i32) -> Option<String> {
810+
async fn get_block_hash(block_number: i32) -> Option<String> {
811811
const FETCH_BLOCK_HASH: &str = r#"
812812
query blockHashFromNumber($network: String!, $blockNumber: Int!) {
813813
hash: blockHashFromNumber(
@@ -843,10 +843,10 @@ async fn test_subgraph_grafting(ctx: TestContext) -> anyhow::Result<()> {
843843
];
844844

845845
for i in 1..4 {
846-
let block_hash = get_bloock_hash(i).await.unwrap();
846+
let block_hash = get_block_hash(i).await.unwrap();
847847
// We need to make sure that the preconditions for POI are fulfiled
848-
// namely that the anvil produces the proper block hashes for the
849-
// blocks of which we will check the POI
848+
// namely that the blockchain produced the proper block hashes for the
849+
// blocks of which we will check the POI.
850850
assert_eq!(block_hash, block_hashes[(i - 1) as usize]);
851851

852852
const FETCH_POI: &str = r#"
@@ -1004,6 +1004,7 @@ async fn test_multiple_subgraph_datasources(ctx: TestContext) -> anyhow::Result<
10041004
async fn wait_for_blockchain_block(block_number: i32) -> bool {
10051005
// Wait up to 5 minutes for the expected block to appear
10061006
const STATUS_WAIT: Duration = Duration::from_secs(300);
1007+
const REQUEST_REPEATING: Duration = time::Duration::from_secs(1);
10071008
let start = Instant::now();
10081009
while start.elapsed() < STATUS_WAIT {
10091010
let latest_block = Contract::latest_block().await;
@@ -1014,8 +1015,7 @@ async fn wait_for_blockchain_block(block_number: i32) -> bool {
10141015
}
10151016
}
10161017
}
1017-
let one_sec = time::Duration::from_secs(1);
1018-
thread::sleep(one_sec);
1018+
tokio::time::sleep(REQUEST_REPEATING).await;
10191019
}
10201020
false
10211021
}

0 commit comments

Comments
 (0)