From 762a6199b25391bde65ea2f1f91532c3c1d5badf Mon Sep 17 00:00:00 2001 From: Amir Bandeali Date: Thu, 28 Jun 2018 18:28:09 -0700 Subject: Fix tests --- .../contracts/current/tokens/ERC721Token/ERC721Token.sol | 14 +++++++------- packages/contracts/src/utils/artifacts.ts | 2 ++ packages/contracts/src/utils/constants.ts | 1 + 3 files changed, 10 insertions(+), 7 deletions(-) (limited to 'packages/contracts/src') diff --git a/packages/contracts/src/contracts/current/tokens/ERC721Token/ERC721Token.sol b/packages/contracts/src/contracts/current/tokens/ERC721Token/ERC721Token.sol index cff34e99e..41ba149e3 100644 --- a/packages/contracts/src/contracts/current/tokens/ERC721Token/ERC721Token.sol +++ b/packages/contracts/src/contracts/current/tokens/ERC721Token/ERC721Token.sol @@ -68,7 +68,7 @@ contract ERC721Token is * @param _tokenId uint256 ID of the token to validate */ modifier canTransfer(uint256 _tokenId) { - require(isApprovedOrOwner(msg.sender, _tokenId), "3"); + require(isApprovedOrOwner(msg.sender, _tokenId)); _; } @@ -222,8 +222,8 @@ contract ERC721Token is public canTransfer(_tokenId) { - require(_from != address(0), "1"); - require(_to != address(0), "2"); + require(_from != address(0)); + require(_to != address(0)); clearApproval(_from, _tokenId); removeTokenFrom(_from, _tokenId); @@ -276,7 +276,7 @@ contract ERC721Token is { transferFrom(_from, _to, _tokenId); // solium-disable-next-line arg-overflow - require(checkAndCallSafeTransfer(_from, _to, _tokenId, _data), "7"); + require(checkAndCallSafeTransfer(_from, _to, _tokenId, _data)); } /** @@ -331,7 +331,7 @@ contract ERC721Token is function clearApproval(address _owner, uint256 _tokenId) internal { - require(ownerOf(_tokenId) == _owner, "4"); + require(ownerOf(_tokenId) == _owner); if (tokenApprovals[_tokenId] != address(0)) { tokenApprovals[_tokenId] = address(0); emit Approval(_owner, address(0), _tokenId); @@ -346,7 +346,7 @@ contract ERC721Token is function addTokenTo(address _to, uint256 _tokenId) internal { - require(tokenOwner[_tokenId] == address(0), "6"); + require(tokenOwner[_tokenId] == address(0)); tokenOwner[_tokenId] = _to; ownedTokensCount[_to] = safeAdd(ownedTokensCount[_to], 1); } @@ -359,7 +359,7 @@ contract ERC721Token is function removeTokenFrom(address _from, uint256 _tokenId) internal { - require(ownerOf(_tokenId) == _from, "5"); + require(ownerOf(_tokenId) == _from); ownedTokensCount[_from] = safeSub(ownedTokensCount[_from], 1); tokenOwner[_tokenId] = address(0); } diff --git a/packages/contracts/src/utils/artifacts.ts b/packages/contracts/src/utils/artifacts.ts index d58e7973c..b25266409 100644 --- a/packages/contracts/src/utils/artifacts.ts +++ b/packages/contracts/src/utils/artifacts.ts @@ -8,6 +8,7 @@ import * as ERC20Proxy from '../artifacts/ERC20Proxy.json'; import * as ERC721Proxy from '../artifacts/ERC721Proxy.json'; import * as Exchange from '../artifacts/Exchange.json'; import * as ExchangeWrapper from '../artifacts/ExchangeWrapper.json'; +import * as IAssetProxy from '../artifacts/IAssetProxy.json'; import * as MixinAuthorizable from '../artifacts/MixinAuthorizable.json'; import * as MultiSigWallet from '../artifacts/MultiSigWallet.json'; import * as MultiSigWalletWithTimeLock from '../artifacts/MultiSigWalletWithTimeLock.json'; @@ -33,6 +34,7 @@ export const artifacts = { Exchange: (Exchange as any) as ContractArtifact, ExchangeWrapper: (ExchangeWrapper as any) as ContractArtifact, EtherToken: (EtherToken as any) as ContractArtifact, + IAssetProxy: (IAssetProxy as any) as ContractArtifact, MixinAuthorizable: (MixinAuthorizable as any) as ContractArtifact, MultiSigWallet: (MultiSigWallet as any) as ContractArtifact, MultiSigWalletWithTimeLock: (MultiSigWalletWithTimeLock as any) as ContractArtifact, diff --git a/packages/contracts/src/utils/constants.ts b/packages/contracts/src/utils/constants.ts index 2b2bd2425..8e68f376d 100644 --- a/packages/contracts/src/utils/constants.ts +++ b/packages/contracts/src/utils/constants.ts @@ -27,6 +27,7 @@ export const constants = { MAX_ETHERTOKEN_WITHDRAW_GAS: 43000, MAX_TOKEN_TRANSFERFROM_GAS: 80000, MAX_TOKEN_APPROVE_GAS: 60000, + TRANSFER_FROM_GAS: 150000, DUMMY_TOKEN_NAME: '', DUMMY_TOKEN_SYMBOL: '', DUMMY_TOKEN_DECIMALS: new BigNumber(18), -- cgit v1.2.3