173 Commits

Author SHA1 Message Date
Amir Bandeali
a09ee90739 Add tests for matchOrders 2018-08-24 17:30:56 -07:00
Amir Bandeali
7d5a23969d Add reentrancy tests for fillOrder and wrapper functions 2018-08-24 17:30:56 -07:00
Amir Bandeali
6a9669a409 Rethrow Wallet and Validator errors 2018-08-24 14:06:46 -07:00
Amir Bandeali
070eff6f3a Rename TestStaticCall => TestStaticCallReceiver 2018-08-24 13:32:04 -07:00
Amir Bandeali
0a1ae2c311 Remove pragma experimental v0.5.0 and use staticcall is assembly 2018-08-24 13:19:07 -07:00
Amir Bandeali
4dd59a370d Add tests for ERC20 token with no return values 2018-08-16 17:31:21 -07:00
Greg Hysen
9f74feb347 Removed receiverData and onReceive callback from ERC721 proxy. 2018-07-18 15:50:58 +02:00
Fabio Berger
004b1f5288 Fix prettier 2018-07-18 14:53:31 +02:00
Fabio Berger
7f90f5ecd4 merge v2-prototype 2018-07-18 12:04:57 +02:00
Amir Bandeali
caa5b4e342 Add tests for getOrderInfo and getOrdersInfo 2018-07-17 13:59:14 -07:00
Fabio Berger
f8dbf57582 Rename assetProxyUtils to assetDataUtils 2018-07-17 15:26:55 +02:00
Alex Browne
9828fa335e
Fix bugs having to do with block timestamps and order expirationTimes 2018-07-16 18:41:37 -07:00
Leonid Logvinov
ba9d3cbdb8
Make it possible to configure block polling interval in base contract wrapper 2018-07-05 15:56:31 +02:00
Alex Browne
5b64b3ea93
Improve robustness of revert reason assertions 2018-07-02 18:57:33 -07:00
Amir Bandeali
2fcc36bbad Update file structure 2018-06-29 18:05:40 -07:00
Amir Bandeali
d4852092b8 Make registerAssetProxy append only 2018-06-29 16:25:16 -07:00
Fabio Berger
646927962a Reduce the userAddresses to the individual addresses actually used by tests, as well as only deploy the number of ERC20 tokens needed for each test suite 2018-06-28 10:43:37 +02:00
Fabio Berger
c308359f59 Merge branch 'v2-prototype' into feature/combinatorial-testing
* v2-prototype:
  Improve 'web3-provider-engine' typings
  Fix build
  Update artifacts
  Add more revert reasons to tests
  Make dispatchTransferFrom revert with reason from AssetProxy on failure
  Remove redundant files, hard code function selector in dispatchTransferFrom, and modify revert reason
  Updated offset of receiverData length to reflect new assetData encoding.
  ERC20 Custom storage layout
  Golf the authorization check
  ERC20 manual memory layout
  ERC20 inline return
  ERC721 inline return
  Golf ERC721 transferFrom
  Inline ERC20 tranferFrom selector constant
  Optimize ERC20 transferFrom
  Polish asset picker layout
  Update relayer grid fallback icon
  Change metamask install link based on browser
  Use ethereumjs-tx@1.3.5 instead of our fork

# Conflicts:
#	packages/contracts/test/asset_proxy/proxies.ts
#	packages/contracts/test/exchange/core.ts
#	packages/migrations/artifacts/2.0.0/DummyERC721Token.json
2018-06-27 10:59:37 +02:00
Amir Bandeali
7f233dcb15 Add more revert reasons to tests 2018-06-26 17:34:43 -07:00
Amir Bandeali
b6d8dcb6e1 Make dispatchTransferFrom revert with reason from AssetProxy on failure 2018-06-26 13:57:55 -07:00
Fabio Berger
43ae868c69 Merge branch 'refactor/check-revert-reasons' into feature/combinatorial-testing
* refactor/check-revert-reasons:
  Temporarily switch revert reasons to `TransferFailed`. Should be `InvalidAmount` but because of an oversight in the assembly implementation of `dispatchTransferFrom`, it always throws `TransferFailed`
  Expect RevertReason be passed in, not string
  Rename RevertReasons to RevertReason since singular enum names are more common

