diff options
author | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-09-18 22:54:24 +0800 |
---|---|---|
committer | Leonid Logvinov <logvinov.leon@gmail.com> | 2017-09-18 22:54:24 +0800 |
commit | 40a0d345b5fc00d36928387cd558133358624f12 (patch) | |
tree | c666bd7e94df75c4c6f0ac44efd15492a4f8277a /src/contract_wrappers/token_registry_wrapper.ts | |
parent | 504e7a25a5ee138941ca35d4aad1b63444e47033 (diff) | |
download | dexon-0x-contracts-40a0d345b5fc00d36928387cd558133358624f12.tar.gz dexon-0x-contracts-40a0d345b5fc00d36928387cd558133358624f12.tar.zst dexon-0x-contracts-40a0d345b5fc00d36928387cd558133358624f12.zip |
Add tests for contracts address config
Diffstat (limited to 'src/contract_wrappers/token_registry_wrapper.ts')
-rw-r--r-- | src/contract_wrappers/token_registry_wrapper.ts | 10 |
1 files changed, 10 insertions, 0 deletions
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<string> { + 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; |