From f217f6d90664b3df05954b1dda65e086c57ab77c Mon Sep 17 00:00:00 2001 From: Zephyr Lykos Date: Sun, 7 Jan 2024 22:56:15 +0800 Subject: [PATCH] misc: fix tests --- .github/workflows/build-ci.yml | 2 +- pyproject.toml | 2 +- qiling/arch/evm/abi.py | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-ci.yml b/.github/workflows/build-ci.yml index af82b6b21..873f6ba15 100644 --- a/.github/workflows/build-ci.yml +++ b/.github/workflows/build-ci.yml @@ -11,7 +11,7 @@ jobs: matrix: #os: [windows-2019, macos-10.15, ubuntu-18.04, ubuntu-20.04] os: [windows-latest, ubuntu-20.04] - python-version: ["3.8", "3.9", "^3"] + python-version: ["3.8", "3.9", "3.11"] include: - os: ubuntu-22.04 python-version: 3.9 diff --git a/pyproject.toml b/pyproject.toml index ea55b6411..40368d492 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -44,7 +44,7 @@ r2libr = { version = "^5.7.4", optional = true } [tool.poetry.extras] evm = ["blake2b-py", "eth-keys", "eth-typing", "eth-utils", "eth_abi", "lru-dict", "py-ecc", "rlp", "trie", "numpy", "rich", "cmd2", "eth-hash"] fuzz = ["unicornafl", "fuzzercorn"] -re = ["r2libr"] +RE = ["r2libr"] [build-system] requires = ["poetry-core"] diff --git a/qiling/arch/evm/abi.py b/qiling/arch/evm/abi.py index 33620217e..a0710b805 100644 --- a/qiling/arch/evm/abi.py +++ b/qiling/arch/evm/abi.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -from eth_abi import encode_abi, decode_abi, encode_single, decode_single +from eth_abi import encode, decode, encode_single, decode_single from eth_utils.abi import collapse_if_tuple from eth_utils import function_signature_to_4byte_selector, function_abi_to_4byte_selector, decode_hex, encode_hex from .vm.utils import bytecode_to_bytes @@ -20,7 +20,7 @@ def encode_params(datatypes:list, values:list) -> str: elif isinstance(values[idx], str): values[idx] = bytecode_to_bytes(values[idx]) - return encode_abi(datatypes, values).hex() + return encode(datatypes, values).hex() @staticmethod def decode_params(datatypes:list, value:str) -> list: @@ -43,4 +43,4 @@ def encode_function_call_abi(abi:dict, params:list) -> str: [collapse_if_tuple(abi_input) for abi_input in abi.get("inputs", [])] ) params = encode_single(f"({inputs})", params) - return encode_hex(signature + params) \ No newline at end of file + return encode_hex(signature + params)