Return AssetProxyId instead of string from proxy.getProxyIdAsync()

This commit is contained in:
Leonid Logvinov
2018-07-09 10:33:37 +02:00
parent 028184947f
commit 813824868e
2 changed files with 6 additions and 4 deletions

View File

@@ -3,6 +3,7 @@ import { ContractAbi } from 'ethereum-types';
import * as _ from 'lodash'; import * as _ from 'lodash';
import { artifacts } from '../artifacts'; import { artifacts } from '../artifacts';
import { AssetProxyId } from '../types';
import { assert } from '../utils/assert'; import { assert } from '../utils/assert';
import { ContractWrapper } from './contract_wrapper'; import { ContractWrapper } from './contract_wrapper';
@@ -23,9 +24,9 @@ export class ERC20ProxyWrapper extends ContractWrapper {
* Get the 4 bytes ID of this asset proxy * Get the 4 bytes ID of this asset proxy
* @return Proxy id * @return Proxy id
*/ */
public async getProxyIdAsync(): Promise<string> { public async getProxyIdAsync(): Promise<AssetProxyId> {
const ERC20ProxyContractInstance = await this._getERC20ProxyContractAsync(); const ERC20ProxyContractInstance = await this._getERC20ProxyContractAsync();
const proxyId = await ERC20ProxyContractInstance.getProxyId.callAsync(); const proxyId = (await ERC20ProxyContractInstance.getProxyId.callAsync()) as AssetProxyId;
return proxyId; return proxyId;
} }
/** /**

View File

@@ -3,6 +3,7 @@ import { ContractAbi } from 'ethereum-types';
import * as _ from 'lodash'; import * as _ from 'lodash';
import { artifacts } from '../artifacts'; import { artifacts } from '../artifacts';
import { AssetProxyId } from '../types';
import { assert } from '../utils/assert'; import { assert } from '../utils/assert';
import { ContractWrapper } from './contract_wrapper'; import { ContractWrapper } from './contract_wrapper';
@@ -23,9 +24,9 @@ export class ERC721ProxyWrapper extends ContractWrapper {
* Get the 4 bytes ID of this asset proxy * Get the 4 bytes ID of this asset proxy
* @return Proxy id * @return Proxy id
*/ */
public async getProxyIdAsync(): Promise<string> { public async getProxyIdAsync(): Promise<AssetProxyId> {
const ERC721ProxyContractInstance = await this._getERC721ProxyContractAsync(); const ERC721ProxyContractInstance = await this._getERC721ProxyContractAsync();
const proxyId = await ERC721ProxyContractInstance.getProxyId.callAsync(); const proxyId = (await ERC721ProxyContractInstance.getProxyId.callAsync()) as AssetProxyId;
return proxyId; return proxyId;
} }
/** /**