aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contract-wrappers/src
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-06-29 20:44:12 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-06-29 22:52:54 +0800
commit6db614251e4d1ec7248fd87354bfde8e65d50374 (patch)
treee78f6d145ed0c8bd4c7c3f2da2da5fd84b6f0c87 /packages/contract-wrappers/src
parentbcc588efe726751c100f020a219b79d8f2a31f03 (diff)
downloaddexon-sol-tools-6db614251e4d1ec7248fd87354bfde8e65d50374.tar
dexon-sol-tools-6db614251e4d1ec7248fd87354bfde8e65d50374.tar.gz
dexon-sol-tools-6db614251e4d1ec7248fd87354bfde8e65d50374.tar.bz2
dexon-sol-tools-6db614251e4d1ec7248fd87354bfde8e65d50374.tar.lz
dexon-sol-tools-6db614251e4d1ec7248fd87354bfde8e65d50374.tar.xz
dexon-sol-tools-6db614251e4d1ec7248fd87354bfde8e65d50374.tar.zst
dexon-sol-tools-6db614251e4d1ec7248fd87354bfde8e65d50374.zip
Rename getApprovedAsync to getApprovedIfExistsAsync
Diffstat (limited to 'packages/contract-wrappers/src')
-rw-r--r--packages/contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts10
1 files changed, 5 insertions, 5 deletions
diff --git a/packages/contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts b/packages/contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts
index 86c3e2d99..53190d007 100644
--- a/packages/contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts
+++ b/packages/contract-wrappers/src/contract_wrappers/erc721_token_wrapper.ts
@@ -155,14 +155,14 @@ export class ERC721TokenWrapper extends ContractWrapper {
return isProxyApprovedForAll;
}
/**
- * Get the approved address for a single NFT
+ * Get the approved address for a single NFT. Returns undefined if no approval was set
* Throws if `_tokenId` is not a valid NFT
* @param tokenAddress The hex encoded contract Ethereum address where the ERC721 token is deployed.
* @param tokenId The identifier for an NFT
* @param methodOpts Optional arguments this method accepts.
- * @return The approved address for this NFT, or the zero address if there is none
+ * @return The approved address for this NFT, or the undefined if there is none
*/
- public async getApprovedAsync(
+ public async getApprovedIfExistsAsync(
tokenAddress: string,
tokenId: BigNumber,
methodOpts?: MethodOpts,
@@ -197,7 +197,7 @@ export class ERC721TokenWrapper extends ContractWrapper {
methodOpts?: MethodOpts,
): Promise<boolean> {
const proxyAddress = this._erc721ProxyWrapper.getContractAddress();
- const approvedAddress = await this.getApprovedAsync(tokenAddress, tokenId, methodOpts);
+ const approvedAddress = await this.getApprovedIfExistsAsync(tokenAddress, tokenId, methodOpts);
const isProxyApproved = approvedAddress === proxyAddress;
return isProxyApproved;
}
@@ -354,7 +354,7 @@ export class ERC721TokenWrapper extends ContractWrapper {
normalizedSenderAddress,
);
if (!isApprovedForAll) {
- const approved = await this.getApprovedAsync(normalizedTokenAddress, tokenId);
+ const approved = await this.getApprovedIfExistsAsync(normalizedTokenAddress, tokenId);
if (approved !== senderAddress) {
throw new Error(ContractWrappersError.ERC721NoApproval);
}