Commit Graph

12812 Commits

Author SHA1 Message Date
David Sun
9401bb53e8 added testing for generating swap quotes 2019-07-11 15:15:08 -07:00
David Sun
347c6d02cf upgraded exchange sell with market sell 2019-07-11 15:15:08 -07:00
David Sun
64a0080616 add forwarder logic for market sell 2019-07-11 15:15:08 -07:00
David Sun
288a7d4cea refactored for market sell + buy 2019-07-11 15:15:08 -07:00
David Sun
1207b68f57 added market-sell logic 2019-07-11 15:15:08 -07:00
David Sun
2b82187fe0 expanded swap quoter to create market sell swap quotes 2019-07-11 15:15:08 -07:00
David Sun
3e2dbfc83c added testing to market utils for market sell 2019-07-11 15:15:08 -07:00
David Sun
6691f490bc changes to order utils 2019-07-11 15:15:08 -07:00
David Sun
a7db900e51 added types 2019-07-11 15:15:08 -07:00
David Sun
cfa2a90dae prettier 2019-07-11 15:15:08 -07:00
David Sun
feebb45e9d fixed linting issues 2019-07-11 15:15:08 -07:00
David Sun
13a2f3a330 updated to async 2019-07-11 15:15:08 -07:00
David Sun
1da8801084 switched from arrow functions 2019-07-11 15:15:08 -07:00
David Sun
7a7b17c4f3 fixed naming of utils 2019-07-11 15:15:08 -07:00
David Sun
2afb06de13 refactored forwarder to utilize utils 2019-07-11 15:15:08 -07:00
David Sun
ac771e2865 finished exchange swap quote consumer 2019-07-11 15:15:08 -07:00
David Sun
4b09204936 framework for exchange swap quote consumer 2019-07-11 15:15:08 -07:00
David Sun
e4a5518a7c refactored exchange swap quote consumer 2019-07-11 15:15:08 -07:00
David Sun
e83507ba98 added structure of exchange consumer 2019-07-11 15:15:08 -07:00
David Sun
6e5b77edb2 initial commit of exchange_swap_quote consumer 2019-07-11 15:15:08 -07:00
David Sun
98167da8fa fixing build issues
fixed build issues

prettier
2019-07-11 15:15:08 -07:00
David Sun
11d5fec59b changes on affiliate fee and other changes
bumped version to 7 and added changelog

updated package.json

revert change to package.json

trying this package.json config
2019-07-11 15:15:08 -07:00
David Sun
ed02f4ca88 switching consumer functions to async 2019-07-11 15:15:08 -07:00
David Sun
e7c612971d fixed percentage assertions 2019-07-11 15:15:08 -07:00
David Sun
242a2e21b5 updated comments
added comments to Forwarder Swap Quote Conusmer
2019-07-11 15:15:08 -07:00
David Sun
92a1e5413b change to affiliate fees 2019-07-11 15:15:08 -07:00
David Sun
e1ab9aa690 rewritten test cases for SwapQuoter
fixed testing for swap quoter + setup for consumer testing

added framework for testing consumers

