-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1bf7e45
commit f76dda5
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import BigNumber from 'bignumber.js'; | ||
|
||
import { getRedeemRewardInNativeToken, getRedeemRewardInToken, } from '../../src/blockchain/atomexProtocolV1/index'; | ||
|
||
describe('Atomex | Atomex Protocol V1', () => { | ||
test('return correct redeem reward for native token', () => { | ||
const nativeTokenPriceInUsd = new BigNumber(2.15); | ||
const redeemFee = new BigNumber(0.011); | ||
const redeemReward = getRedeemRewardInNativeToken(nativeTokenPriceInUsd, redeemFee); | ||
expect(redeemReward.estimated).toEqual(new BigNumber('0.021979139924875144')); | ||
}); | ||
|
||
test('return correct redeem reward for token', () => { | ||
const nativeTokenPriceInUsd = new BigNumber(2.15); | ||
const nativeTokenPriceInCurrency = new BigNumber(0.00006994); | ||
const redeemFee = new BigNumber(0.011); | ||
const redeemReward = getRedeemRewardInToken(nativeTokenPriceInUsd, nativeTokenPriceInCurrency, redeemFee); | ||
expect(redeemReward.estimated).toEqual(new BigNumber('0.00000153722104634576757136')); | ||
}); | ||
}); |