From aa5af04447dfae24731557c6beead55bd8ff99a9 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Wed, 9 Jan 2019 09:58:29 -0500 Subject: 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 --- python-packages/contract_demo/README.md | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 python-packages/contract_demo/README.md (limited to 'python-packages/contract_demo/README.md') diff --git a/python-packages/contract_demo/README.md b/python-packages/contract_demo/README.md new file mode 100644 index 000000000..3a0f964e3 --- /dev/null +++ b/python-packages/contract_demo/README.md @@ -0,0 +1,39 @@ +## 0x-contract-demo + +A demonstration of calling 0x smart contracts from Python. + +Read the [documentation](http://0x-contract-demo-py.s3-website-us-east-1.amazonaws.com/) + +## Contributing + +We welcome improvements and fixes from the wider community! To report bugs within this package, please create an issue in this repository. + +Please read our [contribution guidelines](../../CONTRIBUTING.md) before getting started. + +### Install Code and Dependencies + +Ensure that you have installed Python >=3.6 and Docker. Then: + +```bash +pip install -e .[dev] +``` + +### Test + +Tests depend on a running ganache instance with the 0x contracts deployed in it. For convenience, a docker container is provided that has ganache-cli and a snapshot containing the necessary contracts. A shortcut is provided to run that docker container: `./setup.py ganache`. With that running, the tests can be run with `./setup.py test`. + +### Clean + +`./setup.py clean --all` + +### Lint + +`./setup.py lint` + +### Build Documentation + +`./setup.py build_sphinx` + +### More + +See `./setup.py --help-commands` for more info. -- cgit v1.2.3