# Conflicts:
#	packages/contracts/test/asset_proxy/proxies.ts
#	packages/contracts/test/exchange/core.ts
2018-06-26 18:53:44 +02:00
Fabio Berger
1bc742aed1 Temporarily switch revert reasons to TransferFailed. Should be InvalidAmount but because of an oversight in the assembly implementation of dispatchTransferFrom, it always throws TransferFailed 2018-06-26 18:49:10 +02:00
Fabio Berger
9219f9d8ae Merge branch 'v2-prototype' into feature/combinatorial-testing
* v2-prototype: (21 commits)
  Don't use variables for revert reasons
  Add comments to dispatchTransferFrom
  Document IAssetData
  Compute bytes4 proxyid constants
  Return inplace bytes in LibBytes.readBytesWithLength
  Add Greg's documentation to MixinErc721Transfer
  Add Greg's documentation to MixinErc20Transfer
  Gas golf the transfer success logic
  Optimize like in PR #767
  Run prettier and fix linting errors
  Fix tests
  Update tests
  Fix AssetProxyUtils
  Update tests
  Fix ERC721Proxy TokenId
  Update AssetProxyUtils
  Add IAssetData
  WIP
  ABI encoded asset data
  Remove proxyId argument from dispatchTransferFrom
  ...

# Conflicts:
#	packages/contracts/test/asset_proxy/proxies.ts
2018-06-26 08:13:59 +02:00
Fabio Berger
27670f4da6 Rename RevertReasons to RevertReason since singular enum names are more common 2018-06-26 08:11:14 +02:00
Fabio Berger
e051743a3d Merge branch 'v2-prototype' into refactor/check-revert-reasons
* v2-prototype: (21 commits)
  Don't use variables for revert reasons
  Add comments to dispatchTransferFrom
  Document IAssetData
  Compute bytes4 proxyid constants
  Return inplace bytes in LibBytes.readBytesWithLength
  Add Greg's documentation to MixinErc721Transfer
  Add Greg's documentation to MixinErc20Transfer
  Gas golf the transfer success logic
  Optimize like in PR #767
  Run prettier and fix linting errors
  Fix tests
  Update tests
  Fix AssetProxyUtils
  Update tests
  Fix ERC721Proxy TokenId
  Update AssetProxyUtils
  Add IAssetData
  WIP
  ABI encoded asset data
  Remove proxyId argument from dispatchTransferFrom
  ...

# Conflicts:
#	packages/contracts/test/asset_proxy/proxies.ts
2018-06-26 08:07:37 +02:00
Remco Bloemen
f7337c1a05 Remove proxyId argument from dispatchTransferFrom 2018-06-25 16:19:07 -07:00
Fabio Berger
8064914bb7 Prettier fixes 2018-06-25 23:17:56 +02:00
Fabio Berger
1134ff1075 Fix tslint issues 2018-06-25 20:17:00 +02:00
Fabio Berger
1353723b58 merge check-revert-reasons 2018-06-25 13:02:38 +02:00
Fabio Berger
f811c07454 Move RevertReasons to @0xproject/types package 2018-06-25 12:59:26 +02:00
Fabio Berger
c50da5d034 merge check-revert-reasons 2018-06-25 12:32:16 +02:00
Fabio Berger
9b196ba68c Merge branch 'v2-prototype' into feature/combinatorial-testing
* v2-prototype: (97 commits)
  Fix typos in comments
  Add modifier and tests for removeAuthorizedAddressAtIndex
  Update and add tests
  Change removeAuthorizedAddress => removeAuthorizedAddressAtIndex
  Move isFunctionRemoveAuthorizedAddress to test
  Fix usage of `popLastByte`
  Fix LibBytes is a library
  Remove `areBytesEqual`
  Fix usage of `contentAddress()`
  Clean low bits in bytes4
  Clean high bits in address
  Refactor LibBytes.readBytes4 for consistency
  Fix LibBytes.equals
  Add trailing garbage testcase for LibBytes.equals
  Rename bytes.equals
  Add slice and sliceDestructive
  Rename bytes.rawAddress and add bytes.contentAddress
  Rename read/writeBytesWithLength
  Using LibBytes for bytes
  Make LibBytes a library
  ...

