aboutsummaryrefslogtreecommitdiffstats
path: root/src/contract_wrappers
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-10-05 21:32:01 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-10-05 21:32:01 +0800
commit1414b8ee8bdb1be901371c4cf7b8a5150d8fb771 (patch)
tree1b46e817c23ecb26fed8d16e147fe4cb2f007883 /src/contract_wrappers
parent209c31f361743bd511e6bb2c494ceeb02e52a7d9 (diff)
downloaddexon-sol-tools-1414b8ee8bdb1be901371c4cf7b8a5150d8fb771.tar
dexon-sol-tools-1414b8ee8bdb1be901371c4cf7b8a5150d8fb771.tar.gz
dexon-sol-tools-1414b8ee8bdb1be901371c4cf7b8a5150d8fb771.tar.bz2
dexon-sol-tools-1414b8ee8bdb1be901371c4cf7b8a5150d8fb771.tar.lz
dexon-sol-tools-1414b8ee8bdb1be901371c4cf7b8a5150d8fb771.tar.xz
dexon-sol-tools-1414b8ee8bdb1be901371c4cf7b8a5150d8fb771.tar.zst
dexon-sol-tools-1414b8ee8bdb1be901371c4cf7b8a5150d8fb771.zip
Add type assertions for callback parameters
Diffstat (limited to 'src/contract_wrappers')
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts1
-rw-r--r--src/contract_wrappers/token_wrapper.ts1
2 files changed, 2 insertions, 0 deletions
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index 0eb600ff6..b2e48b36e 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -630,6 +630,7 @@ export class ExchangeWrapper extends ContractWrapper {
callback: EventCallback): Promise<string> {
assert.doesBelongToStringEnum('eventName', eventName, ExchangeEvents);
assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema);
+ assert.isFunction('callback', callback);
const exchangeContractAddress = await this.getContractAddressAsync();
const subscriptionToken = this._subscribe(
exchangeContractAddress, eventName, indexFilterValues, artifacts.ExchangeArtifact.abi, callback,
diff --git a/src/contract_wrappers/token_wrapper.ts b/src/contract_wrappers/token_wrapper.ts
index 05852742a..ee49e8539 100644
--- a/src/contract_wrappers/token_wrapper.ts
+++ b/src/contract_wrappers/token_wrapper.ts
@@ -258,6 +258,7 @@ export class TokenWrapper extends ContractWrapper {
assert.isETHAddressHex('tokenAddress', tokenAddress);
assert.doesBelongToStringEnum('eventName', eventName, TokenEvents);
assert.doesConformToSchema('indexFilterValues', indexFilterValues, schemas.indexFilterValuesSchema);
+ assert.isFunction('callback', callback);
const subscriptionToken = this._subscribe(
tokenAddress, eventName, indexFilterValues, artifacts.TokenArtifact.abi, callback,
);