diff options
author | F. Eugene Aumson <feuGeneA@users.noreply.github.com> | 2019-01-09 22:58:29 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-09 22:58:29 +0800 |
commit | aa5af04447dfae24731557c6beead55bd8ff99a9 (patch) | |
tree | 1ffcc631ab078c88f85e2ab2b708f5d91b731cea /python-packages/contract_demo/stubs | |
parent | 5b7eff217e9c8d09d64ff8721d7a16e1df8a7c58 (diff) | |
download | dexon-sol-tools-aa5af04447dfae24731557c6beead55bd8ff99a9.tar dexon-sol-tools-aa5af04447dfae24731557c6beead55bd8ff99a9.tar.gz dexon-sol-tools-aa5af04447dfae24731557c6beead55bd8ff99a9.tar.bz2 dexon-sol-tools-aa5af04447dfae24731557c6beead55bd8ff99a9.tar.lz dexon-sol-tools-aa5af04447dfae24731557c6beead55bd8ff99a9.tar.xz dexon-sol-tools-aa5af04447dfae24731557c6beead55bd8ff99a9.tar.zst dexon-sol-tools-aa5af04447dfae24731557c6beead55bd8ff99a9.zip |
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
Diffstat (limited to 'python-packages/contract_demo/stubs')
14 files changed, 34 insertions, 0 deletions
diff --git a/python-packages/contract_demo/stubs/__init__.pyi b/python-packages/contract_demo/stubs/__init__.pyi new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/python-packages/contract_demo/stubs/__init__.pyi diff --git a/python-packages/contract_demo/stubs/command/__init__.pyi b/python-packages/contract_demo/stubs/command/__init__.pyi new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/python-packages/contract_demo/stubs/command/__init__.pyi diff --git a/python-packages/contract_demo/stubs/command/clean.pyi b/python-packages/contract_demo/stubs/command/clean.pyi new file mode 100644 index 000000000..46a42ddb1 --- /dev/null +++ b/python-packages/contract_demo/stubs/command/clean.pyi @@ -0,0 +1,7 @@ +from distutils.core import Command + +class clean(Command): + def initialize_options(self: clean) -> None: ... + def finalize_options(self: clean) -> None: ... + def run(self: clean) -> None: ... + ... diff --git a/python-packages/contract_demo/stubs/distutils/__init__.pyi b/python-packages/contract_demo/stubs/distutils/__init__.pyi new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/python-packages/contract_demo/stubs/distutils/__init__.pyi diff --git a/python-packages/contract_demo/stubs/distutils/command/__init__.pyi b/python-packages/contract_demo/stubs/distutils/command/__init__.pyi new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/python-packages/contract_demo/stubs/distutils/command/__init__.pyi diff --git a/python-packages/contract_demo/stubs/distutils/command/clean.pyi b/python-packages/contract_demo/stubs/distutils/command/clean.pyi new file mode 100644 index 000000000..46a42ddb1 --- /dev/null +++ b/python-packages/contract_demo/stubs/distutils/command/clean.pyi @@ -0,0 +1,7 @@ +from distutils.core import Command + +class clean(Command): + def initialize_options(self: clean) -> None: ... + def finalize_options(self: clean) -> None: ... + def run(self: clean) -> None: ... + ... diff --git a/python-packages/contract_demo/stubs/eth_utils/__init__.pyi b/python-packages/contract_demo/stubs/eth_utils/__init__.pyi new file mode 100644 index 000000000..4a83338ca --- /dev/null +++ b/python-packages/contract_demo/stubs/eth_utils/__init__.pyi @@ -0,0 +1,4 @@ +from typing import Union + +def to_checksum_address(value: Union[str, bytes]) -> str: + ... diff --git a/python-packages/contract_demo/stubs/pytest/__init__.pyi b/python-packages/contract_demo/stubs/pytest/__init__.pyi new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/python-packages/contract_demo/stubs/pytest/__init__.pyi diff --git a/python-packages/contract_demo/stubs/setuptools/__init__.pyi b/python-packages/contract_demo/stubs/setuptools/__init__.pyi new file mode 100644 index 000000000..8ea8d32b7 --- /dev/null +++ b/python-packages/contract_demo/stubs/setuptools/__init__.pyi @@ -0,0 +1,8 @@ +from distutils.dist import Distribution +from typing import Any, List + +def setup(**attrs: Any) -> Distribution: ... + +class Command: ... + +def find_packages(where: str) -> List[str]: ... diff --git a/python-packages/contract_demo/stubs/setuptools/command/__init__.pyi b/python-packages/contract_demo/stubs/setuptools/command/__init__.pyi new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/python-packages/contract_demo/stubs/setuptools/command/__init__.pyi diff --git a/python-packages/contract_demo/stubs/setuptools/command/test.pyi b/python-packages/contract_demo/stubs/setuptools/command/test.pyi new file mode 100644 index 000000000..c5ec770ad --- /dev/null +++ b/python-packages/contract_demo/stubs/setuptools/command/test.pyi @@ -0,0 +1,3 @@ +from setuptools import Command + +class test(Command): ... diff --git a/python-packages/contract_demo/stubs/web3/__init__.pyi b/python-packages/contract_demo/stubs/web3/__init__.pyi new file mode 100644 index 000000000..21482d598 --- /dev/null +++ b/python-packages/contract_demo/stubs/web3/__init__.pyi @@ -0,0 +1,2 @@ +class Web3: + ... diff --git a/python-packages/contract_demo/stubs/web3/utils/__init__.pyi b/python-packages/contract_demo/stubs/web3/utils/__init__.pyi new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/python-packages/contract_demo/stubs/web3/utils/__init__.pyi diff --git a/python-packages/contract_demo/stubs/web3/utils/datatypes.pyi b/python-packages/contract_demo/stubs/web3/utils/datatypes.pyi new file mode 100644 index 000000000..70baff372 --- /dev/null +++ b/python-packages/contract_demo/stubs/web3/utils/datatypes.pyi @@ -0,0 +1,3 @@ +class Contract: + def call(self): ... + ... |