Skip to content

Commit

Permalink
Fix clippy errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Nexus2k authored Nov 30, 2023
1 parent 5338eb3 commit b659cf0
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions standalone/prb/src/worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -539,26 +539,19 @@ impl WorkerContext {
vec![Value::from_bytes(worker_binding.as_ref().unwrap())],
);
let stake_onchain: Option<u128> = fetch_storage_bytes(&api, &stake_query).await?;
match stake_onchain {
Some(onchain_stake) => {
info!(
"Stake: {:?}, {:?} on-chain",
&worker.stake.parse::<u128>().unwrap(),
&onchain_stake
);
match onchain_stake {
onchain_stake if onchain_stake < worker.stake.parse::<u128>().unwrap() => {
set_worker_message!(c, "Adjusting on-chain stake...");
txm.clone().restart_computing(pid, pubkey, worker.stake).await?;
Self::set_state(c.clone(), WorkerLifecycleState::Working).await;
}
onchain_stake if onchain_stake > worker.stake.parse::<u128>().unwrap() => {
set_worker_message!(c, "Error on-chain stake higher, than configured...");
}
_ => (),
}
if let Some(onchain_stake) = stake_onchain {
info!("Stake: {:?}, {:?} on-chain", &worker.stake.parse::<u128>().unwrap(), &onchain_stake);
match onchain_stake {
onchain_stake if onchain_stake < worker.stake.parse::<u128>().unwrap() => {
set_worker_message!(c, "Adjusting on-chain stake...");
txm.clone().restart_computing(pid, pubkey, worker.stake).await?;
Self::set_state(c.clone(), WorkerLifecycleState::Working).await;
}
onchain_stake if onchain_stake > worker.stake.parse::<u128>().unwrap() => {
set_worker_message!(c, "Error on-chain stake higher, than configured...");
}
_ => (),
}
None => (),
}
first_run = false;
}
Expand Down

0 comments on commit b659cf0

Please sign in to comment.