Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

0x-sra-client.py: Fix bug in config_order, and other small improvements #2399

Merged
merged 11 commits into from
Dec 20, 2019

Conversation

feuGeneA
Copy link
Contributor

Description

Fixes #2385

See generated docs at https://104044-92181371-gh.circle-artifacts.com/0/root/repo/python-packages/sra_client/build/docs/html/index.html

Type of changes:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)

Root problem is that there are too many backslashes in the SRA spec
itself.  See #1727

This was previously fixed for heavily-tested endpoints (get and post
order, etc), but was only recently discovered for the get-order-config
endpoint.
@feuGeneA feuGeneA self-assigned this Dec 17, 2019
@feuGeneA feuGeneA force-pushed the python/sra-client-config-order-fix branch from ee8fc3f to a4bd546 Compare December 17, 2019 20:15
@feuGeneA feuGeneA changed the title 0x-sra-client.py: Fix bug in config_or, and other small improvements 0x-sra-client.py: Fix bug in config_order, and other small improvements Dec 17, 2019
@buildsize
Copy link

buildsize bot commented Dec 17, 2019

File name Previous Size New Size Change
init.py 60.25 KB 60.25 KB 0 bytes (0%)
abi_gen_dummy.ts 77.76 KB [deleted]
lib_dummy.ts 7.13 KB [deleted]
test_lib_dummy.ts 10.38 KB [deleted]
environment.pickle 1.61 MB 1.72 MB 113.21 KB (7%)
index.doctree 187.6 KB 437.26 KB 249.67 KB (133%)
.buildinfo 230 bytes 230 bytes 0 bytes (0%)
genindex.html 5.6 KB 31.42 KB 25.81 KB (461%)
index.html 2.52 KB 4.69 KB 2.17 KB (86%)
objects.inv 375 bytes 1 KB 649 bytes (173%)
py-modindex.html 3.07 KB 3.07 KB 0 bytes (0%)
search.html 2.84 KB 2.84 KB 0 bytes (0%)
searchindex.js 6.31 KB 11.97 KB 5.67 KB (90%)
index.rst.txt 415 bytes 2.22 KB 1.82 KB (448%)
alabaster.css 10.92 KB 10.92 KB 0 bytes (0%)
basic.css 11.97 KB 11.97 KB 0 bytes (0%)
custom.css 42 bytes 42 bytes 0 bytes (0%)
doctools.js 9.05 KB 9.05 KB 0 bytes (0%)
documentation_options.js 324 bytes 324 bytes 0 bytes (0%)
file.png 286 bytes 286 bytes 0 bytes (0%)
jquery-[version].js 273.79 KB 273.79 KB 0 bytes (0%)
jquery.js 86.08 KB 86.08 KB 0 bytes (0%)
language_data.js 10.59 KB 10.59 KB 0 bytes (0%)
minus.png 90 bytes 90 bytes 0 bytes (0%)
plus.png 90 bytes 90 bytes 0 bytes (0%)
pygments.css 4.69 KB 4.69 KB 0 bytes (0%)
searchtools.js 15.65 KB 15.65 KB 0 bytes (0%)
underscore-[version].js 34.34 KB 34.34 KB 0 bytes (0%)
underscore.js 11.86 KB 11.86 KB 0 bytes (0%)
contract_addresses.html 16.8 KB 16.8 KB 0 bytes (0%)
contract_artifacts.html 8.24 KB 8.24 KB 0 bytes (0%)
json_schemas.html 12.56 KB 12.56 KB 0 bytes (0%)
order_utils.html 47.16 KB 47.16 KB 0 bytes (0%)
erc20_token.html 93.56 KB 93.56 KB 0 bytes (0%)
exchange.html 718.38 KB 718.38 KB 0 bytes (0%)
tx_params.html 9.41 KB 9.41 KB 0 bytes (0%)
local_message_signer.html 15.08 KB 15.08 KB 0 bytes (0%)
asset_data_utils.html 22.66 KB 22.66 KB 0 bytes (0%)
default_api.html 113.17 KB [deleted]
asset_proxy_owner.html 337.39 KB 337.39 KB 0 bytes (0%)
coordinator.html 128.72 KB 128.72 KB 0 bytes (0%)
coordinator_registry.html 39.59 KB 39.59 KB 0 bytes (0%)
dutch_auction.html 66.13 KB 66.13 KB 0 bytes (0%)
erc20_proxy.html 109.07 KB 109.07 KB 0 bytes (0%)
erc721_proxy.html 109.19 KB 109.19 KB 0 bytes (0%)
erc721_token.html 150.2 KB 150.2 KB 0 bytes (0%)
forwarder.html 124.01 KB 124.01 KB 0 bytes (0%)
i_asset_proxy.html 40.18 KB 40.18 KB 0 bytes (0%)
i_validator.html 27.06 KB 27.06 KB 0 bytes (0%)
i_wallet.html 24.9 KB 24.9 KB 0 bytes (0%)
multi_asset_proxy.html 144.04 KB 144.04 KB 0 bytes (0%)
order_validator.html 107.69 KB 107.69 KB 0 bytes (0%)
weth9.html 132.09 KB 132.09 KB 0 bytes (0%)
zrx_token.html 107.61 KB 107.61 KB 0 bytes (0%)
dev_utils.html 557.97 KB 557.97 KB 0 bytes (0%)
types.html 8.54 KB 8.54 KB 0 bytes (0%)
erc1155_mintable.html 276.51 KB 276.51 KB 0 bytes (0%)
erc1155_proxy.html 130.38 KB 130.38 KB 0 bytes (0%)
static_call_proxy.html 34.04 KB 34.04 KB 0 bytes (0%)
relayer_api.html [new file] 113.37 KB
relayer_api_asset_data_pairs_response_schema.html [new file] 13.86 KB
relayer_api_asset_data_trade_info_schema.html [new file] 23.09 KB
relayer_api_error_response_schema.html [new file] 19.74 KB
relayer_api_error_response_schema_validation_errors.html [new file] 19.92 KB
relayer_api_fee_recipients_response_schema.html [new file] 13.83 KB
relayer_api_order_config_payload_schema.html [new file] 39.52 KB
relayer_api_order_config_response_schema.html [new file] 25.23 KB
relayer_api_order_schema.html [new file] 15.88 KB
relayer_api_orderbook_response_schema.html [new file] 16.2 KB
relayer_api_orders_channel_subscribe_payload_schema.html [new file] 35.06 KB
relayer_api_orders_channel_subscribe_schema.html [new file] 22.98 KB
relayer_api_orders_channel_update_schema.html [new file] 22.83 KB
relayer_api_orders_response_schema.html [new file] 13.75 KB
signed_order_schema.html [new file] 14.36 KB

