From 32d75b6483d8d10073238d228e180fbee46cf192 Mon Sep 17 00:00:00 2001 From: Fabio Berger Date: Mon, 2 Jul 2018 10:50:48 +0200 Subject: Transfer ERC721 token instead of burning, so we can still set an allowance to it in tests --- packages/contracts/src/utils/asset_wrapper.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'packages/contracts') diff --git a/packages/contracts/src/utils/asset_wrapper.ts b/packages/contracts/src/utils/asset_wrapper.ts index a7f91f413..9946e4bde 100644 --- a/packages/contracts/src/utils/asset_wrapper.ts +++ b/packages/contracts/src/utils/asset_wrapper.ts @@ -86,7 +86,15 @@ export class AssetWrapper { ); } else if (tokenOwner === userAddress && desiredBalance.eq(0)) { // Burn token - await erc721Wrapper.burnAsync(assetProxyData.tokenAddress, assetProxyData.tokenId, userAddress); + // await erc721Wrapper.burnAsync(assetProxyData.tokenAddress, assetProxyData.tokenId, userAddress); + const userAddresses = await (erc721Wrapper as any)._web3Wrapper.getAvailableAddressesAsync(); + const nonOwner = _.find(userAddresses, a => a !== userAddress); + await erc721Wrapper.transferFromAsync( + assetProxyData.tokenAddress, + assetProxyData.tokenId, + tokenOwner, + nonOwner, + ); return; } else if ( (userAddress !== tokenOwner && desiredBalance.eq(0)) || -- cgit