aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/assert.ts
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-06-03 03:01:58 +0800
committerGitHub <noreply@github.com>2017-06-03 03:01:58 +0800
commit88815e5b4514e4953cc150241340e0b53dadc198 (patch)
treee8e0ba5b603f07bddf6cd01329e001b06b5987dd /src/utils/assert.ts
parent5925f81fe185a90efaa82dd90bd8d65d74326f11 (diff)
parent36e937f8de348cfdb35ff8f72504aed1dfab07b2 (diff)
downloaddexon-sol-tools-88815e5b4514e4953cc150241340e0b53dadc198.tar
dexon-sol-tools-88815e5b4514e4953cc150241340e0b53dadc198.tar.gz
dexon-sol-tools-88815e5b4514e4953cc150241340e0b53dadc198.tar.bz2
dexon-sol-tools-88815e5b4514e4953cc150241340e0b53dadc198.tar.lz
dexon-sol-tools-88815e5b4514e4953cc150241340e0b53dadc198.tar.xz
dexon-sol-tools-88815e5b4514e4953cc150241340e0b53dadc198.tar.zst
dexon-sol-tools-88815e5b4514e4953cc150241340e0b53dadc198.zip
Merge pull request #29 from 0xProject/remainingTokenMethods
Implement Remaining Token Methods
Diffstat (limited to 'src/utils/assert.ts')
-rw-r--r--src/utils/assert.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils/assert.ts b/src/utils/assert.ts
index 406f2b149..5a31e1b16 100644
--- a/src/utils/assert.ts
+++ b/src/utils/assert.ts
@@ -1,6 +1,7 @@
import * as _ from 'lodash';
import * as BigNumber from 'bignumber.js';
import * as Web3 from 'web3';
+import {Web3Wrapper} from '../web3_wrapper';
import {SchemaValidator} from './schema_validator';
import {utils} from './utils';
@@ -25,6 +26,11 @@ export const assert = {
const web3 = new Web3();
this.assert(web3.isAddress(value), this.typeAssertionMessage(variableName, 'ETHAddressHex', value));
},
+ async isSenderAddressAvailableAsync(web3Wrapper: Web3Wrapper, senderAddress: string) {
+ const isSenderAddressAvailable = await web3Wrapper.isSenderAddressAvailableAsync(senderAddress);
+ assert.assert(isSenderAddressAvailable, 'Specified senderAddress isn\'t available through the \
+ supplied web3 instance');
+ },
isNumber(variableName: string, value: number): void {
this.assert(_.isFinite(value), this.typeAssertionMessage(variableName, 'number', value));
},