From 30ab87a0b54bb23479e2dea12c615d4b5956e487 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Aug 2022 20:21:39 +0000 Subject: [PATCH 01/14] Bump eth-account from 0.4.0 to 0.5.9 Bumps [eth-account](https://github.com/ethereum/eth-account) from 0.4.0 to 0.5.9. - [Release notes](https://github.com/ethereum/eth-account/releases) - [Changelog](https://github.com/ethereum/eth-account/blob/master/docs/release_notes.rst) - [Commits](https://github.com/ethereum/eth-account/compare/v0.4.0...v0.5.9) --- updated-dependencies: - dependency-name: eth-account dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c278cfa..33c0f23 100644 --- a/setup.py +++ b/setup.py @@ -80,7 +80,7 @@ "cytoolz>=0.9.0,<1.0.0;implementation_name=='cpython'", "eth-abi>=2.0.0b6,<3.0.0", - "eth-account==0.4.0", + "eth-account==0.5.9", "eth-utils>=1.3.0,<2.0.0", "eth-hash[pycryptodome]>=0.2.0,<1.0.0", From 0e3553020dd950cff883b3f35ec3850dde418011 Mon Sep 17 00:00:00 2001 From: anon Date: Sat, 28 Jan 2023 10:24:58 +0200 Subject: [PATCH 02/14] Fix #106 --- .gitignore | 1 + tronapi/common/encoding.py | 2 +- tronapi/main.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f4e6946..346fea2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea +.DS_Store # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/tronapi/common/encoding.py b/tronapi/common/encoding.py index e5512c7..d578253 100644 --- a/tronapi/common/encoding.py +++ b/tronapi/common/encoding.py @@ -2,7 +2,7 @@ import re from typing import Union -from eth_account.datastructures import AttributeDict +from tronapi.common.datastructures import AttributeDict from hexbytes import HexBytes from eth_utils import ( diff --git a/tronapi/main.py b/tronapi/main.py index a1bf985..f7f72be 100644 --- a/tronapi/main.py +++ b/tronapi/main.py @@ -15,7 +15,7 @@ :license: MIT License """ -from eth_account.datastructures import AttributeDict +from tronapi.common.datastructures import AttributeDict from urllib.parse import urlencode from eth_utils import ( apply_to_return_value, From acf2332f33e4fc56016fe424596425823d8ff3c2 Mon Sep 17 00:00:00 2001 From: anon Date: Mon, 17 Jul 2023 20:25:43 +0300 Subject: [PATCH 03/14] bad --- setup.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 33c0f23..51e6219 100644 --- a/setup.py +++ b/setup.py @@ -79,16 +79,16 @@ "toolz>=0.9.0,<1.0.0;implementation_name=='pypy'", "cytoolz>=0.9.0,<1.0.0;implementation_name=='cpython'", - "eth-abi>=2.0.0b6,<3.0.0", - "eth-account==0.5.9", - "eth-utils>=1.3.0,<2.0.0", - "eth-hash[pycryptodome]>=0.2.0,<1.0.0", + "eth-abi", + "eth-account", + "eth-utils", + "eth-hash[pycryptodome]", "trx-utils", "hexbytes>=0.1.0,<1.0.0", - "requests>=2.16.0,<3.0.0", + "requests", "base58", "ecdsa", 'attrdict', From b1989441f3d117f190cfae96690fd2a36b1176d4 Mon Sep 17 00:00:00 2001 From: anon Date: Mon, 17 Jul 2023 20:33:34 +0300 Subject: [PATCH 04/14] latest versions --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 51e6219..b2c9c6f 100644 --- a/setup.py +++ b/setup.py @@ -79,10 +79,10 @@ "toolz>=0.9.0,<1.0.0;implementation_name=='pypy'", "cytoolz>=0.9.0,<1.0.0;implementation_name=='cpython'", - "eth-abi", - "eth-account", - "eth-utils", - "eth-hash[pycryptodome]", + "eth-abi>=4", + "eth-account>=0.9", + "eth-utils>=2.2", + "eth-hash[pycryptodome]>=0.5", "trx-utils", From 38adf1d1f165b3262cd2ec33b7d7a6a211798536 Mon Sep 17 00:00:00 2001 From: anon Date: Mon, 17 Jul 2023 20:49:28 +0300 Subject: [PATCH 05/14] fork trx-utils --- setup.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index b2c9c6f..fac3d9c 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,7 @@ import os import platform + from setuptools import ( find_packages, setup, @@ -84,7 +85,7 @@ "eth-utils>=2.2", "eth-hash[pycryptodome]>=0.5", - "trx-utils", + "trx-utils @ git+https://github.com/const-tmp/trx-utils.git@update-eth-deps", "hexbytes>=0.1.0,<1.0.0", @@ -100,7 +101,6 @@ with open(readme_filename) as f: PACKAGE_LONG_DESCRIPTION = f.read() - setup( name='tronapi', version=PACKAGE_VERSION, From 8b617b93629932e4ba8bce2ba43136385928fe9f Mon Sep 17 00:00:00 2001 From: anon Date: Mon, 17 Jul 2023 21:02:39 +0300 Subject: [PATCH 06/14] fix import hashable --- tronapi/common/datastructures.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tronapi/common/datastructures.py b/tronapi/common/datastructures.py index 834d3b1..f23219b 100644 --- a/tronapi/common/datastructures.py +++ b/tronapi/common/datastructures.py @@ -1,10 +1,5 @@ -from collections import ( - Hashable, - Mapping, - MutableMapping, - OrderedDict, - Sequence, -) +from collections import Mapping, MutableMapping, OrderedDict, Sequence +from collections.abc import Hashable from trx_utils import ( is_integer, @@ -14,6 +9,7 @@ recursive_map, ) + # Hashable must be immutable: # "the implementation of hashable collections requires that a key's hash value is immutable" # https://docs.python.org/3/reference/datamodel.html#object.__hash__ @@ -101,6 +97,7 @@ class NamedElementOnion(Mapping): Add layers to an onion-shaped structure. Optionally, inject to a specific layer. This structure is iterable, where the outermost layer is first, and innermost is last. """ + def __init__(self, init_elements, valid_element=callable): self._queue = OrderedDict() for element in reversed(init_elements): From 7cf1cddb1889095405063ae46178d8e53837390c Mon Sep 17 00:00:00 2001 From: anon Date: Mon, 17 Jul 2023 21:04:21 +0300 Subject: [PATCH 07/14] fix import OrderedDict --- tronapi/common/datastructures.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tronapi/common/datastructures.py b/tronapi/common/datastructures.py index f23219b..d43494c 100644 --- a/tronapi/common/datastructures.py +++ b/tronapi/common/datastructures.py @@ -1,5 +1,5 @@ -from collections import Mapping, MutableMapping, OrderedDict, Sequence -from collections.abc import Hashable +from collections import OrderedDict +from collections.abc import Hashable, Mapping, MutableMapping, Sequence from trx_utils import ( is_integer, From a93557cc6e23fd286e515ec16db8da9c3faf31b4 Mon Sep 17 00:00:00 2001 From: anon Date: Mon, 17 Jul 2023 21:06:16 +0300 Subject: [PATCH 08/14] fix import Mapping --- tronapi/common/formatters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tronapi/common/formatters.py b/tronapi/common/formatters.py index 571af89..b5bd391 100644 --- a/tronapi/common/formatters.py +++ b/tronapi/common/formatters.py @@ -4,7 +4,7 @@ # See License.txt in the project root for license information. # -------------------------------------------------------------------- -from collections import Mapping, Iterable +from collections.abc Mapping, Iterable from eth_utils import to_dict from trx_utils import ( From 37ce63120742971ad46fbaf33cebf7dd4f2417d8 Mon Sep 17 00:00:00 2001 From: anon Date: Mon, 17 Jul 2023 21:07:22 +0300 Subject: [PATCH 09/14] fix import Mapping --- tronapi/common/formatters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tronapi/common/formatters.py b/tronapi/common/formatters.py index b5bd391..62e9710 100644 --- a/tronapi/common/formatters.py +++ b/tronapi/common/formatters.py @@ -4,7 +4,7 @@ # See License.txt in the project root for license information. # -------------------------------------------------------------------- -from collections.abc Mapping, Iterable +from collections.abc import Mapping, Iterable from eth_utils import to_dict from trx_utils import ( From 75e64cf889f8a74a334c110a2858adec56b7ba33 Mon Sep 17 00:00:00 2001 From: anon Date: Mon, 17 Jul 2023 21:11:00 +0300 Subject: [PATCH 10/14] fix from eth_abi import encode_abi --- tronapi/transactionbuilder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tronapi/transactionbuilder.py b/tronapi/transactionbuilder.py index 959fca2..1250531 100644 --- a/tronapi/transactionbuilder.py +++ b/tronapi/transactionbuilder.py @@ -11,7 +11,7 @@ List ) -from eth_abi import encode_abi +from eth_abi import encode from trx_utils import ( is_string, is_integer, @@ -572,7 +572,7 @@ def trigger_smart_contract(self, **kwargs): values.append(abi['value']) try: - parameters = encode_hex(encode_abi(types, values)).replace('0x', '', 2) + parameters = encode_hex(encode(types, values)).replace('0x', '', 2) except ValueError as ex: print(ex) From b24c3d41b0fa910ee15dfac81260c80f9d507e47 Mon Sep 17 00:00:00 2001 From: anon Date: Mon, 17 Jul 2023 21:12:32 +0300 Subject: [PATCH 11/14] fix from eth_abi import decode_abi --- tronapi/contract.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tronapi/contract.py b/tronapi/contract.py index 775410a..e31fdc5 100644 --- a/tronapi/contract.py +++ b/tronapi/contract.py @@ -6,7 +6,7 @@ import copy -from eth_abi import decode_abi +from eth_abi import decode from eth_utils import ( function_abi_to_4byte_selector, to_hex @@ -329,7 +329,7 @@ def decode_function_input(self, data): func = self.get_function_by_selector(selector) names = [x['name'] for x in func.abi['inputs']] types = [x['type'] for x in func.abi['inputs']] - decoded = decode_abi(types, params) + decoded = decode(types, params) normalized = map_abi_data(BASE_RETURN_NORMALIZERS, types, decoded) return func, dict(zip(names, normalized)) From 2e5da1dab25f470b76919dfb460cd8a55952e0db Mon Sep 17 00:00:00 2001 From: anon Date: Mon, 17 Jul 2023 21:14:18 +0300 Subject: [PATCH 12/14] fix from eth_abi import encode_abi --- tronapi/common/contracts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tronapi/common/contracts.py b/tronapi/common/contracts.py index a83961a..c33e5f3 100644 --- a/tronapi/common/contracts.py +++ b/tronapi/common/contracts.py @@ -36,7 +36,7 @@ valmap, ) from eth_abi import ( - encode_abi as eth_abi_encode_abi, + encode as eth_abi_encode_abi, ) from eth_abi.exceptions import ( From 5fc0d4727c5beeb0388f70a36204868a8ba917ad Mon Sep 17 00:00:00 2001 From: anon Date: Mon, 17 Jul 2023 23:15:13 +0300 Subject: [PATCH 13/14] trx-utils master branch --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fac3d9c..168ee66 100644 --- a/setup.py +++ b/setup.py @@ -85,7 +85,7 @@ "eth-utils>=2.2", "eth-hash[pycryptodome]>=0.5", - "trx-utils @ git+https://github.com/const-tmp/trx-utils.git@update-eth-deps", + "trx-utils @ git+https://github.com/const-tmp/trx-utils.git", "hexbytes>=0.1.0,<1.0.0", From ea215bcd3900917d0c0f316439bf9c7f745a7db2 Mon Sep 17 00:00:00 2001 From: anon Date: Tue, 18 Jul 2023 00:04:48 +0300 Subject: [PATCH 14/14] remove version constraints --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 168ee66..520b931 100644 --- a/setup.py +++ b/setup.py @@ -80,10 +80,10 @@ "toolz>=0.9.0,<1.0.0;implementation_name=='pypy'", "cytoolz>=0.9.0,<1.0.0;implementation_name=='cpython'", - "eth-abi>=4", - "eth-account>=0.9", - "eth-utils>=2.2", - "eth-hash[pycryptodome]>=0.5", + "eth-abi", + "eth-account", + "eth-utils", + "eth-hash[pycryptodome]", "trx-utils @ git+https://github.com/const-tmp/trx-utils.git",