Skip to content

Commit

Permalink
Add simple tests
Browse files Browse the repository at this point in the history
  • Loading branch information
maxima-net committed Aug 29, 2022
1 parent 1bf7e45 commit f76dda5
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/atomex/atomexProtocolV1.test.ts
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'));
});
});

0 comments on commit f76dda5

Please sign in to comment.