From 87df8d9ab88407538580e9cb462971b77421f40e Mon Sep 17 00:00:00 2001 From: tyleroooo Date: Thu, 17 Oct 2024 16:59:41 -0400 Subject: [PATCH] fix: more epsilon (#718) --- build.gradle.kts | 2 +- .../functional/vault/VaultDepositWithdrawForm.kt | 4 ++-- v4_abacus.podspec | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 01031b203..a81f4c759 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -52,7 +52,7 @@ allprojects { } group = "exchange.dydx.abacus" -version = "1.13.1" +version = "1.13.2" repositories { google() diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/functional/vault/VaultDepositWithdrawForm.kt b/src/commonMain/kotlin/exchange.dydx.abacus/functional/vault/VaultDepositWithdrawForm.kt index ee8310442..d33ef5c88 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/functional/vault/VaultDepositWithdrawForm.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/functional/vault/VaultDepositWithdrawForm.kt @@ -256,7 +256,7 @@ object VaultDepositWithdrawFormValidator { } val amountToUse = if (vaultAccount?.withdrawableUsdc != null && - vaultAccount.withdrawableUsdc - amount >= 0 && + vaultAccount.withdrawableUsdc - amount >= -EPSILON_FOR_ERRORS && vaultAccount.withdrawableUsdc - amount <= 0.01 ) { vaultAccount.withdrawableUsdc @@ -393,7 +393,7 @@ object VaultDepositWithdrawFormValidator { } } if (postOpVaultBalance >= -EPSILON_FOR_ERRORS && amount > 0 && - vaultAccount?.withdrawableUsdc != null && amount > vaultAccount.withdrawableUsdc + vaultAccount?.withdrawableUsdc != null && vaultAccount.withdrawableUsdc - amount < -EPSILON_FOR_ERRORS ) { errors.add(vaultFormValidationErrors.withdrawingLockedBalance()) } diff --git a/v4_abacus.podspec b/v4_abacus.podspec index 7ebef41d5..63934d6a3 100644 --- a/v4_abacus.podspec +++ b/v4_abacus.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'v4_abacus' - spec.version = '1.13.1' + spec.version = '1.13.2' spec.homepage = 'https://github.com/dydxprotocol/v4-abacus' spec.source = { :http=> ''} spec.authors = ''