From 95b2898b9c0898c7e2d98ee603bff0604bf2a829 Mon Sep 17 00:00:00 2001 From: "F. Eugene Aumson" Date: Wed, 7 Nov 2018 11:20:46 -0500 Subject: [order_utils.py] is_signature_valid, via Exchange contract (#1216) First support for signature validation, done via Exchange contract's isValidSignature() method. --- .../order_utils/stubs/setuptools/__init__.pyi | 4 +++- python-packages/order_utils/stubs/web3/__init__.pyi | 18 +++++++++++++++++- python-packages/order_utils/stubs/web3/exceptions.pyi | 2 ++ .../order_utils/stubs/web3/utils/__init__.pyi | 0 .../order_utils/stubs/web3/utils/datatypes.pyi | 3 +++ 5 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 python-packages/order_utils/stubs/web3/exceptions.pyi create mode 100644 python-packages/order_utils/stubs/web3/utils/__init__.pyi create mode 100644 python-packages/order_utils/stubs/web3/utils/datatypes.pyi (limited to 'python-packages/order_utils/stubs') diff --git a/python-packages/order_utils/stubs/setuptools/__init__.pyi b/python-packages/order_utils/stubs/setuptools/__init__.pyi index baa349d70..8ea8d32b7 100644 --- a/python-packages/order_utils/stubs/setuptools/__init__.pyi +++ b/python-packages/order_utils/stubs/setuptools/__init__.pyi @@ -1,6 +1,8 @@ from distutils.dist import Distribution -from typing import Any +from typing import Any, List def setup(**attrs: Any) -> Distribution: ... class Command: ... + +def find_packages(where: str) -> List[str]: ... diff --git a/python-packages/order_utils/stubs/web3/__init__.pyi b/python-packages/order_utils/stubs/web3/__init__.pyi index c6f357009..fcecc7434 100644 --- a/python-packages/order_utils/stubs/web3/__init__.pyi +++ b/python-packages/order_utils/stubs/web3/__init__.pyi @@ -1,10 +1,26 @@ -from typing import Optional, Union +from typing import Dict, Optional, Union + +from web3.utils import datatypes + class Web3: + class HTTPProvider: ... + + def __init__(self, provider: HTTPProvider) -> None: ... + @staticmethod def sha3( primitive: Optional[Union[bytes, int, None]] = None, text: Optional[str] = None, hexstr: Optional[str] = None ) -> bytes: ... + + class net: + version: str + ... + + class eth: + @staticmethod + def contract(address: str, abi: Dict) -> datatypes.Contract: ... + ... ... diff --git a/python-packages/order_utils/stubs/web3/exceptions.pyi b/python-packages/order_utils/stubs/web3/exceptions.pyi new file mode 100644 index 000000000..83abf973d --- /dev/null +++ b/python-packages/order_utils/stubs/web3/exceptions.pyi @@ -0,0 +1,2 @@ +class BadFunctionCallOutput(Exception): + ... diff --git a/python-packages/order_utils/stubs/web3/utils/__init__.pyi b/python-packages/order_utils/stubs/web3/utils/__init__.pyi new file mode 100644 index 000000000..e69de29bb diff --git a/python-packages/order_utils/stubs/web3/utils/datatypes.pyi b/python-packages/order_utils/stubs/web3/utils/datatypes.pyi new file mode 100644 index 000000000..70baff372 --- /dev/null +++ b/python-packages/order_utils/stubs/web3/utils/datatypes.pyi @@ -0,0 +1,3 @@ +class Contract: + def call(self): ... + ... -- cgit v1.2.3