Skip to content

Commit

Permalink
fix: add a proper error message for invalid number
Browse files Browse the repository at this point in the history
  • Loading branch information
th7nder committed Jan 3, 2025
1 parent 87ce7fe commit ebf3dc7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions storage-provider/server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ pub enum ServerError {
#[error("proof sectors sizes do not match")]
SectorSizeMismatch,

#[error("at least 1 prove commit should be running in parallel")]
InvalidNumberOfParallelProveCommits,

#[error("failed to load PoRep parameters from: {0}, because: {1}")]
InvalidPoRepParameters(std::path::PathBuf, porep::PoRepError),

Expand Down Expand Up @@ -296,6 +299,10 @@ impl TryFrom<ServerArguments> for ServerConfiguration {
return Err(ServerError::SectorSizeMismatch);
}

if value.parallel_prove_commits < 1 {
return Err(ServerError::InvalidNumberOfParallelProveCommits);
}

let multi_pair_signer = MultiPairSigner::new(
value.sr25519_key.map(DebugPair::<Sr25519Pair>::into_inner),
value.ecdsa_key.map(DebugPair::<ECDSAPair>::into_inner),
Expand Down

0 comments on commit ebf3dc7

Please sign in to comment.