added testing and updated some types
2019-07-11 15:15:08 -07:00
David Sun
222f7e6fd4 addressed reviews and light refactor
added comments to types and refactored some naming
2019-07-11 15:15:08 -07:00
David Sun
59001f827b finished forwarder consumer 2019-07-11 15:15:07 -07:00
David Sun
549bfe98f1 renamed asset-buyer + adding consumers 2019-07-11 15:15:07 -07:00
David Sun
64e3b6f5ee refactored ERC <> ERC for asset-buyer
minor update to interface
2019-07-11 15:15:07 -07:00
David Sun
2fdc0426ff temp fix for CI 2019-07-11 15:15:07 -07:00
F. Eugene Aumson
e6c70fda66 order_utils.py: pin eth-abi version (#1947)
Fixes broken builds due to new release of eth-abi.
2019-07-11 18:08:16 -04:00
Xianny
50da1354f3 Move CLI tests for abi-gen (#1930)
Closes #1925, #1926
2019-07-10 09:19:50 -07:00
Francesco Agosti
e503cacf57 Merge pull request #1916 from 0xProject/feature/website/add-theo
Adding Theo to team page
2019-07-08 13:57:36 -07:00
Fabio B
6a1e0edc78 Fix link to smart contracts 2019-07-08 21:45:40 +02:00
Xianny
048f5c2771 [Multilang] hardcode ABI into abi-gen-wrappers (#1883)
* Export artifacts and addresses from abi-gen-wrappers

* only export addresses, not artifacts

* abi-gen-wrappers no longer accept ContractAbi as constructor param

ABI is now hardcoded when wrapper is generated

* remove unused imports

* remove unused import

* changes after review

* fix method ordering

* update constructor args

* prettier

* statically enumerate ABI properties

* remove abi-gen-wrappers generated-wrappers from prettierignore

* add template for recursive components

* add `indexed` field for EventParameter

* prettier

* update known-good wrappers with ABIs and fix Python ABI loading

* remove generated-artifacts and update gitignore
2019-07-08 12:44:19 -07:00
F. Eugene Aumson
d9378e9a8f First auto-gen'd Python contract wrapper: ERC20 (#1878)
* abi-gen-wrappers: fix half-baked folder rename

* .circleci: give cache more descriptive name

* abi-gen: rename type field. tsName->langLocalName

* contract-artifacts: add devdoc to ERC20Token.json

Artifact changes crafted manually: re-generated artifacts from within
@0x/contracts-erc20, and then copied them into @0x/contract-artifacts,
but only committed the changes that added devdoc.

Modified @0x/contracts-erc20/compiler.json to include devdoc in the
hopes that next time contract-artifacts are re-generated en masse, the
devdoc output will just come along for the ride.

Compiling ERC20 TypeScript wrappers after adding devdoc to the artifacts
revealed some inconsistencies in the types.  ethereum-types'
DevdocOutput REQUIRED many fields which are not always present,
depending the devdoc contents itself.  Relaxing the requirement had some
ramifications.

* abi-gen: Python!

Lots more to come, but so far generating typed methods with some
parameter validation and with reasonable docstrings; enough to make
ERC20 work.

* existing erc20 python wrapper: re-order methods

In order to minimize the diff in the upcoming commit of the
auto-generated version.

* existing erc20 python wrapper: rename method

Rename method _erc20 to _get_contract_instance.

* existing erc20 python wrapper: rename vars

Rename method parameters to match names used in contract methods.

* existing erc20 python wrapper: correction

Contract method `allowance` previously was returning a transaction hash,
but it's a const method, so changed it to return the int that the
underlying method returns.

* contract_wrappers.py: pull in generated code

Custom setup.py command to pull in code previously generated into
../../packages/abi-gen-wrappers/src/generated-wrappers/py.

Changes to existing wrapper code reflect differences between the old,
manually-written wrapper and the new, auto-generated wrapper.

Reconfigured Circle CI to give Python build access to the output of the
TypeScript build, in order to import the generated wrappers from there.

* abi-gen: sanitize docstrings for pycodestyle lint

* abi-gen-templates.py: expose ABI from template

Use ABI given by template, not gotten by name from
zero_ex.contract_artifacts.

Also, expose ABI as a static method.

* py wrappers: contract addr to ctor, not methods

In all Python wrappers (old, manual ones; and new, generated ones), have
client pass the contract address to the wrapper's constructor, rather
than to the individual method calls.

* py wrappers: remove unused param `account_address`

* py wrappers: document use of `private_key`

* Rename file erc20_wrapper.py to erc20_token.py

To match the name of the underlying contract.

* Update CHANGELOG.json's

* git rm erc20_token.py

No need to keep it checked in.  Doing so would require manual overhead
of keeping the generated copy in sync with the generation code, which
may get overlooked and cause confusion for others.  Authoritative source
will be the published package on PyPI.

* abi-gen-templates: tweak CHANGELOG wording

Co-Authored-By: Fabio B <kandinsky454@protonmail.ch>

* Include transaction parameters in const calls too

* Doc contract_address param to gen'd wrapper ctor

* make myself a CODEOWNER of abi-gen*

* rename ids: langLocalName -> languageSpecificName

* Move Python generation to its own packages/ folder

* Stop duplicating contract artifacts in Python pkg!

Thanks to the way we're now using the `./setup.py pre_install`
convention, there's no longer a need to check the artifacts in to the
Python package.

* move py templates BACK to abi-gen-templates

I got a little overzealous in the previous commit that moved ALL the
python stuff into the new packages/python-contract-wrappers folder.

* Update known-good test output: prettify

* add getABIEncodedTransationData to gen'd code

It was added into the template in the following commit, but the
corresponding checked-in generated code was not updated accordingly.

f51c4f9617

* Fix missed instance of languageSpecificName change

* abi-gen: refine pipeline for testing gen'd code

- generate wrappers for test fixture contracts (dummy, etc) not in `yarn
build` but in `yarn test`

- rename folder test/generated-test/generated-wrappers to
test/generated-test/known-good, and stop writing test output to there,
instead writing it to a new test/generated-test/output folder.

- sol-compile test fixture contracts in every test run

- run unit tests separately from tests of generated and built TypeScript
wrappers.  The existing `yarn run_mocha` will run unit tests, and
there's a new `yarn run_contract_wrapper_tests`.

* abi-gen: test Python gen [known test failures]

Also generate TypeScript wrapper test code into a TypeScript folder
(alongside the newly created Python folder).

Known-good code manually corrected (from generated code) to reflect
known problems that still need to be addressed.  Namely:
  - base contract and tx params should be imported from canonical
    package, not relative path. relative path is working for wrapping
    OUR contracts, but would not be usable in a more general
    context.
  - return type missing for some generated methods.

These outstanding problems are currently causing this test to fail.

* fix failing abi-gen test: missing return types

* fix failing abi-gen test: qualify imports

* in py wrapper, simplify base class initialization

per
https://github.com/0xProject/0x-monorepo/pull/1878#discussion_r299248641

* move 3rd party typings to typescript-typings

* make package python-contract-wrappers private

* make Xianny CODEOWNER of base-contract & templates

* abi-gen: clarify --help for --backend

* remove superfluous CHANGELOG entry
2019-07-03 11:01:01 -04:00
Xianny
f77aaaf2e0 Merge pull request #1907 from 0xProject/multilang/add-devdoc
Add devdoc to all contract artifacts
2019-07-02 13:22:04 -07:00
Chris Kalani
380835b151 Added Theo to team page 2019-07-02 12:21:06 -07:00
Xianny
857d91df85 Add dummy contract to test abi-gen-wrappers (#1881) 2019-06-28 15:42:36 -07:00
xianny
cd9a6b0de7 add example devdoc 2019-06-28 13:25:16 -07:00
xianny
86333f4928 add devdocs to all artifacts 2019-06-27 22:00:41 -07:00
F. Eugene Aumson
d1975bd5dd contract-artifacts: add devdoc to ERC20Token.json
Artifact changes crafted manually: re-generated artifacts from within
@0x/contracts-erc20, and then copied them into @0x/contract-artifacts,
but only committed the changes that added devdoc.

Modified @0x/contracts-erc20/compiler.json to include devdoc in the
hopes that next time contract-artifacts are re-generated en masse, the
devdoc output will just come along for the ride.

Compiling ERC20 TypeScript wrappers after adding devdoc to the artifacts
revealed some inconsistencies in the types.  ethereum-types'
DevdocOutput REQUIRED many fields which are not always present,
depending the devdoc contents itself.  Relaxing the requirement had some
ramifications.
2019-06-27 21:08:54 -07:00
David Sun
08b9f27eac Merge pull request #1904 from 0xProject/feature/website/add-dydx-explore
Adding dYdX to Explore page
2019-06-27 10:25:23 -07:00
F. Eugene Aumson
5b2cf8a776 Restore original Python label 2019-06-27 10:03:22 -04:00
F. Eugene Aumson
7394106880 Another attempt at the snake emoji 2019-06-27 09:13:49 -04:00
Chris Kalani
9134a7ae1e Prettier 2019-06-26 17:10:15 -07:00
Chris Kalani
c617e9f483 Adding dYdX to explore page 2019-06-26 17:06:53 -07:00
Xianny
545fcef716 Update autolabeler.yml 2019-06-26 12:42:53 -07:00