Skip to content

Commit ef4d09d

Browse files
fix(bug): fix staking console log (#480)
Co-authored-by: varun-doshi <doshivarun202@gmail.com>
1 parent fb971e6 commit ef4d09d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

crates/worker/src/operations/provider.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ impl ProviderOperations {
239239
}
240240
if !self.prompt_user_confirmation(&format!(
241241
"Do you want to approve staking {}?",
242-
stake / U256::from(10u128.pow(18))
242+
stake.to_string().parse::<f64>().unwrap_or(0.0) / 10f64.powf(18.0)
243243
)) {
244244
Console::info("Operation cancelled by user", "Staking approval declined");
245245
return Err(ProviderError::UserCancelled);
@@ -290,7 +290,7 @@ impl ProviderOperations {
290290
}
291291
if !self.prompt_user_confirmation(&format!(
292292
"Do you want to approve staking {}?",
293-
stake / U256::from(10u128.pow(18))
293+
stake.to_string().parse::<f64>().unwrap_or(0.0) / 10f64.powf(18.0)
294294
)) {
295295
Console::info("Operation cancelled by user", "Staking approval declined");
296296
return Err(ProviderError::UserCancelled);
@@ -365,7 +365,7 @@ impl ProviderOperations {
365365

366366
if !self.prompt_user_confirmation(&format!(
367367
"Do you want to approve staking {} additional funds?",
368-
additional_stake / U256::from(10u128.pow(18))
368+
additional_stake.to_string().parse::<f64>().unwrap_or(0.0) / 10f64.powf(18.0)
369369
)) {
370370
Console::info("Operation cancelled by user", "Staking approval declined");
371371
return Err(ProviderError::UserCancelled);

0 commit comments

Comments
 (0)