@@ -807,7 +807,7 @@ async fn test_remove_then_update(ctx: TestContext) -> anyhow::Result<()> {
807
807
}
808
808
809
809
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 > {
811
811
const FETCH_BLOCK_HASH : & str = r#"
812
812
query blockHashFromNumber($network: String!, $blockNumber: Int!) {
813
813
hash: blockHashFromNumber(
@@ -843,10 +843,10 @@ async fn test_subgraph_grafting(ctx: TestContext) -> anyhow::Result<()> {
843
843
] ;
844
844
845
845
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 ( ) ;
847
847
// 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.
850
850
assert_eq ! ( block_hash, block_hashes[ ( i - 1 ) as usize ] ) ;
851
851
852
852
const FETCH_POI : & str = r#"
@@ -1004,6 +1004,7 @@ async fn test_multiple_subgraph_datasources(ctx: TestContext) -> anyhow::Result<
1004
1004
async fn wait_for_blockchain_block ( block_number : i32 ) -> bool {
1005
1005
// Wait up to 5 minutes for the expected block to appear
1006
1006
const STATUS_WAIT : Duration = Duration :: from_secs ( 300 ) ;
1007
+ const REQUEST_REPEATING : Duration = time:: Duration :: from_secs ( 1 ) ;
1007
1008
let start = Instant :: now ( ) ;
1008
1009
while start. elapsed ( ) < STATUS_WAIT {
1009
1010
let latest_block = Contract :: latest_block ( ) . await ;
@@ -1014,8 +1015,7 @@ async fn wait_for_blockchain_block(block_number: i32) -> bool {
1014
1015
}
1015
1016
}
1016
1017
}
1017
- let one_sec = time:: Duration :: from_secs ( 1 ) ;
1018
- thread:: sleep ( one_sec) ;
1018
+ tokio:: time:: sleep ( REQUEST_REPEATING ) . await ;
1019
1019
}
1020
1020
false
1021
1021
}
0 commit comments