47 Commits

Author SHA1 Message Date
Jacob Evans
ad8caa2b51
Remove moved RevertErrors 2019-11-27 11:52:14 +11:00
Michael Zhu
c1d78a94a2 move ValidatorWalletAction to signature_validator.ts 2019-11-15 09:53:06 -08:00
Michael Zhu
7f4cbba076 Refactor integrations directory structure; move core.ts, balance stores, and FillOrderWrapper to integrations 2019-11-15 09:49:20 -08:00
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
Xianny
f0d7d10fe7
update abi-gen with new method interfaces (#2325)
* update abi-gen with new method interfaces

* wip: get all packages to build

* wip: get all packages to build

* Fix two contract wrapper calls

* Export necessary types part of the contract wrapper public interfaces

* Revive and fix wrapper_unit_tests

* Remove duplicate type

* Fix lib_exchange_rich_error_decoder tests

* Fix remaining test failures in contracts-* packages

* Prettier fixes

* remove transactionHelper

* lint and update changelogs

* Fix prettier

* Revert changes to reference docs

* Add back changelog already published and add revert changelog entry

* Add missing CHANGELOG entries

* Add missing comma

* Update mesh-rpc-client dep

* Update Mesh RPC logic in @0x/orderbook to v6.0.1-beta

* Align package versions
2019-11-14 11:22:29 -05:00
fabioberger
6324a92ec5 Refactor contracts-* exports so none in test dir so npmignore works as intended 2019-11-11 21:49:29 +00:00
fabioberger
15a5bc02ef Fix remaining build issues 2019-11-11 00:13:44 +00:00
Xianny
6a852ab0ed
Replace assetDataUtils with DevUtilsContract wherever possible (#2304)
* Replace assetDataUtils with DevUtilsContract wherever possible

Does not replace from @0x/instant and some @0x/order-utils uses

* Add revertIfInvalidAssetData to LibAssetData

This is needed to replace `assetDataUtils.decodeAssetDataOrThrow`.
Because it's used in packages and not only contracts, we should wait
to deploy the updated contract so we can update `@0x/contract-artifacts`,
`@0x/abi-gen-wrappers`, and `@0x/contract-wrappers` first.

* remove usages of signatureUtils

* fix test for  optimised encoding

* refactor @0x/contracts-integrations

* update changelogs

* Move @0x/contracts-dev-utils from devDependencies to dependencies
It is exported as part of the package
2019-11-06 19:40:20 -08:00
fragosti
f0e0f08e0c Run linter and prettier 2019-09-25 18:44:19 -07:00
fragosti
9870f55d24 Remove domain from Order type 2019-09-25 18:44:19 -07:00
Amir Bandeali
ae75aed55e Change verifyingContractAddress -> verifyingContract everywhere 2019-09-23 16:00:37 -07:00
Amir Bandeali
bb46f184ed Remove use of generatePseudoRandomAddress in favor of randomAddress 2019-09-17 10:46:58 -07:00
Amir Bandeali
ea8669439f Minor styling and naming changes 2019-09-03 09:48:21 -07:00
Amir Bandeali
48dfb3317a Fix tests 2019-09-02 14:36:27 -07:00
Amir Bandeali
e880447714 Refactor EIP1271Wallet and Validator types to use new EIP1271SignatureError 2019-09-02 11:38:52 -07:00
Amir Bandeali
c156bfc534 Remove TestValidatorWallet DataType 2019-08-30 11:39:28 -07:00
Alex Towle
22c8a25a26 Merge branch 'development' into 3.0 2019-08-19 11:13:21 -07:00
Lawrence Forman
fc18db10be @0x/contracts-exchange: Add tests for when callback signature types return incorrect data. 2019-08-12 19:10:24 -04:00
Lawrence Forman
5b0b8a9717 @0x/contracts-exchange: Remove explicit signerAddress parameter from many MixinSignatureValidator functions. 2019-08-12 18:10:57 -04:00
Lawrence Forman
3dd8dac146 @0x/contracts-exchange: Update Wallet signature type behavior to match v2.1.
`@0x/contracts-exchange`: Add EOA tests to `signature_validator`.
2019-08-09 22:15:33 -04:00
Lawrence Forman
0851c5ac8e @0x/contracts-exchange: Run prettier. 2019-08-06 15:27:39 -04:00
Lawrence Forman
7fb87d4039 @0x/contracts-exchange: Update signature and rich error decoder tests
to use `hexRandom()` and `blockchainTests()`.
2019-08-06 15:27:39 -04:00
Alex Towle
8c5c81fe70 Change all instances of throw to revert in it tests 2019-08-01 15:13:16 -07:00
Greg Hysen
df746c5ff4 Decode log arguments in awaitTransactionSuccessAsync, when ABI is recognized. 2019-07-29 12:04:37 +02:00
Lawrence Forman
d6ba03916a @0x/contracts-exchange: Update tests for new/consolidated signature types.
`@0x/contracts-exchange`: Update `Whitelist` example for new signature types.
2019-07-23 15:53:24 -07:00
Lawrence Forman
7a0dc7a364 @0x/contracts-exchange: Add isValidHashSignature() back.
`@0x/contracts-exchange`: Remove references to removed signature types and associated functions.
2019-07-23 15:53:24 -07:00
Lawrence Forman
5dfb65b084 @0x/contracts-exchange: Fix comments in test/signature_validator.ts 2019-07-23 15:53:24 -07:00
Lawrence Forman
309dd7f300 Run prettier/linter 2019-07-23 15:53:24 -07:00
Lawrence Forman
33df11b755 @0x/contracts-exchange: Rename WalletOrderValidator to OrderWallet signature type
`@0x/contracts-exchange`: Rename `SignatureWalletOrderValidatorError` to `SignatureOrderWalletError`
`@0x/contracts-exchange`: Add `IEIP1271Wallet` interface
`@0x/contracts-exchange`: Add `EIP1271Wallet` and `EIP1271OrderWallet` to `SignatureType`
`@0x/contracts-exchange`: Always check `OrderValidator`, `OrderWallet`, `EIP1271OrderWallet` signature types on every fill
`@0x/contracts-exchange`: Add tests for EIP1271 signature types.
`@0x/contracts-exchange`: Update `LibExchangeRichErrorDecoder` for new/renamed Error types.
2019-07-23 15:53:24 -07:00
Lawrence Forman
dee5ff852d @0x/contracts-exchange: Have TestValidatorWallet always accept WalletOrderValidator if makerAddress == this.
`@0x/contracts-exchange`: Update tests for repeatable signature validation.
2019-07-23 15:53:24 -07:00
Lawrence Forman
42f7b7cc19 @0x/contracts-exchange: Always check OrderValidator and WalletOrderValidator signature types on every fill
`@0x/contracts-exchange`: Add `validatorAddress` field to `SignatureValidatorError` and `SignatureOrderValidatorError` rich reverts
`@0x/contracts-exchange`: Add separate `SignatureOrderValidatorNotApprovedError` for `OrderValidator` signatures
`@0x/contracts-exchange`: Consolidate Wallet and Validator test contracts into a single configurable `TestValidatorWallet` contract.
`@0x/contracts-exchange`: Rewrite many tests in `signature_validator.ts` for brevity.
2019-07-23 15:53:24 -07:00
Lawrence Forman
5f8ebc3601 @0x/base-contract: Make PromiseWithTransactionHash fully compatible with regular Promise types.
`@0x/contracts/exchange` Make `OrderValidator` and `WalletOrderValidator` signature types checked for every fill (not just first)'
2019-07-23 15:53:24 -07:00
Lawrence Forman
c84a0b8415 @0x/contracts-exchange: Fix matchOrders and signature tests. 2019-07-23 15:23:40 -07:00
Amir Bandeali
24906138c7 Make preSign compatible with executeTransaction 2019-07-23 15:19:33 -07:00
Lawrence Forman
0bcd47b394 Add OrderValidator and WalletOrderValidator signature strategies to Exchange (#1774)
* In `@0x/contracts-exchange`: Add `SignatureType.OrderValidator` support to contracts and refactor signature validation functions.

* In `@0x/types`: Add `SignatureType.OrderValidator` and `RevertReason.InappropriateSignature`.

* In `@0x/contracts-exchange`: Fix contracts and update tests for `SignatureType.OrderValidator`.

* Ran prettier/linter

* Update changelogs

* In `@0x/order-utils`: Add `SignatureOrderValidatorError` to `ExchangeRevertErrors`.

* In `@0x/contracts-exchange`: Add `SignatureOrderValidatorError` rich revert. Fix rebase issues. Rename `IValidator.isValidOrder` to `IValidator.isValidOrderSignature`.

* In `@0x/contracts-exchange`: Add revert test cases for `OrderValidator` signature type.

* In `@0x/order-utils`: Update changelog.

* In `@0x/contracts-exchange`: Split off `SignatureType.OrderValidator` scheme into its own interface and registry.

* In `@0x/types`: Add `SignatureType.WalletOrderValidator`.

* In `@0x/order-utils`: Add `SignatureWalletOrderValidatorError`.

* In `@0x/contracts-exchange`: Add `SignatureType.WalletOrderValidator` support.

* Ran prettier

* In `@0x/types`: Remove `RevertReason.WalletOrderValidator`.

* Update/fix changelogs in `@0x/contracts-exchange`, `@0x/order-utils`, and `@0x/types`.

* In `@0x/contracts-exchange`: Make `isValidOrderSignature` `external` instead of `public`.

* In `@0x/contracts-exchange`: Change `isValidOrderSignature` back to `public` because passing `calldata` to internal functions isn't supported.
2019-07-23 15:18:26 -07:00
Lawrence Forman
eb00ff05a8 Ran prettier/linter 2019-07-23 15:17:57 -07:00
Lawrence Forman
a7fe47f295 In @0x/contracts-exchange: Add SignatureWalletError and SignatureValidatorError rich reverts.
In `@0x/contracts-exchange`: Change `AssetProxyTransferError` to accept a `revertData` bytes instead of a `revertReason` string.
In `@0x/contracts-exchange`: Aadd `contracts/test/TestRevertReceiver.sol` for testing that validator/wallet reverts are properly wrapped.
2019-07-23 15:17:57 -07:00
Lawrence Forman
a0223835b8 In @0x/order-utils: Add signerAddress and signature to ExchangeRevertErrors.SignatureError.
In `@0x/contracts-exchange`: Add `signerAddress` and `signature` to `SignatureError` reverts.
2019-07-23 15:17:56 -07:00
Lawrence Forman
ac18359410 Switch order of parameters in some rich reverts for easier dirty parsing. 2019-07-23 15:17:56 -07:00
Lawrence Forman
233336ea16 Ran prettier and linter 2019-07-23 15:17:56 -07:00
Lawrence Forman
20d8c1b51a In @0x/contracts-exchange: Update tests for rich reverts 2019-07-23 15:17:56 -07:00
Lawrence Forman
b8f056b82f Update coordinator, exchange-forwarder, exchange-libs, exchange, and extensions contract tests to use new order and transaction structure 2019-07-23 15:08:00 -07:00
Lawrence Forman
2d28fde24d Migrate all contract-related tooling and tests to accept a chain ID in domain separators. 2019-07-23 14:58:00 -07:00
Leonid Logvinov
6943bbcacb
Temp 2019-02-04 10:38:02 +01:00
Amir Bandeali
0758f231e2 Split tokens package into erc20 and erc721 2019-01-21 21:41:21 -08:00
Amir Bandeali
9fa8619590 Move contents of examples and interfaces packages into corresponding packages 2019-01-21 21:41:21 -08:00
Amir Bandeali
4a4c26a2e3 Split protocol package into exchange, asset-proxy, and multisig 2019-01-21 21:41:21 -08:00