From 6878242e120d3135d3bc1bb94135d7135693069b Mon Sep 17 00:00:00 2001 From: glihm Date: Mon, 12 Aug 2024 22:11:07 -0400 Subject: [PATCH] fix: ensure slot hidden accounts are skipped --- crates/sozo/ops/src/migration/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/crates/sozo/ops/src/migration/mod.rs b/crates/sozo/ops/src/migration/mod.rs index e6d913d93a..cca4e5b0c0 100644 --- a/crates/sozo/ops/src/migration/mod.rs +++ b/crates/sozo/ops/src/migration/mod.rs @@ -84,7 +84,14 @@ async fn get_declarers_accounts( for a in vals { let address = a["address"].as_str().unwrap(); - let private_key = a["privateKey"].as_str().unwrap(); + + // On slot, some accounts are hidden, we skip them. + let private_key = if let Some(pk) = a["privateKey"].as_str() { + pk + } else { + continue; + }; + let provider = AnyProvider::JsonRpcHttp(JsonRpcClient::new(HttpTransport::new( Url::parse(rpc_url).unwrap(), )));