Change all instances of networkId to chainId (#2313)

* abi-gen/test: recompile contract fixtures for 3.0

It seems this hadn't been done since the merge with the 3.0 branch.

* Sync `monorepo$ yarn test` exclusions to CI config

* sra-spec: correct typo

* contract-wrappers: TODO after coord.-server update

* utils: fix typo in comment

* Refactor networkId to chainId everywhere

* Update CHANGELOGs
This commit is contained in:
F. Eugene Aumson
2019-11-06 01:18:55 -05:00
committed by GitHub
parent e61f23d001
commit f51c80adb2
100 changed files with 5341 additions and 5213 deletions

View File

@@ -69,10 +69,10 @@ To start, connect to the Ethereum network:
>>> from web3 import HTTPProvider, Web3
>>> eth_node = HTTPProvider("http://localhost:8545")
What network is it?
What chain are we on?
>>> from zero_ex.contract_addresses import NetworkId
>>> network_id = NetworkId.GANACHE # you might use .MAINNET or .KOVAN
>>> from zero_ex.contract_addresses import ChainId
>>> chain_id = ChainId.GANACHE # you might use .MAINNET or .KOVAN
For our Maker role, we'll just use the first address available in the node:
@@ -83,8 +83,8 @@ for this account, so the example orders below have the maker trading away ZRX.
Before such an order can be valid, though, the maker must give the 0x contracts
permission to trade their ZRX tokens:
>>> from zero_ex.contract_addresses import network_to_addresses
>>> contract_addresses = network_to_addresses(network_id)
>>> from zero_ex.contract_addresses import chain_to_addresses
>>> contract_addresses = chain_to_addresses(chain_id)
>>>
>>> from zero_ex.contract_artifacts import abi_by_name
>>> zrx_token_contract = Web3(eth_node).eth.contract(
@@ -141,7 +141,7 @@ Post an order for our Maker to trade ZRX for WETH:
... order, contract_addresses.exchange, Web3(eth_node).eth.chainId
... )
>>> relayer.post_order_with_http_info(
... network_id=network_id.value,
... chain_id=chain_id.value,
... signed_order_schema=order_to_jsdict(
... order=order,
... exchange_address=contract_addresses.exchange,
@@ -346,7 +346,7 @@ book. Now let's have the taker fill it:
>>> from zero_ex.order_utils import Order
>>> exchange = Exchange(
... web3_or_provider=eth_node,
... contract_address=network_to_addresses(NetworkId.GANACHE).exchange
... contract_address=chain_to_addresses(ChainId.GANACHE).exchange
... )
(Due to `an Issue with the Launch Kit Backend

View File

@@ -42,7 +42,7 @@ class DefaultApi(object):
:param bool async_req: Whether request should be asynchronous.
:param str asset_data_a: The assetData value for the first asset in the pair.
:param str asset_data_b: The assetData value for the second asset in the pair.
:param int network_id: The id of the Ethereum network
:param int chain_id: The id of the Ethereum chain
:param int page: The number of the page to request in the collection.
:param int per_page: The number of records to return per page.
@@ -71,7 +71,7 @@ class DefaultApi(object):
:param bool async_req: Whether request should be asynchronous.
:param str asset_data_a: The assetData value for the first asset in the pair.
:param str asset_data_b: The assetData value for the second asset in the pair.
:param int network_id: The id of the Ethereum network
:param int chain_id: The id of the Ethereum chain
:param int page: The number of the page to request in the collection.
:param int per_page: The number of records to return per page.
@@ -86,7 +86,7 @@ class DefaultApi(object):
all_params = [
"asset_data_a",
"asset_data_b",
"network_id",
"chain_id",
"page",
"per_page",
]
@@ -117,8 +117,8 @@ class DefaultApi(object):
query_params.append(
("assetDataB", local_var_params["asset_data_b"])
)
if "network_id" in local_var_params:
query_params.append(("networkId", local_var_params["network_id"]))
if "chain_id" in local_var_params:
query_params.append(("chainId", local_var_params["chain_id"]))
if "page" in local_var_params:
query_params.append(("page", local_var_params["page"]))
if "per_page" in local_var_params:
@@ -170,7 +170,7 @@ class DefaultApi(object):
>>> result = thread.get() # doctest: +SKIP
:param bool async_req: Whether request should be asynchronous.
:param int network_id: The id of the Ethereum network
:param int chain_id: The id of the Ethereum chain
:param int page: The number of the page to request in the collection.
:param int per_page: The number of records to return per page.
@@ -196,7 +196,7 @@ class DefaultApi(object):
>>> result = thread.get() # doctest: +SKIP
:param bool async_req: Whether request should be asynchronous.
:param int network_id: The id of the Ethereum network
:param int chain_id: The id of the Ethereum chain
:param int page: The number of the page to request in the collection.
:param int per_page: The number of records to return per page.
@@ -208,7 +208,7 @@ class DefaultApi(object):
local_var_params = locals()
all_params = ["network_id", "page", "per_page"]
all_params = ["chain_id", "page", "per_page"]
all_params.append("async_req")
all_params.append("_return_http_data_only")
all_params.append("_preload_content")
@@ -228,8 +228,8 @@ class DefaultApi(object):
path_params = {}
query_params = []
if "network_id" in local_var_params:
query_params.append(("networkId", local_var_params["network_id"]))
if "chain_id" in local_var_params:
query_params.append(("chainId", local_var_params["chain_id"]))
if "page" in local_var_params:
query_params.append(("page", local_var_params["page"]))
if "per_page" in local_var_params:
@@ -281,7 +281,7 @@ class DefaultApi(object):
:param bool async_req: Whether request should be asynchronous.
:param str order_hash: The hash of the desired 0x order. (required)
:param int network_id: The id of the Ethereum network
:param int chain_id: The id of the Ethereum chain
:return: :class:`RelayerApiOrderSchema`.
If the method is called asynchronously, returns the request thread.
@@ -305,7 +305,7 @@ class DefaultApi(object):
:param bool async_req: Whether request should be asynchronous.
:param str order_hash: The hash of the desired 0x order. (required)
:param int network_id: The id of the Ethereum network
:param int chain_id: The id of the Ethereum chain
:return: A tuple consisting of a
:class:`RelayerApiOrderSchema`, an HTTP status code integer, and a
@@ -315,7 +315,7 @@ class DefaultApi(object):
local_var_params = locals()
all_params = ["order_hash", "network_id"]
all_params = ["order_hash", "chain_id"]
all_params.append("async_req")
all_params.append("_return_http_data_only")
all_params.append("_preload_content")
@@ -345,8 +345,8 @@ class DefaultApi(object):
path_params["orderHash"] = local_var_params["order_hash"]
query_params = []
if "network_id" in local_var_params:
query_params.append(("networkId", local_var_params["network_id"]))
if "chain_id" in local_var_params:
query_params.append(("chainId", local_var_params["chain_id"]))
header_params = {}
@@ -401,7 +401,7 @@ class DefaultApi(object):
>>> result = thread.get() # doctest: +SKIP
:param bool async_req: Whether request should be asynchronous.
:param int network_id: The id of the Ethereum network
:param int chain_id: The id of the Ethereum chain
:param relayer_api_order_config_payload_schema: instance of
:class:`RelayerApiOrderConfigPayloadSchema`. The fields of a 0x
order the relayer may want to decide what configuration to send
@@ -436,7 +436,7 @@ class DefaultApi(object):
>>> result = thread.get() # doctest: +SKIP
:param bool async_req: Whether request should be asynchronous.
:param int network_id: The id of the Ethereum network
:param int chain_id: The id of the Ethereum chain
:param relayer_api_order_config_payload_schema: instance of
:class: `RelayerApiOrderConfigPayloadSchema`. The fields of a 0x
order the relayer may want to decide what configuration to send
@@ -450,7 +450,7 @@ class DefaultApi(object):
local_var_params = locals()
all_params = ["network_id", "relayer_api_order_config_payload_schema"]
all_params = ["chain_id", "relayer_api_order_config_payload_schema"]
all_params.append("async_req")
all_params.append("_return_http_data_only")
all_params.append("_preload_content")
@@ -470,8 +470,8 @@ class DefaultApi(object):
path_params = {}
query_params = []
if "network_id" in local_var_params:
query_params.append(("networkId", local_var_params["network_id"]))
if "chain_id" in local_var_params:
query_params.append(("chainId", local_var_params["chain_id"]))
header_params = {}
@@ -545,7 +545,7 @@ class DefaultApi(object):
:param str quote_asset_data: assetData (makerAssetData or
takerAssetData) designated as the quote currency in the currency
pair calculation of price. (required)
:param int network_id: The id of the Ethereum network
:param int chain_id: The id of the Ethereum chain
:param int page: The number of the page to request in the collection.
:param int per_page: The number of records to return per page.
@@ -594,7 +594,7 @@ class DefaultApi(object):
:param str quote_asset_data: assetData (makerAssetData or
takerAssetData) designated as the quote currency in the currency
pair calculation of price. (required)
:param int network_id: The id of the Ethereum network
:param int chain_id: The id of the Ethereum chain
:param int page: The number of the page to request in the collection.
:param int per_page: The number of records to return per page.
@@ -609,7 +609,7 @@ class DefaultApi(object):
all_params = [
"base_asset_data",
"quote_asset_data",
"network_id",
"chain_id",
"page",
"per_page",
]
@@ -658,8 +658,8 @@ class DefaultApi(object):
query_params.append(
("quoteAssetData", local_var_params["quote_asset_data"])
)
if "network_id" in local_var_params:
query_params.append(("networkId", local_var_params["network_id"]))
if "chain_id" in local_var_params:
query_params.append(("chainId", local_var_params["chain_id"]))
if "page" in local_var_params:
query_params.append(("page", local_var_params["page"]))
if "per_page" in local_var_params:
@@ -760,7 +760,7 @@ class DefaultApi(object):
`0x Protocol v3 Specification
<https://github.com/0xProject/0x-protocol-specification/blob/
master/v3/v3-specification.md#order-message-format>`__
:param int network_id: The id of the Ethereum network
:param int chain_id: The id of the Ethereum chain
:param int page: The number of the page to request in the collection.
:param int per_page: The number of records to return per page.
@@ -837,7 +837,7 @@ class DefaultApi(object):
`0x Protocol v3 Specification
<https://github.com/0xProject/0x-protocol-specification/blob/
master/v3/v3-specification.md#order-message-format>`__
:param int network_id: The id of the Ethereum network
:param int chain_id: The id of the Ethereum chain
:param int page: The number of the page to request in the collection.
:param int per_page: The number of records to return per page.
@@ -863,7 +863,7 @@ class DefaultApi(object):
"taker_address",
"trader_address",
"fee_recipient_address",
"network_id",
"chain_id",
"page",
"per_page",
]
@@ -941,8 +941,8 @@ class DefaultApi(object):
local_var_params["fee_recipient_address"],
)
)
if "network_id" in local_var_params:
query_params.append(("networkId", local_var_params["network_id"]))
if "chain_id" in local_var_params:
query_params.append(("chainId", local_var_params["chain_id"]))
if "page" in local_var_params:
query_params.append(("page", local_var_params["page"]))
if "per_page" in local_var_params:
@@ -993,7 +993,7 @@ class DefaultApi(object):
>>> result = thread.get() # doctest: +SKIP
:param bool async_req: Whether request should be asynchronous.
:param int network_id: The id of the Ethereum network
:param int chain_id: The id of the Ethereum chain
:param signed_order_schema: Instance of :class:`SignedOrderSchema`.
A valid signed 0x order based on the schema.
@@ -1018,7 +1018,7 @@ class DefaultApi(object):
>>> result = thread.get() # doctest: +SKIP
:param bool async_req: Whether request should be asynchronous.
:param int network_id: The id of the Ethereum network
:param int chain_id: The id of the Ethereum chain
:param signed_order_schema: Instance of :class:`SignedOrderSchema`
A valid signed 0x order based on the schema.
@@ -1030,7 +1030,7 @@ class DefaultApi(object):
local_var_params = locals()
all_params = ["network_id", "signed_order_schema"]
all_params = ["chain_id", "signed_order_schema"]
all_params.append("async_req")
all_params.append("_return_http_data_only")
all_params.append("_preload_content")
@@ -1050,8 +1050,8 @@ class DefaultApi(object):
path_params = {}
query_params = []
if "network_id" in local_var_params:
query_params.append(("networkId", local_var_params["network_id"]))
if "chain_id" in local_var_params:
query_params.append(("chainId", local_var_params["chain_id"]))
header_params = {}

View File

@@ -24,7 +24,7 @@ class RelayerApiOrdersChannelSubscribePayloadSchema(object):
openapi_types = {
"maker_asset_proxy_id": "str",
"taker_asset_proxy_id": "str",
"network_id": "float",
"chain_id": "float",
"maker_asset_address": "str",
"taker_asset_address": "str",
"maker_asset_data": "str",
@@ -35,7 +35,7 @@ class RelayerApiOrdersChannelSubscribePayloadSchema(object):
attribute_map = {
"maker_asset_proxy_id": "makerAssetProxyId",
"taker_asset_proxy_id": "takerAssetProxyId",
"network_id": "networkId",
"chain_id": "chainId",
"maker_asset_address": "makerAssetAddress",
"taker_asset_address": "takerAssetAddress",
"maker_asset_data": "makerAssetData",
@@ -47,7 +47,7 @@ class RelayerApiOrdersChannelSubscribePayloadSchema(object):
self,
maker_asset_proxy_id=None,
taker_asset_proxy_id=None,
network_id=None,
chain_id=None,
maker_asset_address=None,
taker_asset_address=None,
maker_asset_data=None,
@@ -58,7 +58,7 @@ class RelayerApiOrdersChannelSubscribePayloadSchema(object):
self._maker_asset_proxy_id = None
self._taker_asset_proxy_id = None
self._network_id = None
self._chain_id = None
self._maker_asset_address = None
self._taker_asset_address = None
self._maker_asset_data = None
@@ -70,8 +70,8 @@ class RelayerApiOrdersChannelSubscribePayloadSchema(object):
self.maker_asset_proxy_id = maker_asset_proxy_id
if taker_asset_proxy_id is not None:
self.taker_asset_proxy_id = taker_asset_proxy_id
if network_id is not None:
self.network_id = network_id
if chain_id is not None:
self.chain_id = chain_id
if maker_asset_address is not None:
self.maker_asset_address = maker_asset_address
if taker_asset_address is not None:
@@ -138,25 +138,25 @@ class RelayerApiOrdersChannelSubscribePayloadSchema(object):
self._taker_asset_proxy_id = taker_asset_proxy_id
@property
def network_id(self):
"""Gets the network_id of this RelayerApiOrdersChannelSubscribePayloadSchema. # noqa: E501
def chain_id(self):
"""Gets the chain_id of this RelayerApiOrdersChannelSubscribePayloadSchema. # noqa: E501
:return: The network_id of this RelayerApiOrdersChannelSubscribePayloadSchema. # noqa: E501
:return: The chain_id of this RelayerApiOrdersChannelSubscribePayloadSchema. # noqa: E501
:rtype: float
"""
return self._network_id
return self._chain_id
@network_id.setter
def network_id(self, network_id):
"""Sets the network_id of this RelayerApiOrdersChannelSubscribePayloadSchema.
@chain_id.setter
def chain_id(self, chain_id):
"""Sets the chain_id of this RelayerApiOrdersChannelSubscribePayloadSchema.
:param network_id: The network_id of this RelayerApiOrdersChannelSubscribePayloadSchema. # noqa: E501
:param chain_id: The chain_id of this RelayerApiOrdersChannelSubscribePayloadSchema. # noqa: E501
:type: float
"""
self._network_id = network_id
self._chain_id = chain_id
@property
def maker_asset_address(self):