diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index ca6ace7..69680ed 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -17,8 +17,6 @@ jobs: run: pip install -U pip - name: Install dev dependencies run: pip install -e .[dev] - - name: Mypy type check - run: mypy moonworm/ - name: Isort imports check run: isort --check moonworm/ - name: Black syntax check diff --git a/moonworm/generators/basic.py b/moonworm/generators/basic.py index 1cfec03..130b7b3 100644 --- a/moonworm/generators/basic.py +++ b/moonworm/generators/basic.py @@ -95,11 +95,11 @@ def normalize_abi_name(name: str) -> str: def python_type(evm_type: str) -> List[str]: - if evm_type.endswith("]"): + if evm_type.endswith("]") and not evm_type.endswith("][]"): return ["List"] - if evm_type.startswith(("uint", "int")): + if evm_type.startswith(("uint", "int")) and "[" not in evm_type: return ["int"] - if evm_type.startswith(("int", "int")): + if evm_type.startswith(("int", "int")) and "[" not in evm_type: return ["int"] elif evm_type.startswith("bytes"): return ["bytes"] diff --git a/moonworm/generators/brownie.py b/moonworm/generators/brownie.py index b05be9e..0035978 100644 --- a/moonworm/generators/brownie.py +++ b/moonworm/generators/brownie.py @@ -831,6 +831,15 @@ def generate_cli_generator( value=cst.parse_expression("eval"), ), ) + elif param["type"] == "Any": + # In general case, we just use a Python `eval` to parse the input from the command line. + # This is similar to the way we handle `tuple` arguments. + call_args.append( + cst.Arg( + keyword=cst.Name(value="type"), + value=cst.parse_expression("eval"), + ), + ) add_argument_call = cst.Call( func=cst.Attribute( diff --git a/moonworm/version.py b/moonworm/version.py index af16777..2709226 100644 --- a/moonworm/version.py +++ b/moonworm/version.py @@ -1 +1 @@ -MOONWORM_VERSION = "0.6.2" +MOONWORM_VERSION = "0.7.0" diff --git a/setup.py b/setup.py index 8f35043..87f9793 100644 --- a/setup.py +++ b/setup.py @@ -15,7 +15,7 @@ "black", "inflection", "libcst", - "pysha3<2.0.0,>=1.0.0", + "pysha3<2.0.0,>=1.0.0; python_version < '3.6'", "tqdm", "typing-extensions", "web3>=5.27.0",