Skip to content
This repository has been archived by the owner on Feb 21, 2024. It is now read-only.

Commit

Permalink
Minor cleanup around secret key
Browse files Browse the repository at this point in the history
  • Loading branch information
nazar-pc committed Nov 30, 2021
1 parent e18a9b3 commit 4c15730
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/sc-consensus-subspace/src/slot_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,6 @@ where
}
};

let secret_key = SecretKey::from_bytes(&secret_key).ok()?;

match verification::verify_solution::<B>(
&solution,
verification::VerifySolutionParams {
Expand All @@ -253,7 +251,10 @@ where
Ok(_) => {
debug!(target: "subspace", "Claimed slot {}", slot);

return Some((PreDigest { solution, slot }, secret_key.into()));
return Some((
PreDigest { solution, slot },
SecretKey::from_bytes(&secret_key).ok()?.into(),
));
}
Err(error) => {
warn!(target: "subspace", "Invalid solution received for slot {}: {:?}", slot, error);
Expand Down

0 comments on commit 4c15730

Please sign in to comment.