56 Commits

Author SHA1 Message Date
Amir Bandeali
e6b81a824d Update ZeroExTransaction schema 2019-08-22 17:04:14 -07:00
Alex Towle
22c8a25a26 Merge branch 'development' into 3.0 2019-08-19 11:13:21 -07:00
Xianny
a8128c5772
Remove order-watcher (#2067)
* remove order-watcher
2019-08-14 14:34:59 -07:00
Amir Bandeali
6ddaa6f52a Add expirationTimeSeconds to ZeroExTransaction schema throughout codebase 2019-07-23 15:46:15 -07:00
Amir Bandeali
2f0ee84b71 Add fee assetData fields to order JSON schema 2019-07-23 15:23:40 -07:00
Lawrence Forman
376f068719 Add eip712DomainSchema to json-schemas.
Add required field `domain` to `order` and `zeroExTransaction` schemas.
2019-07-23 15:04:46 -07:00
Lawrence Forman
7a4ae74727 Add chainId to order JSON schema 2019-07-23 14:59:31 -07:00
F. Eugene Aumson
ead8099109
Auto-gen Python Exchange wrapper (#1919)
* Rename existing wrapper, to match contract name

* base contract: make member var public

* json_schemas.py: stop storing copies of schemas!

* .gitignore generated erc20_token.py wrapper

* json schemas: allow uppercase digits in address

* existing exchange wrapper: re-order methods

to match method order in Solidity contract, to reduce noise in upcoming
diffs of newly generated code vs. old manually-written code.

* existing exchange wrapper: rename method params

To match contract method param names

* existing exchange wrapper: remove redundant member

* existing exchange wrapper: make signatures bytes

Not strings.

* abi-gen/test-cli: show context on diff failure

* abi-gen-templates/Py: fix broken event interface

Previous changes had removed the `token_address` parameter from all
generated methods, but this instance was missed because there weren't
tests/examples using events for the first contract for which wrappers
were generated (ERC20Token).

* abi-gen: remove unused method parameters

* abi-gen: convert Py method params to snake case

* abi-gen: rewrite Python tuple handling

* python-generated-wrappers: include Exchange

* abi-gen-templates/Py: easy linter fixes

* abi-gen-templates/Py: satisfy docstring linters

* abi-gen-templates/Py: normalize bytes before use

* contract_wrappers.py: replace Exchange w/generated

* contract_wrappers.py: rm manually written Exchange

* contract_wrappers.py/doctest: rename variables

* abi-gen: fix misspelling in docstring

Co-Authored-By: Fabio B <me@fabioberger.com>

* Py docs: error on warning, and test build in CI

* abi-gen: doc Py bytes params as requiring UTF-8

* abi-gen: git mv diff.sh test-cli/

* abi-gen: put Py wrapper in module folder, not file

This leaves space for user-defined additions to the same module, such as
for custom types, as shown herein.

* abi-gen: customizable param validation for Python

* contract_wrappers.py: JSON schema Order validation

* CircleCI Build Artifacts

For abi-gen command-line test output, for generated Python contract
wrappers as output by abi-gen, for generated Python contract wrappers as
reformatted and included in the Python package area, and for the "build"
output folder in each Python package, which includes the generated
documentation.

* CHANGELOG updates for all components

* abi-gen: grammar in comments

Co-Authored-By: Fabio B <me@fabioberger.com>

* abi-gen: CHANGELOG spelling correction

Co-Authored-By: Fabio B <me@fabioberger.com>

* order_utils.py: reverse (chronological) CHANGELOG

* abi-gen-templates: reset CHANGELOG patch version

* CHANGELOGs: use multiple entries where appropriate

* abi-gen: enable devdoc solc output in test-cli

* abi-gen-templates/Py: consolidate return type

* abi-gen/test-cli: non-pure fixture contract method

Added a method to the "dummy" test fixture contract that isn't pure.
All of the other prior method cases were pure.

* abi-gen/Py: fix const methods missing return type

* abi-gen/Py: fix wrong return types on some methods

Specifically, wrapper methods wrapping contract methods that modify
contract state and return no return value.  There was no test case for
this.  Now there is.

* contract_wrappers.py: rm generated code in `clean`

* Parallelize Py monorepo scripts (test, lint, etc)
2019-07-23 12:58:18 -04:00
Amir Bandeali
eac254f925 Fix outdated comments and make verifyingContractAddress a required part of the 0x tx schema 2019-02-05 09:26:03 -08:00
Amir Bandeali
1ada679663 Update ZeroExTransactionSchema 2019-02-05 09:23:09 -08:00
F. Eugene Aumson
aa5af04447
Python contract demo, with lots of refactoring (#1485)
* Refine Order for Web3 compat. & add conversions

Changed some of the fields in the Order class so that it can be passed
to our contracts via Web3.

Added conversion utilities so that an Order can be easily converted to
and from a JSON-compatible dict (specifically by encoding/decoding the
`bytes` fields), to facilitate validation against the JSON schema.

Also modified JSON order schema to accept integers in addition to
stringified integers.

* Fixes for json_schemas

Has-types indicator file, py.typed, was not being included in package.

Schemas were not being properly gathered into package installation.

* Add test/demo of Exchange.getOrderInfo()

* web3 bug workaround

* Fix problem packaging contract artifacts

* Move contract addresses to their own package

* Move contract artifacts to their own package

* Add scripts to install, test & lint all components

* prettierignore files in local python dev env

* Correct missing coverage analysis for sra_client

* CI cache lint: don't save, re-use from test-python

* tag hacks as hacks

* correct merge mistake

* remove local strip_0x() in favor of eth_utils

* remove json schemas from old order_utils location

* correct merge mistake

* doctest json schemas via command-line, not code
2019-01-09 09:58:29 -05:00
F. Eugene Aumson
4689f20b86
Move json_schemas to its own package (#1435)
* Move zero_ex.json_schemas to its own package

* Support ALL the schemas

* Stop installing packages as editable

* HACK: cp files because CircleCI isn't

* Add example usage to sra_client README

* Tweak special case: only strip Schema as suffix

* Correct doc titles

* Clarify what kind of support ticket was raised.

* Correct inconsistencies in JSON schema names

In both ref ID's and file names.

* Add entry point for validation of JSON strings
2019-01-08 14:28:32 -05:00
F. Eugene Aumson
a3eab71908
Correct inconsistencies in JSON schema names
In both ref ID's and file names.
2018-12-28 15:08:15 -05:00
Fabio Berger
896c8d17c1 Fix schemas and tests 2018-12-16 17:31:38 -08:00
Fabio Berger
ee4185ab46 Move OrderWatcher Websocket schemas to json-schemas and convert to JSON so that they are language agnostic 2018-12-16 16:52:37 -08:00
Leonid Logvinov
33dbdb0184
Move connect schemas to JSON Schemas 2018-11-12 13:44:24 +01:00
Fabio Berger
632d7b6fc1 fix: improve schemas by enforcing that amounts that must be whole numbers (e.g Order asset amounts) no longer allow decimal numbers 2018-10-21 19:24:19 +02:00
Fabio Berger
b9dccf9da3 chore: add whole number schema 2018-10-21 19:20:36 +02:00
Fabio Berger
7d9009bb96 Convert all schemas to json files, so it's easier for devs in other languages to use it 2018-10-17 13:28:26 +01: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
adcfaa2e80
Expose eth_signTypedData functionality for order signing 2018-10-05 11:59:24 +10:00
fragosti
8f6a96740e Remove superflous id from relayer api fee recipients json schema 2018-08-24 08:25:34 -07:00
fragosti
44cc5e45cc Run prettier 2018-08-20 11:53:49 -07:00
fragosti
f2d1d95355 Remove default query parameters 2018-08-17 13:58:55 -07:00
fragosti
ca5e52920d Add fee recipients test 2018-08-15 17:52:13 -07:00
Fabio Berger
7340338626
Merge pull request #938 from 0xProject/sol-cov-fixes
Sol cov fixes
2018-08-13 16:40:46 -04:00
Leonid Logvinov
15e15f994a
Merge branch 'development' into sol-cov-fixes 2018-08-09 17:03:41 +02:00
fragosti
cc67c0df51 Correct orderbook typo 2018-08-08 14:18:24 -07:00
fragosti
76b91cbcda Enforce that error code are ints not number 2018-08-08 14:16:59 -07:00
fragosti
c9e1b7c5dc Change remainingFillableAmount to metaData 2018-08-08 11:57:16 -07:00
fragosti
95b656f360 Add GET fee_recipients 2018-08-07 17:42:52 -07:00
fragosti
0a616ad3b8 Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/sra/add-sra-package 2018-08-07 13:52:53 -07:00
Brandon Millman
e5d65b585a Update hex schema to match 0x 2018-08-05 18:33:52 -04:00
Leonid Logvinov
ab398751e1
Alow additional properties in txData json-schema 2018-08-03 13:34:40 +02:00
fragosti
0390a5ecbf Limit error codes with ranges 2018-08-02 18:08:36 -07:00
fragosti
afc5c2616a Enforce stronger naming convention for json schema ids 2018-08-02 11:57:23 -07:00
fragosti
962d6e71b6 update orders channel subscribe schema 2018-08-01 13:52:40 -07:00
fragosti
a78d35f84e Add test for relayerApiOrderSchema 2018-07-31 17:22:26 -07:00
fragosti
63e869f6d0 Add paginated collection test case 2018-07-31 17:04:22 -07:00
fragosti
4aff9515d8 Get schema tests running (not crashiing) 2018-07-31 16:37:51 -07:00
fragosti
e671563f1e Update json-schemas for SRA v1 2018-07-30 17:16:14 -07:00
Jacob Evans
6529e06057
Rename call data schema id to CallData.
Check for TypedArray when hashing data in order-utils crypto
2018-07-19 17:51:03 +10:00
Leonid Logvinov
01c6efeaf1
Merge branch 'v2-prototype' into v2-contract-wrappers-WIP 2018-07-05 17:00:50 +03:00
Leonid Logvinov
3cc1a952ca
Add ordersSchema to json-schemas 2018-07-05 15:05:57 +02:00
Fabio Berger
2a7b3aecc3 Add CallData schema to json-schemas 2018-07-05 12:33:48 +02:00
Fabio Berger
3302c89284 Revivie the ECSignatureSchema 2018-05-30 13:52:27 -07:00
Fabio Berger
4874d55d03 Initial refactor of order-utils. Move many utils from contracts into this package. 2018-05-29 16:58:30 -07:00
Fabio Berger
662dc12877 Add senderAddress to order schema 2018-05-24 16:05:07 -07:00
Fabio Berger
3ec05bb5d8 Force hex to have at least two hex values after the prefix, but it could be two zeros 2018-05-23 17:36:34 -07:00