mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 04:07:57 +00:00
Companion for: try-runtime::follow-chain - keep connection (#5968)
* Adjust to the new API
* Remove mutability
* Async constructor
* unwrap result
* do not panic
* suggestion
* leftover
* update lockfile for {"substrate"}
Co-authored-by: parity-processbot <>
This commit is contained in:
committed by
GitHub
parent
293ff64fd0
commit
5c843b3015
@@ -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},
|
||||
@@ -56,7 +56,12 @@ async fn wait_n_finalized_blocks_from(n: usize, url: &str) {
|
||||
let mut interval = tokio::time::interval(Duration::from_secs(6));
|
||||
|
||||
loop {
|
||||
if let Ok(block) = get_finalized_head::<Block, _>(url).await {
|
||||
let rpc_service = match RpcService::new(url, false).await {
|
||||
Ok(rpc_service) => rpc_service,
|
||||
Err(_) => continue,
|
||||
};
|
||||
|
||||
if let Ok(block) = rpc_service.get_finalized_head::<Block>().await {
|
||||
built_blocks.insert(block);
|
||||
if built_blocks.len() > n {
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user