From c12e48d28a811ace4bf7543a5c06471170ddf3f9 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Wed, 23 Aug 2017 18:13:50 +0200 Subject: Add assertion to public method --- src/contract_wrappers/token_registry_wrapper.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/contract_wrappers') diff --git a/src/contract_wrappers/token_registry_wrapper.ts b/src/contract_wrappers/token_registry_wrapper.ts index c78b86a88..c106a4a40 100644 --- a/src/contract_wrappers/token_registry_wrapper.ts +++ b/src/contract_wrappers/token_registry_wrapper.ts @@ -1,5 +1,6 @@ import * as _ from 'lodash'; import {Web3Wrapper} from '../web3_wrapper'; +import {assert} from '../utils/assert'; import {Token, TokenRegistryContract, TokenMetadata} from '../types'; import {constants} from '../utils/constants'; import {ContractWrapper} from './contract_wrapper'; @@ -33,6 +34,8 @@ export class TokenRegistryWrapper extends ContractWrapper { * @return An object that conforms to the Token interface or undefined if token not found. */ public async getTokenMetadataIfExistsAsync(address: string): Promise { + assert.isETHAddressHex('address', address); + const tokenRegistryContract = await this._getTokenRegistryContractAsync(); const metadata = await tokenRegistryContract.getTokenMetaData.call(address); if (metadata[0] === constants.NULL_ADDRESS) { -- cgit v1.2.3