remote-externalities: retry get child keys query (#4280)

This commit is contained in:
Liam Aharon
2024-04-25 22:01:05 +10:00
committed by GitHub
parent c26cf3f6f2
commit ff2b178206
@@ -830,19 +830,22 @@ where
child_prefix: StorageKey, child_prefix: StorageKey,
at: B::Hash, at: B::Hash,
) -> Result<Vec<StorageKey>, &'static str> { ) -> Result<Vec<StorageKey>, &'static str> {
// This is deprecated and will generate a warning which causes the CI to fail. let retry_strategy =
#[allow(warnings)] FixedInterval::new(Self::KEYS_PAGE_RETRY_INTERVAL).take(Self::MAX_RETRIES);
let child_keys = substrate_rpc_client::ChildStateApi::storage_keys( let get_child_keys_closure = || {
client, #[allow(deprecated)]
PrefixedStorageKey::new(prefixed_top_key.as_ref().to_vec()), substrate_rpc_client::ChildStateApi::storage_keys(
child_prefix, client,
Some(at), PrefixedStorageKey::new(prefixed_top_key.as_ref().to_vec()),
) child_prefix.clone(),
.await Some(at),
.map_err(|e| { )
error!(target: LOG_TARGET, "Error = {:?}", e); };
"rpc child_get_keys failed." let child_keys =
})?; Retry::spawn(retry_strategy, get_child_keys_closure).await.map_err(|e| {
error!(target: LOG_TARGET, "Error = {:?}", e);
"rpc child_get_keys failed."
})?;
debug!( debug!(
target: LOG_TARGET, target: LOG_TARGET,