Skip to content

Commit

Permalink
Merge pull request #3094 from autonomys/improve-pot-seed-handling
Browse files Browse the repository at this point in the history
Treat `potExternalEntropy: null` in chain spec as missing value
  • Loading branch information
nazar-pc authored Oct 3, 2024
2 parents ab8384a + 041378f commit 714f952
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/subspace-node/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,13 +106,14 @@ fn derive_pot_external_entropy(
.properties()
.get("potExternalEntropy")
.map(|d| match d.clone() {
Value::String(s) => Ok(s),
Value::Null => Ok(String::new()),
Value::String(s) => Ok(Some(s)),
Value::Null => Ok(None),
_ => Err(sc_service::Error::Other(
"Failed to decode PoT initial key".to_string(),
)),
})
.transpose()?;
.transpose()?
.flatten();
if maybe_chain_spec_pot_external_entropy.is_some()
&& maybe_pot_external_entropy.is_some()
&& maybe_chain_spec_pot_external_entropy != maybe_pot_external_entropy
Expand Down

0 comments on commit 714f952

Please sign in to comment.