aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/contract_wrappers/token_registry_wrapper.ts3
1 files changed, 3 insertions, 0 deletions
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<Token|undefined> {
+ assert.isETHAddressHex('address', address);
+
const tokenRegistryContract = await this._getTokenRegistryContractAsync();
const metadata = await tokenRegistryContract.getTokenMetaData.call(address);
if (metadata[0] === constants.NULL_ADDRESS) {