From 0694383e93e466fa0605bba199da3a089dc23756 Mon Sep 17 00:00:00 2001 From: Stanislav Eliseev Date: Tue, 21 Jan 2025 19:07:41 +0100 Subject: [PATCH] fix: add temporary solution for fees --- src/core/token_wallet/mod.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/core/token_wallet/mod.rs b/src/core/token_wallet/mod.rs index c8240dc5..d30d9448 100644 --- a/src/core/token_wallet/mod.rs +++ b/src/core/token_wallet/mod.rs @@ -1,4 +1,5 @@ use std::convert::TryFrom; +use std::ops::Shr; use std::sync::Arc; use crate::core::models::*; @@ -247,9 +248,15 @@ impl TokenWallet { most_recent_bit_price }; - Ok(30000u64 - .saturating_mul(gas_config.gas_price) - .saturating_add(100_000_000u64.saturating_mul(storage_fees))) + let fees = if storage_fees > 1 { + 600_000_000u64 + } else { + 30000u64 + .saturating_mul(gas_config.gas_price.shr(16)) + .saturating_add(100_000_000u64.saturating_mul(storage_fees)) + }; + + Ok(fees) } pub async fn prepare_transfer(