diff options
author | Fabio Berger <me@fabioberger.com> | 2018-06-20 19:55:45 +0800 |
---|---|---|
committer | Fabio Berger <me@fabioberger.com> | 2018-06-20 19:55:45 +0800 |
commit | 3fab40efe553446770c8858afd0020f613ca4d4c (patch) | |
tree | ac8abaa4b289c15babd5ea5a3c55c5c27293efb3 | |
parent | 0bbdbc9e63fbd73158c1ffd76eb3f3e4d0660598 (diff) | |
download | dexon-0x-contracts-3fab40efe553446770c8858afd0020f613ca4d4c.tar.gz dexon-0x-contracts-3fab40efe553446770c8858afd0020f613ca4d4c.tar.zst dexon-0x-contracts-3fab40efe553446770c8858afd0020f613ca4d4c.zip |
Add noop conditionals for clarity
-rw-r--r-- | packages/contracts/src/utils/asset_wrapper.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/packages/contracts/src/utils/asset_wrapper.ts b/packages/contracts/src/utils/asset_wrapper.ts index f86c0bc23..11697eca8 100644 --- a/packages/contracts/src/utils/asset_wrapper.ts +++ b/packages/contracts/src/utils/asset_wrapper.ts @@ -87,6 +87,11 @@ export class AssetWrapper { // Burn token await erc721Wrapper.burnAsync(assetProxyData.tokenAddress, assetProxyData.tokenId, userAddress); return; + } else if ( + (userAddress !== tokenOwner && desiredBalance.eq(0)) || + (tokenOwner === userAddress && desiredBalance.eq(1)) + ) { + return; // noop } break; } @@ -176,6 +181,11 @@ export class AssetWrapper { assetProxyData.tokenAddress, assetProxyData.tokenId, ); + } else if ( + (!isProxyApproved && desiredAllowance.eq(0)) || + (isProxyApproved && desiredAllowance.eq(1)) + ) { + return; // noop } break; |