-
Notifications
You must be signed in to change notification settings - Fork 465
Feature/python/new_demos #1726
Feature/python/new_demos #1726
Conversation
Blocked until #1730 is merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I must admit I'm a little confused about this one. The content is looking great, but I'm not sure this is the right place for it. I would think that a lot of these demos would be better placed in the docstrings of the packages/modules they're demonstrating. I added more specific comments for each one.
"""Demonstration of creating and validating orders.""" | ||
|
||
|
||
def create_order(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would think this demo would be better placed in the zero_ex.order_utils
module docstring.
def validate_order(): | ||
"""Validate a 0x order. | ||
|
||
>>> from zero_ex.json_schemas import assert_valid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would think this demo would be better placed in the zero_ex.json_schemas
module docstring.
@@ -0,0 +1,137 @@ | |||
"""Demonstration of using the python sra_client.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would think this demo would be better placed in the zero_ex.sra_client
module docstring.
... network_id=42, signed_order_schema=example_signed_order) | ||
>>> response[1] | ||
200 | ||
""" # noqa: E501 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
""" # noqa: E501 | |
""" # noqa: E501 (line too long) |
'taker_asset_amount': '500000000000000000000', | ||
'taker_asset_data': '0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa', | ||
'taker_fee': '0'}}]} | ||
""" # noqa: E501 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
""" # noqa: E501 | |
""" # noqa: E501 (line too long) |
'taker_asset_data': '0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa', | ||
'taker_fee': '0'}}, | ||
""" # noqa: 501 | ||
# NOTE: sra_client not deserialzing order from server properly, need fix! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please raise a GitHub Issue to describe this problem.
'maxAmount': '115792089237316195423570985008687907853269984665640564039457584007913129639936', | ||
'minAmount': '0', | ||
'precision': 18}}]} | ||
""" # noqa: E501 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
""" # noqa: E501 | |
""" # noqa: E501 (line too long) |
'taker_asset_data': '0xf47261b00000000000000000000000002002d3812f58e35f0ea1ffbf80a75a38c32175fa', | ||
'taker_fee': '0'}}]}, | ||
'bids': {'records': []}} | ||
""" # noqa: E501 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
""" # noqa: E501 | |
""" # noqa: E501 (line too long) |
python-packages/demos/src/index.rst
Outdated
To interact with a 0x-relayer, you need the HTTP endpoint of the relayer you'd like to | ||
connect to (i.e. https://api.radarrelay.com/0x/v2). | ||
|
||
For local testing one use the `0x-launch-kit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For local testing one use the `0x-launch-kit | |
For local testing one can use the `0x-launch-kit |
python-packages/demos/src/index.rst
Outdated
@@ -0,0 +1,68 @@ | |||
.. source for the sphinx-generated build/docs/web/index.html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this content belongs in the sra_client
module docstring, and the sphinx generation should happen there too.
e2dab1a
to
374ef75
Compare
…t is executed first in doctests, and skip doctests for get_order() demo (due to bug in sra_client)
validate order demo to json_schemas
a24b68d
to
d854e31
Compare
Description
New demos to demonstrate usage of python packages.
Testing instructions
./setup.py/launch_kit
./setup.py/test
Types of changes
New feature (non-breaking change which adds functionality)
Checklist:
[WIP]
if necessary.