diff options
author | Leonid <logvinov.leon@gmail.com> | 2017-06-03 03:01:58 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-03 03:01:58 +0800 |
commit | 88815e5b4514e4953cc150241340e0b53dadc198 (patch) | |
tree | e8e0ba5b603f07bddf6cd01329e001b06b5987dd /src/utils | |
parent | 5925f81fe185a90efaa82dd90bd8d65d74326f11 (diff) | |
parent | 36e937f8de348cfdb35ff8f72504aed1dfab07b2 (diff) | |
download | dexon-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')
-rw-r--r-- | src/utils/assert.ts | 6 |
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)); }, |