25 Commits

Author SHA1 Message Date
F. Eugene Aumson
f11d8a5bd8
@0x/order-utils refactors for v3: orderParsingUtils, signatureUtils, orderHashUtils, RevertErrors, transactionHashUtils (#2321)
* move orderParsingUtils from order-utils to connect

* Remove many functions from signatureUtils

Removed from the exported object, that is.  All of them are used in
other existing code, so they were all moved to be as local to their
usage as possible.

* remove orderHashUtils.isValidOrderHash()

* Move all *RevertErrors from order-utils...

...into their respective @0x/contracts- packages.

* Refactor @0x/order-utils' orderHashUtils away

- Move existing routines into @0x/contracts-test-utils

- Migrate non-contract-test callers to a newly-exposed getOrderHash()
method in DevUtils.

* Move all *RevertErrors from @0x/utils...

...into their respective @0x/contracts- packages.

* rm transactionHashUtils.isValidTransactionHash()

* DevUtils.sol: Fail yarn test if too big to deploy

* Refactor @0x/order-utils transactionHashUtils away

- Move existing routines into @0x/contracts-test-utils

- Migrate non-contract-test callers to a newly-exposed
getTransactionHash() method in DevUtils.

* Consolidate `Removed export...` CHANGELOG entries

* Rm EthBalanceChecker from devutils wrapper exports

* Stop importing from '.' or '.../src'

* fix builds

* fix prettier; dangling promise

* increase max bundle size
2019-11-14 17:14:24 -05:00
Amir Bandeali
8b695f9b98 Fix race condition in tests 2019-10-08 09:12:37 +09:00
Amir Bandeali
d914f6fce9 Test for failure with bad signature after partial fill 2019-10-08 09:12:37 +09:00
fragosti
8ba38b9b29 Remove the OrderWithoutDomain type 2019-09-25 18:44:19 -07:00
Amir Bandeali
67ef17f929 Consolidate TransactionSignatureError with SignatureError 2019-09-08 18:55:42 -07:00
Amir Bandeali
90ac5ec577 Fix tests 2019-09-03 20:11:48 -07:00
Amir Bandeali
75a8b1c081 Use same taker numerator/denominator for all math in calculateFillResults 2019-09-03 09:48:16 -07:00
Alex Towle
dba0d8469d @0x:contracts-exchange Addressed review feedback 2019-08-29 15:20:52 -07:00
Alex Towle
2c970a0466 @0x:contracts-exchange Added protocol fees to fill order 2019-08-28 15:01:30 -07:00
Michael Zhu
078b1af04e Binop -> BinOp 2019-08-26 16:06:31 -07:00
Michael Zhu
98e5b26eb7 refactor SafeMath rich errors and use them in staking libs 2019-08-26 15:49:09 -07:00
Lawrence Forman
e3aa76cd09 @0x/contracts-exchange: Light refactoring in
`isolated_fill_order.ts` and `isolated_exchange_wrapper.ts`.
2019-08-08 11:43:55 -04:00
Lawrence Forman
6345faa4a9 `@0x/contracts-exchange-libs: Appease the linter and prettier gods. 2019-08-06 15:30:59 -04:00
Lawrence Forman
4711ce5532 @0x/contracts-exchange: Remove _assertValidFill().
`@0x/contracts-exchange`: Add `_settleOrder()` unit tests.
`@0x/contracts-exchange`: Add explicit tests for
`_calculateFillResults()`.
`@0x/contracts-exchange`: Add overflow tests to `isolated_fill_order`
tests.
`@0x/contracts-exchange`: Add explicit `takerAssetFillAmount = 0` test
to `isolated_fill_order` tests.
2019-08-06 15:30:59 -04:00
Lawrence Forman
51391b7f0e @0x/contracts-exchange-libs: Correct internal variable naming in src/index.ts.
`@0x/contracts-utils`: Correct internal variable naming in `src/index.ts`.
`@0x/contracts-exchange`: Remove functions from `TestExchangeInternals.sol` that are now in other packages.
`@0x/contracts-exchange`: Remove `TestExchangeMath.sol`. Exchange math functions are now tested in `@0x/contracts-exchange-libs`.
`@0x/contracts-exchange`: Move `ReferenceFunctions` to default package export.
`@0x/contracts-exchange`: Update `match_order.ts` tests to use reference math functions instead of `TestExchangeMath`.
`@0x/contracts-exchange`: Remove `_updateFilledState()` combinatorial tests in favor of normal unit testing. Combinatorial testing was overkill.
`@0x/contracts-exchange`: Update/refactor `calculateFillResults()` combinatorial tests to use the reference functions and hide them behind `TEST_ALL`.
2019-08-06 15:30:59 -04:00
Lawrence Forman
9d5b23acd3 @0x/contracts-exchange: Update tests in isolated_fill_order.ts. 2019-08-06 15:30:30 -04:00
Lawrence Forman
41e04c0178 @0x/contracts-exchange: Add a buttload of tests to
`isolated_fill_order.ts`.
2019-08-06 15:30:30 -04:00
Lawrence Forman
898213bb85 @0x/contracts-exchange: Update tests for moved types. 2019-08-06 15:30:30 -04:00
Lawrence Forman
c54d69e5ae @0x/contracts-exchange: Create reference functions test util.
`@0x/contracts-exchange`: Use reference functions to assert fill results
in `isolated_fill_order` tests.
2019-08-06 15:27:39 -04:00
Lawrence Forman
e2bd80253b @0x/contracts-exchange: More TestIsolatedExchange rework. 2019-08-06 15:27:39 -04:00
Lawrence Forman
039cc6e28b @0x/contracts-exchange: Allow fetching of balance of multiple assets
in `TestIsolatedExchange` contract.
`@0x/contracts-exchange`: Refactor `IsolatedExchangeWrapper` to be more
extensible.
2019-08-06 15:27:39 -04:00
Lawrence Forman
1030c96eec @0x/contracts-exchange: Create IsolatedExchangeWrapper class. 2019-08-06 15:27:39 -04:00
Lawrence Forman
d974ee169a @0x/contracts-exchange: Rename TestExchangeIsolated.sol ->
`TestIsolatedExchange.sol`.
`@0x/contracts-exchange`: Automatically track raw asset balances in
`TestIsolatedExchange` contract.
2019-08-06 15:27:39 -04:00
Lawrence Forman
cfa362321d @0x/contracts-exchange: Switch to TestExchangeIsolated contract for
`isolated_fill_order` tests.
2019-08-06 15:27:39 -04:00
Lawrence Forman
72c7157138 @0x/contracts-exchange: Start work on isolated fill order tests. 2019-08-06 15:27:39 -04:00