Skip to content

Commit

Permalink
fix secret storage initial value read (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppca authored Jul 8, 2024
1 parent 8f3671e commit 92055e1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion chain-signatures/node/src/storage/secret_storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,14 @@ impl SecretNodeStorage for SecretManagerNodeStorage {
.load_secret(&self.sk_share_secret_id)
.await?;
match raw_data {
Some(data) if data.len() > 1 => Ok(Some(serde_json::from_slice(&data)?)),
Some(data) if data.len() > 1 => {
if let Ok(persistent_node_data) = serde_json::from_slice(&data) {
Ok(Some(persistent_node_data))
} else {
tracing::info!("failed to convert stored data to key share, presuming it is missing");
Ok(None)
}
},
_ => {
tracing::info!("failed to load existing key share, presuming it is missing");
Ok(None)
Expand Down

0 comments on commit 92055e1

Please sign in to comment.