Skip to content

Commit 9b10259

Browse files
committed
update logs
1 parent 4c78b4b commit 9b10259

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

crates/core/src/background_tasks/automatic_top_up_task.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -694,7 +694,7 @@ impl AutomaticTopUpTask {
694694

695695
if balance < min_required_balance {
696696
warn!(
697-
"From address {} balance ({} ETH) is insufficient for top-up transaction. Required: {} ETH (top-up: {} ETH + gas: {} ETH) - total_relayers_to_top_up {}",
697+
"From address {} balance ({} ETH) is insufficient for top-up transaction. Required: {} ETH (top-up: {} ETH + gas: {} ETH) for {} ETH transfers",
698698
from_address,
699699
format_wei_to_eth(&balance),
700700
format_wei_to_eth(&min_required_balance),
@@ -809,10 +809,10 @@ impl AutomaticTopUpTask {
809809
token_config: &Erc20TokenConfig,
810810
total_relayers_to_top_up: usize,
811811
) -> Result<bool, String> {
812-
let token_balance =
813-
self.get_erc20_balance(provider, &token_config.address, from_address)
814-
.await
815-
.map_err(|e| format!("Failed to get from_address ERC-20 token balance: {}", e))?;
812+
let token_balance = self
813+
.get_erc20_balance(provider, &token_config.address, from_address)
814+
.await
815+
.map_err(|e| format!("Failed to get from_address ERC-20 token balance: {}", e))?;
816816

817817
info!(
818818
"From address {} has ERC-20 token balance: {} for token {}",
@@ -821,11 +821,10 @@ impl AutomaticTopUpTask {
821821
token_config.address
822822
);
823823

824-
let native_balance = provider
825-
.rpc_client()
826-
.get_balance((*from_address).into())
827-
.await
828-
.map_err(|e| format!("Failed to get from_address native balance for gas check: {}", e))?;
824+
let native_balance =
825+
provider.rpc_client().get_balance((*from_address).into()).await.map_err(|e| {
826+
format!("Failed to get from_address native balance for gas check: {}", e)
827+
})?;
829828

830829
info!(
831830
"From address {} has native balance: {} ETH for gas",
@@ -842,7 +841,8 @@ impl AutomaticTopUpTask {
842841

843842
let total_gas_required = estimated_gas_cost * U256::from(total_relayers_to_top_up);
844843

845-
let total_tokens_required = token_config.top_up_amount * U256::from(total_relayers_to_top_up);
844+
let total_tokens_required =
845+
token_config.top_up_amount * U256::from(total_relayers_to_top_up);
846846

847847
info!(
848848
"From address {} requires {} ETH for gas and {} tokens for {} top-ups",
@@ -865,7 +865,7 @@ impl AutomaticTopUpTask {
865865

866866
if token_balance < total_tokens_required {
867867
warn!(
868-
"From address {} token balance ({}) is insufficient for top-up transactions. Required: {} for token {} - total_relayers_to_top_up {}",
868+
"From address {} token balance ({}) is insufficient for top-up transactions. Required: {} for token {} for {} ERC-20 transactions",
869869
from_address,
870870
format_token_amount(&token_balance, token_config.decimals),
871871
format_token_amount(&total_tokens_required, token_config.decimals),

0 commit comments

Comments
 (0)