From 40a0d345b5fc00d36928387cd558133358624f12 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Mon, 18 Sep 2017 16:54:24 +0200 Subject: Add tests for contracts address config --- src/contract_wrappers/token_registry_wrapper.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/contract_wrappers/token_registry_wrapper.ts b/src/contract_wrappers/token_registry_wrapper.ts index 0807982b1..fb0ab78f6 100644 --- a/src/contract_wrappers/token_registry_wrapper.ts +++ b/src/contract_wrappers/token_registry_wrapper.ts @@ -84,6 +84,16 @@ export class TokenRegistryWrapper extends ContractWrapper { const token = this._createTokenFromMetadata(metadata); return token; } + /** + * Retrieves the Ethereum address of the TokenRegistry contract deployed on the network + * that the user-passed web3 provider is connected to. + * @returns The Ethereum address of the TokenRegistry contract being used. + */ + public async getContractAddressAsync(): Promise { + const tokenRegistryInstance = await this._getTokenRegistryContractAsync(); + const tokenRegistryAddress = tokenRegistryInstance.address; + return tokenRegistryAddress; + } private _createTokenFromMetadata(metadata: TokenMetadata): Token|undefined { if (metadata[0] === constants.NULL_ADDRESS) { return undefined; -- cgit