Skip to content

Commit

Permalink
refac: remove unused or unnecessary StratusError variants (#1839)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcospb19-cw authored Nov 1, 2024
1 parent 0daacb7 commit 75fc79a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
8 changes: 0 additions & 8 deletions src/eth/primitives/stratus_error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,6 @@ pub enum StratusError {
// -------------------------------------------------------------------------
// Miner
// -------------------------------------------------------------------------
#[error("Requested miner mode conflicts with current miner mode.")]
#[strum(props(kind = "internal"))]
MinerModeConflict,

#[error("Miner mode change to ({miner_mode}) is unsupported.")]
#[strum(props(kind = "internal"))]
MinerModeChangeUnsupported { miner_mode: &'static str },

#[error("Miner mode param is invalid.")]
#[strum(props(kind = "internal"))]
MinerModeParamInvalid,
Expand Down
3 changes: 1 addition & 2 deletions src/eth/rpc/rpc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -518,8 +518,7 @@ async fn change_miner_mode(new_mode: MinerMode, ctx: &RpcContext) -> Result<Json
ctx.miner.start_interval_mining(duration).await;
}
MinerMode::Automine => {
tracing::error!("automine mode is not supported");
return Err(StratusError::MinerModeChangeUnsupported { miner_mode: "automine" });
return log_and_err!("Miner mode change to 'automine' is unsupported.").map_err(Into::into);
}
}

Expand Down

0 comments on commit 75fc79a

Please sign in to comment.