@coveralls
Copy link

coveralls commented Dec 17, 2019

Coverage Status

Coverage remained the same at 77.804% when pulling 10f17d8 on python/sra-client-config-order-fix into 4c21a69 on development.

.gitignore Show resolved Hide resolved
python-packages/contract_wrappers/setup.py Outdated Show resolved Hide resolved
print("Removing src/zero_ex/contract_wrappers/*/__init__.py...")
for contract in glob(
path.join(
".", "src", "zero_ex", "contract_wrappers", "*", "__init__.py"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small nit here - this path is relative to the directory the current process is in, and not relative to the directory the current file is in. I think you want the latter?

Example

If I ran..

cd /tmp/
python path/to/monorepo/python-packages/contract_wrappers/setup.py

LOC 114 would result in /tmp/src/zero_ex/contract_wrappers/*/__init__.py while I think you wanted it to be /tmp/path/to/monorepo/python-packages/contract_wrappers/src/zero_ex/contract_wrappers/*/__init__.py

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're absolutely right on this... but I don't think it's worth accommodating at this point. The script already generally lacks support for this type of interaction.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yup yup I agree

@PirosB3
Copy link
Contributor

PirosB3 commented Dec 20, 2019

@feuGeneA the more I try out this code, the more I feel that sra_client library won't work anywhere. Given that we are deprecating LaunchKit Backend (which requires a /v3/ prefix), and given that api.0x.org does not require a /v3/ prefix in the path, sra_client won't work anywhere because it hard-codes a /v3/ prefix in the path.

Is there any way that the current sra_client implementation works with 0x API?

@PirosB3
Copy link
Contributor

PirosB3 commented Dec 20, 2019

Aside from this, you code works great. I tested it using:

>>> relayer = RelayerApi('https://v3.kovan.backend.sra.0x.org')
>>> order_config = relayer.get_order_config(relayer_api_order_config_payload_schema=my_order)
>>> print(order_config)
{'fee_recipient_address': '0x0000000000000000000000000000000000000000',
 'maker_fee': '0',
 'sender_address': '0x0000000000000000000000000000000000000000',
 'taker_fee': '0'}

@feuGeneA feuGeneA merged commit 551a65c into development Dec 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

sra_client.py: broken order_config interface, and other minor issues
3 participants