Make feeRate optional with a default of 0

This commit is contained in:
Brandon Millman
2018-08-09 18:54:17 -04:00
parent fcd57d2743
commit cbe639866e
3 changed files with 13 additions and 10 deletions

View File

@@ -17,16 +17,10 @@ describe('rateUtils', () => {
takerFee: new BigNumber(20),
});
describe('#getFeeAdjustedRateOfOrder', () => {
it('throws when feeRate is zero', async () => {
const feeRate = constants.ZERO_AMOUNT;
expect(() => rateUtils.getFeeAdjustedRateOfOrder(testOrder, feeRate)).to.throw(
'Expected feeRate: 0 to be greater than 0',
);
});
it('throws when feeRate is less than zero', async () => {
const feeRate = new BigNumber(-1);
expect(() => rateUtils.getFeeAdjustedRateOfOrder(testOrder, feeRate)).to.throw(
'Expected feeRate: -1 to be greater than 0',
'Expected feeRate: -1 to be greater than or equal to 0',
);
});
it('correctly calculates fee adjusted rate', async () => {