diff --git a/contracts/asset-proxy/CHANGELOG.json b/contracts/asset-proxy/CHANGELOG.json index 7609de5297..9f8d891052 100644 --- a/contracts/asset-proxy/CHANGELOG.json +++ b/contracts/asset-proxy/CHANGELOG.json @@ -68,6 +68,14 @@ { "note": "Update tests to use contract-built-in `awaitTransactionSuccessAsync`", "pr": 1797 + }, + { + "note": "Make `ERC721Wrapper.setApprovalForAll()` take an owner address instead of a token ID", + "pr": 1819 + }, + { + "note": "Automatically set unlimited proxy allowances in `ERC721.setBalancesAndAllowancesAsync()`", + "pr": 1819 } ], "timestamp": 1557507213 diff --git a/contracts/asset-proxy/test/utils/erc721_wrapper.ts b/contracts/asset-proxy/test/utils/erc721_wrapper.ts index b52d54d7d7..cfad9bf4a9 100644 --- a/contracts/asset-proxy/test/utils/erc721_wrapper.ts +++ b/contracts/asset-proxy/test/utils/erc721_wrapper.ts @@ -69,7 +69,7 @@ export class ERC721Wrapper { } this._initialTokenIdsByOwner[tokenOwnerAddress][dummyTokenContract.address].push(tokenId); - await this.approveProxyAsync(dummyTokenContract.address, tokenId); + await this.approveProxyForAllAsync(dummyTokenContract.address, tokenOwnerAddress, true); } } } @@ -84,14 +84,17 @@ export class ERC721Wrapper { const proxyAddress = (this._proxyContract as ERC721ProxyContract).address; await this.approveAsync(proxyAddress, tokenAddress, tokenId); } - public async approveProxyForAllAsync(tokenAddress: string, tokenId: BigNumber, isApproved: boolean): Promise { + public async approveProxyForAllAsync( + tokenAddress: string, + ownerAddress: string, + isApproved: boolean, + ): Promise { const tokenContract = this._getTokenContractFromAssetData(tokenAddress); - const tokenOwner = await this.ownerOfAsync(tokenAddress, tokenId); const proxyAddress = (this._proxyContract as ERC721ProxyContract).address; await tokenContract.setApprovalForAll.awaitTransactionSuccessAsync( proxyAddress, isApproved, - { from: tokenOwner }, + { from: ownerAddress }, constants.AWAIT_TRANSACTION_MINED_MS, ); }