aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-02 18:03:52 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-02 18:03:52 +0800
commit5155f4980440f1c91006b124406c8b4a7a90e300 (patch)
tree1b6c6c75ce4a7b24d97a1c6da8cb69a4bb951265 /src
parenta740498c8061bc7a3dafae82929b358e61bac2d4 (diff)
downloaddexon-sol-tools-5155f4980440f1c91006b124406c8b4a7a90e300.tar
dexon-sol-tools-5155f4980440f1c91006b124406c8b4a7a90e300.tar.gz
dexon-sol-tools-5155f4980440f1c91006b124406c8b4a7a90e300.tar.bz2
dexon-sol-tools-5155f4980440f1c91006b124406c8b4a7a90e300.tar.lz
dexon-sol-tools-5155f4980440f1c91006b124406c8b4a7a90e300.tar.xz
dexon-sol-tools-5155f4980440f1c91006b124406c8b4a7a90e300.tar.zst
dexon-sol-tools-5155f4980440f1c91006b124406c8b4a7a90e300.zip
Add test for insufficient balance and make all async tests async
Diffstat (limited to 'src')
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts3
1 files changed, 3 insertions, 0 deletions
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'});