Skip to content

Commit

Permalink
fix: required deposit fix when available storage is higher than needed
Browse files Browse the repository at this point in the history
  • Loading branch information
jaswinder6991 committed Jul 30, 2024
1 parent 4973ce1 commit a49a72f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,12 @@ describe('calculateRequiredDeposit()', () => {
data,
storageBalance: {
available: BigInt(storageCostOfData.plus('1').toFixed()),
total: BigInt(storageCostOfData.minus('1').toFixed()),
total: BigInt(storageCostOfData.plus('10').toFixed()),
},
});

// assert
expect(result.toFixed()).toBe('1');
expect(result.toFixed()).toBe('0');
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ export default function calculateRequiredDeposit({
// if the storage deposit available is less than the cost of storage, use the difference as the required deposit
return storageDepositAvailable.lt(storageCostOfData)
? storageCostOfData.minus(storageDepositAvailable)
: new BigNumber(ONE_YOCTO);
: new BigNumber('0');
}

0 comments on commit a49a72f

Please sign in to comment.