aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-07-04 13:32:24 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-07-05 01:05:45 +0800
commitf39a2134b946ab2c7f24b9fcc49f95156e7682d5 (patch)
tree964403241e02bd074f619a8b2427f2bc9eebd253 /src/contract_wrappers
parent551b6db35e07907ad4dec767c8e76953fe98bb72 (diff)
downloaddexon-sol-tools-f39a2134b946ab2c7f24b9fcc49f95156e7682d5.tar
dexon-sol-tools-f39a2134b946ab2c7f24b9fcc49f95156e7682d5.tar.gz
dexon-sol-tools-f39a2134b946ab2c7f24b9fcc49f95156e7682d5.tar.bz2
dexon-sol-tools-f39a2134b946ab2c7f24b9fcc49f95156e7682d5.tar.lz
dexon-sol-tools-f39a2134b946ab2c7f24b9fcc49f95156e7682d5.tar.xz
dexon-sol-tools-f39a2134b946ab2c7f24b9fcc49f95156e7682d5.tar.zst
dexon-sol-tools-f39a2134b946ab2c7f24b9fcc49f95156e7682d5.zip
Add tests for order hash Schema
Diffstat (limited to 'src/contract_wrappers')
-rw-r--r--src/contract_wrappers/token_wrapper.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/contract_wrappers/token_wrapper.ts b/src/contract_wrappers/token_wrapper.ts
index 85592a106..1e087e8b0 100644
--- a/src/contract_wrappers/token_wrapper.ts
+++ b/src/contract_wrappers/token_wrapper.ts
@@ -8,6 +8,8 @@ import {constants} from '../utils/constants';
import {ContractWrapper} from './contract_wrapper';
import * as TokenArtifacts from '../artifacts/Token.json';
import * as ProxyArtifacts from '../artifacts/Proxy.json';
+import {subscriptionOptsSchema} from '../schemas/subscription_opts_schema';
+import {indexFilterValuesSchema} from '../schemas/index_filter_values_schema';
import {
TokenContract,
ZeroExError,
@@ -203,6 +205,10 @@ export class TokenWrapper extends ContractWrapper {
*/
public async subscribeAsync(tokenAddress: string, eventName: TokenEvents, subscriptionOpts: SubscriptionOpts,
indexFilterValues: IndexedFilterValues): Promise<ContractEventEmitter> {
+ assert.isETHAddressHex('tokenAddress', tokenAddress);
+ // assert.isEventName('eventName', eventName);
+ assert.doesConformToSchema('subscriptionOpts', subscriptionOpts, subscriptionOptsSchema);
+ assert.doesConformToSchema('indexFilterValues', indexFilterValues, indexFilterValuesSchema);
const tokenContract = await this._getTokenContractAsync(tokenAddress);
let createLogEvent: CreateContractEvent;
switch (eventName) {