# Conflicts:
#	packages/contracts/src/utils/constants.ts
#	packages/contracts/test/exchange/core.ts
2018-06-25 11:49:14 +02:00
Fabio Berger
2f6f815d81 Fix tslint 2018-06-22 18:54:18 +02:00
Fabio Berger
4409f11b24 Rename ContractLibErrors to RevertReasons 2018-06-22 18:45:45 +02:00
Fabio Berger
76fd7f47eb Fix tests 2018-06-22 14:13:44 +02:00
Fabio Berger
3ce295a2af Merge branch 'v2-prototype' into refactor/check-revert-reasons
* v2-prototype: (40 commits)
  Use make-promises-safe as a preloader instead of manually importing
  Updated compiler runs to be 1,000,000
  Add event to setSignatureValidatorApproval, rename signer => signerAddress accross all contracts
  Add senderAddress to Fill and Cancel logs, add comments to events and types
  Fix Island component
  Add missing image assets for Chris and Mel
  Fix some bugs in sol-cov
  Remove unreachable PreSigned check
  Fix linting
  Buttons look hella disabled now
  Remove border radius, fix width issue for unlock step
  Add Chris and Mel to about page
  fix linter issues
  only call getLocationByOffset if source if defined
  Set settleOrder and settleMatchedOrders to private
  Prevent prettier issue
  Support mobile friendly onboarding flows
  Removed MixinSettlement. Moved `settleOrder` into `MixinExchangeCore` and `settleMatchedOrders` into `MixinMatchOrders`
  Migrations after rebasing
  Linter
  ...
2018-06-22 10:39:07 +02:00
Fabio Berger
a30107ab86 Check revert reason in dispatcher tests 2018-06-22 10:38:08 +02:00
Alex Browne
4012e31115
Use make-promises-safe as a preloader instead of manually importing 2018-06-21 19:17:33 -07:00
Amir Bandeali
6a073d5f86 Add senderAddress to Fill and Cancel logs, add comments to events and types 2018-06-21 16:09:38 -07:00
Fabio Berger
5706b29c8c remove .only 2018-06-21 17:06:44 +02:00
Fabio Berger
eaabe15863 Update core tests to actually check revert message 2018-06-21 16:53:05 +02:00
Fabio Berger
2ffab22185 Merge branch 'v2-prototype' into feature/combinatorial-testing
* v2-prototype: (22 commits)
  Fix closing parens in liborder
  Update after rebase
  ERC721Proxy Always call safeTransferFrom
  Rename makerEpoch => orderEpoch
  Make cancelOrdersUpTo compatible with sender abstraction
  Update PR template
  Use Image component instead of img tag
  Assembler orderHash function
  Optimize and remove redundant encodePacked
  Fix linting issue
  Fix bug where we do fetch balances on wallet login
  Check network state immediately instead of waiting for delay
  Fix onboarding persisting when changing routes
  Consolidate account state messaging logic
  Only elevate wallet zIndex when onboarding is in progress
  Rebase and update feedback
  Run linter
  Add Portal v2 logging
  Simplified handling of source < 32 edge case
  Basic EIP712 encoder
  ...
2018-06-20 13:25:29 +02:00
Amir Bandeali
6b08e6b809 Rename makerEpoch => orderEpoch 2018-06-19 13:52:23 -07:00
Fabio Berger
9acf4458c0 Remove hack in ERC20Wrapper 2018-06-19 17:38:15 +02:00
Fabio Berger
fb55def54f Add ability to tweak the relevant balances/allowances for the maker and taker for a fillScenario. Convert more of the core tests to the declarative form. 2018-06-15 00:03:00 +02:00
Fabio Berger
d31b051fc5 Replace initial set of legacy manually written fillOrder tests with declarative FillScenario tests 2018-06-14 10:41:04 +02:00
Amir Bandeali
5910bec52e Make ZRX_PROXY_ID constant rather than popping it from ZRX_ASSET_DATA 2018-06-12 11:45:02 -07:00
Greg Hysen
e4e3676095 Fixed up after rebasing. Contracts build and tests pass 2018-06-07 15:38:48 -07:00
Greg Hysen
e042e0ad32 Converged on naming scheme for asset data: renamed all instances of assetMetadata, proxyData, proxyMetadata to assetData 2018-06-07 15:38:48 -07:00
Fabio Berger
73429fc720 merge v2-prototype 2018-06-07 12:27:03 +02:00