587 Commits

Author SHA1 Message Date
Fabio Berger
8efc6c2112 Remove unnecessary conversion to BigNumber 2018-11-12 10:25:33 +01:00
Fabio Berger
8aeb18bcc3 rename param 2018-11-12 10:22:03 +01:00
Fabio Berger
1f0ac47bd9 Move signature validation into OrderValidationUtils.validateOrderFillableOrThrowAsync 2018-11-10 00:14:48 +01:00
Fabio Berger
857a35d4f7 Fix validateOrderFillableOrThrowAsync method so it also checks order signature, cancelled, cancelledUpTo, and throws helpful error messages 2018-11-09 00:45:48 +01:00
Amir Bandeali
56953320b3 Run prettier and linter 2018-10-23 10:07:48 -07:00
Greg Hysen
e086c7b8e6 Round up for Market Buys in Forwarding Contract. Includes new test cases + regression testing. 2018-10-23 09:56:03 -07:00
Jacob Evans
9f924e459c
chore: change package org from 0xproject to 0x 2018-10-18 22:27:31 +11:00
Alex Browne
81c4887241 Move generated contract wrappers and artifacts into contracts package 2018-10-15 13:36:09 -07:00
Jacob Evans
9e8031d5e3
Throw and handle errors from Providers.
In web3 wrapper when a response contains an error field we throw this rather than return response.result which is often undefined.
In Signature Utils we handle the error thrown when a user rejects the signing dialogue to prevent double signing.
Exposed the ZeroExTransaction JSON schema.
In Website only use the MetamaskSubprovider if we can detect the provider is Metamask
2018-10-09 19:01:36 +11:00
Jacob Evans
75d274f330
Return SignedOrder from signing utils.
Create a helper back in EIP712Utils for code cleanup.
Moved constants in order-utils into the constants object
2018-10-05 17:12:17 +10:00
Jacob Evans
3e2fe40a11
Add eth_signTypedData support to our wallet subproviders 2018-10-05 12:02:09 +10:00
Jacob Evans
07926ded6e
Introduce Metamask Subprovider.
MM has a number of inconsistencies with other providers when implementing the JSON RPC interface. This subprovider wraps those nuances so they do not leak into the rest of our code
2018-10-05 12:00:41 +10:00
Fabio Berger
d0448c2bbd Fix bug where if block wasn't found, getBlockAsync would throw. Now it returns undefined 2018-09-24 15:02:06 +01:00
Alex Browne
9858bb0ce4 Fix bug in contracts tests 2018-09-04 18:10:13 -04:00
Amir Bandeali
f6b6619c08 Fix geth tests 2018-09-04 07:57:47 -07:00
Amir Bandeali
e480e08aa4 Add test for external_call visibility 2018-09-04 07:57:47 -07:00
Amir Bandeali
652cf7a976 Add MultiSigWalletWithTimeLock revert reasons to tests 2018-09-04 07:57:47 -07:00
Amir Bandeali
9deec8ec35 Add more tests for MultiSigWalletWithTimeLock 2018-09-04 07:57:47 -07:00
Amir Bandeali
3f1586045c Add test for executeRemoveAuthorizedAddressAtIndex when called by non-owner 2018-09-04 07:57:47 -07:00
Amir Bandeali
cb4fcf4de7 Revert in Forwarder constructor if ERC20 proxy isn't registered 2018-09-03 20:35:00 -07:00
Francesco Agosti
66eef758c6
Merge pull request #1047 from 0xProject/feature/re-add-no-unused-variables
Re-add no-unused-variable tslint rule
2018-08-30 15:38:21 -07:00
Greg Hysen
5802713801
Merge pull request #1046 from 0xProject/fix/contracts/roundingFeeTestsMatchOrders
Test cases for rounding fees in matchOrders
2018-08-30 14:27:01 -07:00
fragosti
80b7a7842c run prettier 2018-08-30 13:47:33 -07:00
fragosti
1d5ef4d0ca Fix unused vars for react-shared and website 2018-08-30 13:28:07 -07:00
Amir Bandeali
81ba2a8411
Merge pull request #1045 from 0xProject/feature/contracts/cancelOrderInternal
Add cancelOrderInternal, use within batchCancelOrders
2018-08-30 13:07:51 -07:00
Greg Hysen
0be2219beb Test cases for rounding fees in matchOrders 2018-08-30 12:23:11 -07:00
Amir Bandeali
09b4d5e0e4 Add cancelOrderInternal, use within batchCancelOrders 2018-08-30 12:10:24 -07:00
Amir Bandeali
d0f6933980 Add tests for token that returns >32 bytes 2018-08-30 09:27:28 -07:00
Amir Bandeali
14793f30b5 Add more proxy tests 2018-08-30 09:27:28 -07:00
Amir Bandeali
86319291e3 Update used addresses for authorizable tests 2018-08-30 09:27:28 -07:00
Amir Bandeali
afa2dd7374 Add test for fillOrder and dispatchTransferFrom where maker == taker 2018-08-30 09:26:44 -07:00
Amir Bandeali
d80701c277 Fix geth tests 2018-08-29 15:35:09 -07:00
Amir Bandeali
dcb12b6ad6 Update AssetProxyOwner to 0.4.24 2018-08-29 14:12:10 -07:00
Greg Hysen
6cedf5362b
Merge pull request #1039 from 0xProject/fix/contracts/audit2Fixes
Fixes as-per Audit for LibBytes + ERC20 Proxy Comments
2018-08-29 13:53:49 -07:00
Greg Hysen
aa833ef074 Typos in LibBytes tests 2018-08-29 13:26:46 -07:00
Greg Hysen
62b93cf2eb More tests for LibBytes 2018-08-29 13:14:51 -07:00
Greg Hysen
1c3b2b7141 Updated readBytes4 to match spec + added unit tests. These are 3.5/3.6 from audit 2018-08-29 11:39:52 -07:00
Alex Browne
e7d5ceb9c5
feat: Add support for TypeScript project references (#991)
* Update all package.json and tsconfig.json

* fix(contracts): Make test/utils/web3_wrapper.ts compatible with project refs

* Fix webpack config for 0x.js

* Fix linter errors by adding rootDir to tsconfig.json as needed

* Add build:ts and watch:ts commands to package.json

* Update sra-spec to work with project references

* Update tsconfig.json with latest new/removed packages

* Add TypeScript as devDependency at root

* Add missing rootDir to forwarder-helper package

* Use a separate tsconfig file for typedoc

* Fix linter errors

* Apply PR feedback (add comments)

* Fix 0x.js tsconfig
2018-08-29 11:15:30 -07:00
Amir Bandeali
f225f9e7c8 Making rounding consistent in calculateFillResults 2018-08-28 13:25:05 -07:00
Amir Bandeali
14fdb71a71
safeGetPartialAmount (#1035)
* Added Test "Should transfer correct amounts when left order is fully filled and values pass isRoundingErrorCeil but fail isRoundingErrorFloor"

* Added RoundingError exception to reference function for getPartialAmount

* Added RoundingError exception to reference function for getPartialAmount

* Added isRoundingErrorCeil to getPartialAmountCeil reference funtion

* Computed new values  for "Should give right maker a better buy price when correct price is not integral" that does not have a rounding error

* Almost all tests for match orders are passing after adding isRoundingErrorCeil check

* WIP commit: Added rounding error checks to getPartialAmount

* WIP commit: Added rounding error checks to getPartialAmount

* Use safe versions of getPartialAmount

* Update Exchange internals tests

* Run linter

* Found new values for "Should transfer correct amounts when right order fill amount deviates from amount derived by `Exchange.fillOrder`"

* Fixed merge conflicts

* Run all tests

* Cleaned up some comments on match Orders tests

* Fix tests for geth
2018-08-28 13:00:49 -07:00
Alex Browne
2eab0e30b7
fix(contracts): Catch cases where the actual error differs from the expected error (#1032)
* Catch cases where the actual error differs from the expected error

* Add tests for testWithReferenceFuncAsync

* Small style and comment fixes
2018-08-27 16:07:38 -07:00
Alex Browne
ff4f86f1d6
fix(contracts): Use correct error message for division by zero 2018-08-27 11:19:25 -07:00
Greg Hysen
287830d6e0 Run all tests 2018-08-24 18:20:26 -07:00
Greg Hysen
c7a7ae7e18 Give right maker better price when correct value is not integral 2018-08-24 18:20:26 -07:00
Greg Hysen
1c7ba6a315 Extract only fill event logs 2018-08-24 18:20:26 -07:00
Greg Hysen
6833e243b7 Addressed linter errors in match order tesster 2018-08-24 18:20:25 -07:00
Greg Hysen
f8e565bc06 Tests for matchOrders edge cases 2018-08-24 18:20:25 -07:00
Greg Hysen
ba15fb6a06 Swapped direction of expect values to match output in failure cases 2018-08-24 18:20:25 -07:00
Greg Hysen
1e6b83719a Renaming verify -> assert in order matching 2018-08-24 18:20:25 -07:00
Greg Hysen
9fcb2dda73 Fixed a function comment 2018-08-24 18:20:25 -07:00