From b2b5abadb22420650334041f9560e3ac4e5b7e41 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 22 Aug 2017 11:28:26 +0200 Subject: Rename internally Proxy to TokenTransferProxy --- src/contract_wrappers/proxy_wrapper.ts | 41 ---------------------- .../token_transfer_proxy_wrapper.ts | 41 ++++++++++++++++++++++ 2 files changed, 41 insertions(+), 41 deletions(-) delete mode 100644 src/contract_wrappers/proxy_wrapper.ts create mode 100644 src/contract_wrappers/token_transfer_proxy_wrapper.ts (limited to 'src/contract_wrappers') diff --git a/src/contract_wrappers/proxy_wrapper.ts b/src/contract_wrappers/proxy_wrapper.ts deleted file mode 100644 index c69ca7017..000000000 --- a/src/contract_wrappers/proxy_wrapper.ts +++ /dev/null @@ -1,41 +0,0 @@ -import * as _ from 'lodash'; -import {ContractWrapper} from './contract_wrapper'; -import * as TokenTransferProxyArtifacts from '../artifacts/TokenTransferProxy.json'; -import {ProxyContract} from '../types'; - -/** - * This class includes the functionality related to interacting with the Proxy contract. - */ -export class ProxyWrapper extends ContractWrapper { - private _proxyContractIfExists?: ProxyContract; - /** - * Check if the Exchange contract address is authorized by the Proxy contract. - * @param exchangeContractAddress The hex encoded address of the Exchange contract to call. - * @return Whether the exchangeContractAddress is authorized. - */ - public async isAuthorizedAsync(exchangeContractAddress: string): Promise { - const proxyContractInstance = await this._getProxyContractAsync(); - const isAuthorized = await proxyContractInstance.authorized.call(exchangeContractAddress); - return isAuthorized; - } - /** - * Get the list of all Exchange contract addresses authorized by the Proxy contract. - * @return The list of authorized addresses. - */ - public async getAuthorizedAddressesAsync(): Promise { - const proxyContractInstance = await this._getProxyContractAsync(); - const authorizedAddresses = await proxyContractInstance.getAuthorizedAddresses.call(); - return authorizedAddresses; - } - private _invalidateContractInstance(): void { - delete this._proxyContractIfExists; - } - private async _getProxyContractAsync(): Promise { - if (!_.isUndefined(this._proxyContractIfExists)) { - return this._proxyContractIfExists; - } - const contractInstance = await this._instantiateContractIfExistsAsync((TokenTransferProxyArtifacts as any)); - this._proxyContractIfExists = contractInstance as ProxyContract; - return this._proxyContractIfExists; - } -} diff --git a/src/contract_wrappers/token_transfer_proxy_wrapper.ts b/src/contract_wrappers/token_transfer_proxy_wrapper.ts new file mode 100644 index 000000000..39263efac --- /dev/null +++ b/src/contract_wrappers/token_transfer_proxy_wrapper.ts @@ -0,0 +1,41 @@ +import * as _ from 'lodash'; +import {ContractWrapper} from './contract_wrapper'; +import * as TokenTransferProxyArtifacts from '../artifacts/TokenTransferProxy.json'; +import {TokenTransferProxyContract} from '../types'; + +/** + * This class includes the functionality related to interacting with the TokenTransferProxy contract. + */ +export class TokenTransferProxyWrapper extends ContractWrapper { + private _tokenTransferProxyContractIfExists?: TokenTransferProxyContract; + /** + * Check if the Exchange contract address is authorized by the TokenTransferProxy contract. + * @param exchangeContractAddress The hex encoded address of the Exchange contract to call. + * @return Whether the exchangeContractAddress is authorized. + */ + public async isAuthorizedAsync(exchangeContractAddress: string): Promise { + const tokenTransferProxyContractInstance = await this._getTokenTransferProxyContractAsync(); + const isAuthorized = await tokenTransferProxyContractInstance.authorized.call(exchangeContractAddress); + return isAuthorized; + } + /** + * Get the list of all Exchange contract addresses authorized by the TokenTransferProxy contract. + * @return The list of authorized addresses. + */ + public async getAuthorizedAddressesAsync(): Promise { + const tokenTransferProxyContractInstance = await this._getTokenTransferProxyContractAsync(); + const authorizedAddresses = await tokenTransferProxyContractInstance.getAuthorizedAddresses.call(); + return authorizedAddresses; + } + private _invalidateContractInstance(): void { + delete this._tokenTransferProxyContractIfExists; + } + private async _getTokenTransferProxyContractAsync(): Promise { + if (!_.isUndefined(this._tokenTransferProxyContractIfExists)) { + return this._tokenTransferProxyContractIfExists; + } + const contractInstance = await this._instantiateContractIfExistsAsync((TokenTransferProxyArtifacts as any)); + this._tokenTransferProxyContractIfExists = contractInstance as TokenTransferProxyContract; + return this._tokenTransferProxyContractIfExists; + } +} -- cgit v1.2.3