Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
5 changes: 3 additions & 2 deletions tests/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
// along with Substrate. If not, see <http://www.gnu.org/licenses/>.

use polkadot_core_primitives::Block;
use remote_externalities::rpc_api::get_finalized_head;
use remote_externalities::rpc_api::RpcService;
use std::{
io::{BufRead, BufReader, Read},
process::{Child, ExitStatus},
Expand Down Expand Up @@ -54,9 +54,10 @@ pub async fn wait_n_finalized_blocks(
async fn wait_n_finalized_blocks_from(n: usize, url: &str) {
let mut built_blocks = std::collections::HashSet::new();
let mut interval = tokio::time::interval(Duration::from_secs(6));
let mut rpc_service = RpcService::new(url, false);

loop {
if let Ok(block) = get_finalized_head::<Block, _>(url).await {
if let Ok(block) = rpc_service.get_finalized_head::<Block>().await {
built_blocks.insert(block);
if built_blocks.len() > n {
break
Expand Down