Skip to content

Commit

Permalink
[SPT-873] fixed types of data in _fundEscrowAccount
Browse files Browse the repository at this point in the history
  • Loading branch information
Marina Fedyantseva committed Feb 20, 2025
1 parent 9d2993f commit b2257b0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/core/src/MPEContract.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,10 @@ class MPEContract {
async _fundEscrowAccount(account, amountInCogs) {
const address = await account.getAddress();
let currentEscrowBalance = await this.balance(address);
currentEscrowBalance = toBNString(currentEscrowBalance);
amountInCogs = toBNString(amountInCogs);
if(amountInCogs > currentEscrowBalance) {
await account.depositToEscrowAccount(amountInCogs - currentEscrowBalance);
currentEscrowBalance = new BigNumber(currentEscrowBalance);
amountInCogs = new BigNumber(amountInCogs);
if(amountInCogs.isGreaterThan(currentEscrowBalance)) {
await account.depositToEscrowAccount(amountInCogs.minus(currentEscrowBalance));
}
}

Expand Down

0 comments on commit b2257b0

Please sign in to comment.