aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/utils/exchange_transfer_simulator.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/exchange_transfer_simulator.ts b/src/utils/exchange_transfer_simulator.ts
index 71a9ed212..db12abd29 100644
--- a/src/utils/exchange_transfer_simulator.ts
+++ b/src/utils/exchange_transfer_simulator.ts
@@ -96,12 +96,12 @@ export class ExchangeTransferSimulator extends BalanceAndProxyAllowanceLazyStore
transferType: TransferType): Promise<void> {
const balance = await this.getBalanceAsync(tokenAddress, from);
const proxyAllowance = await this.getProxyAllowanceAsync(tokenAddress, from);
- if (balance.lessThan(amountInBaseUnits)) {
- this.throwValidationError(FailureReason.Balance, tradeSide, transferType);
- }
if (proxyAllowance.lessThan(amountInBaseUnits)) {
this.throwValidationError(FailureReason.ProxyAllowance, tradeSide, transferType);
}
+ if (balance.lessThan(amountInBaseUnits)) {
+ this.throwValidationError(FailureReason.Balance, tradeSide, transferType);
+ }
await this.decreaseProxyAllowanceAsync(tokenAddress, from, amountInBaseUnits);
await this.decreaseBalanceAsync(tokenAddress, from, amountInBaseUnits);
await this.increaseBalanceAsync(tokenAddress, to, amountInBaseUnits);