From 5155f4980440f1c91006b124406c8b4a7a90e300 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 2 Jun 2017 12:03:52 +0200 Subject: Add test for insufficient balance and make all async tests async --- src/contract_wrappers/exchange_wrapper.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index eace55f4d..e2ac07b55 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -141,6 +141,9 @@ export class ExchangeWrapper extends ContractWrapper { if (fillAmount.greaterThan(takerBalance)) { throw new Error(FillOrderValidationErrs.NOT_ENOUGH_TAKER_BALANCE); } + if (fillAmount.greaterThan(takerAllowance)) { + throw new Error(FillOrderValidationErrs.NOT_ENOUGH_TAKER_ALLOWANCE); + } } private throwErrorLogsAsErrors(logs: ContractEvent[]): void { const errEvent = _.find(logs, {event: 'LogError'}); -- cgit v1.2.3