aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers/token_wrapper.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-07-05 02:06:13 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-07-05 02:06:13 +0800
commit43bebf6d61be47ecab977ea328f580c4588b4804 (patch)
treeff91b31d44eaafa0c244232cd13d843d92e7681d /src/contract_wrappers/token_wrapper.ts
parent40d1d30b5816c9631fd4a0aa9824c6fea0d11bec (diff)
downloaddexon-sol-tools-43bebf6d61be47ecab977ea328f580c4588b4804.tar
dexon-sol-tools-43bebf6d61be47ecab977ea328f580c4588b4804.tar.gz
dexon-sol-tools-43bebf6d61be47ecab977ea328f580c4588b4804.tar.bz2
dexon-sol-tools-43bebf6d61be47ecab977ea328f580c4588b4804.tar.lz
dexon-sol-tools-43bebf6d61be47ecab977ea328f580c4588b4804.tar.xz
dexon-sol-tools-43bebf6d61be47ecab977ea328f580c4588b4804.tar.zst
dexon-sol-tools-43bebf6d61be47ecab977ea328f580c4588b4804.zip
Add parameter validation for subscribeAsync
Diffstat (limited to 'src/contract_wrappers/token_wrapper.ts')
-rw-r--r--src/contract_wrappers/token_wrapper.ts4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/contract_wrappers/token_wrapper.ts b/src/contract_wrappers/token_wrapper.ts
index d3ef5d6cf..1ad1cd9d6 100644
--- a/src/contract_wrappers/token_wrapper.ts
+++ b/src/contract_wrappers/token_wrapper.ts
@@ -205,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.doesBelongToStringEnum('eventName', eventName, TokenEvents);
+ assert.doesConformToSchema('subscriptionOpts', subscriptionOpts, subscriptionOptsSchema);
+ assert.doesConformToSchema('indexFilterValues', indexFilterValues, indexFilterValuesSchema);
const tokenContract = await this._getTokenContractAsync(tokenAddress);
let createLogEvent: CreateContractEvent;
switch (eventName) {