From 52dc6b77104792852eb7cdffb4a088b35b46f2be Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 13 Jun 2017 13:29:02 +0200 Subject: Add getContractAddressAsync and tests --- src/contract_wrappers/exchange_wrapper.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/contract_wrappers') diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts index a08901004..74b8d25c1 100644 --- a/src/contract_wrappers/exchange_wrapper.ts +++ b/src/contract_wrappers/exchange_wrapper.ts @@ -543,6 +543,15 @@ export class ExchangeWrapper extends ContractWrapper { logEventObj.watch(callback); this._exchangeLogEventObjs.push(logEventObj); } + /** + * Returns the ethereum address of the current exchange contract + * on the network that the provided web3 instance is connected to + * @return The ethereum address of the current exchange contract. + */ + public async getContractAddressAsync(): Promise { + const exchangeContract = await this._getExchangeContractAsync(); + return exchangeContract.address; + } private async _isValidSignatureUsingContractCallAsync(dataHex: string, ecSignature: ECSignature, signerAddressHex: string): Promise { assert.isHexString('dataHex', dataHex); -- cgit