From a46536bc9cf5fd73b002705e31f501d22c5dd693 Mon Sep 17 00:00:00 2001 From: Brian Monroy Date: Thu, 14 Dec 2023 20:06:36 -0300 Subject: [PATCH] fix: delete isRebalancingEnable for addOrDiscardWalletIfRequired --- src/chain-wallet-manager.ts | 1 - src/wallets/wallet-pool.ts | 5 +---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/chain-wallet-manager.ts b/src/chain-wallet-manager.ts index bd5ff0f..de4e24d 100644 --- a/src/chain-wallet-manager.ts +++ b/src/chain-wallet-manager.ts @@ -274,7 +274,6 @@ export class ChainWalletManager { for (const balance of balances) { this.walletPool.addOrDiscardWalletIfRequired( - isRebalancingEnabled, balance.address, balance, minBalanceThreshold, diff --git a/src/wallets/wallet-pool.ts b/src/wallets/wallet-pool.ts index 0cbb9a1..2e57085 100644 --- a/src/wallets/wallet-pool.ts +++ b/src/wallets/wallet-pool.ts @@ -8,7 +8,6 @@ export interface WalletPool { discardWalletFromPool(wallet: string): void; addWalletBackToPoolIfRequired(wallet: string): void; addOrDiscardWalletIfRequired( - isRebalancingEnabled: boolean, address: string, balance: WalletBalance, minBalanceThreshold: number, @@ -46,7 +45,6 @@ export class LocalWalletPool implements WalletPool { } } - // TODO: AddOrDiscard wallets when calling this method private async acquire(resourceId?: string): Promise { const resource = resourceId ? this.resources[resourceId].resource @@ -70,7 +68,6 @@ export class LocalWalletPool implements WalletPool { * @returns true if there is enough balance on the wallet, false otherwise */ public addOrDiscardWalletIfRequired( - isRebalancingEnabled: boolean, address: string, balance: WalletBalance, minBalanceThreshold: number, @@ -78,7 +75,7 @@ export class LocalWalletPool implements WalletPool { const isEnoughWalletBalance = Number(balance.formattedBalance) >= minBalanceThreshold; - if (isRebalancingEnabled && balance.isNative) { + if (balance.isNative) { if (isEnoughWalletBalance) { // set's the discarded flag on the wallet to false this.addWalletBackToPoolIfRequired(address);