Repository: mikeshultz/ledger-eth-lib (language: python)

Issue:
Update dependencies for Python 3.8 to 3.11

Install issues (from ledgerblue)
I tried install on macos and am getting this error:

```
      wheel.vendored.packaging.requirements.InvalidRequirement: Expected end or semicolon (after version specifier)
          python-pyscard>=1.6.12-4build1
                        ~~~~~~~~~~^
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for ledgerblue
  Running setup.py clean for ledgerblue
Failed to build ledgerblue
ERROR: Could not build wheels for ledgerblue, which is required to install pyproject.toml-based projects

```
Update dependencies for Python 3.8 to 3.11



Discussion / hints:

Fix patch:
diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 671f40d..04d2c70 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -9,7 +9,7 @@ jobs:
       - uses: actions/checkout@v2
       - uses: actions/setup-python@v2
         with:
-          python-version: "3.10"
+          python-version: "3.11"
       - run: pip install -e .[dev]
       - run: pytest
 
diff --git a/.readthedocs.yaml b/.readthedocs.yaml
index 8537510..99c178d 100644
--- a/.readthedocs.yaml
+++ b/.readthedocs.yaml
@@ -9,7 +9,7 @@ version: 2
 build:
   os: ubuntu-22.04
   tools:
-    python: "3.9"
+    python: "3.11"
 
 # Build documentation in the docs/ directory with Sphinx
 sphinx:
diff --git a/docs/conf.py b/docs/conf.py
index 4986d3f..422d31a 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -25,9 +25,9 @@
 author = "Mike Shultz"
 
 # The short X.Y version
-version = "0.7.3"
+version = "0.8.0"
 # The full version, including alpha/beta/rc tags
-release = "0.7.3"
+release = "0.8.0"
 
 
 # -- General configuration ---------------------------------------------------
diff --git a/ledgereth/_meta.py b/ledgereth/_meta.py
index 52ce664..5bf5583 100644
--- a/ledgereth/_meta.py
+++ b/ledgereth/_meta.py
@@ -1,3 +1,3 @@
 author = "Mike Shultz"
 email = "mike@mikeshultz.com"
-version = "0.7.3"
+version = "0.8.0"
diff --git a/requirements.dev.txt b/requirements.dev.txt
index b571be9..f1715c7 100644
--- a/requirements.dev.txt
+++ b/requirements.dev.txt
@@ -1,12 +1,11 @@
 autoflake~=1.4
 black>=21.11b1
 bump2version~=1.0.1
-# web3[tester] requires eth_account < 0.6.0
-eth-account<0.6.0
+eth-account>=0.8.0
 isort>=5.10.1
 mypy>=0.910
 pytest>=5.3.2
 setuptools>=44.0.0
 twine>=3.1.1
-web3[tester]~=5.28.0
+web3[tester]~=6.2.0
 wheel>=0.33.6
diff --git a/requirements.txt b/requirements.txt
index 797ff5f..64cc65c 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,5 +1,3 @@
-# eth-account requires <2 and web3[tester] requires eth-account<0.6.0
-eth-utils<2.0.0
-ledgerblue==0.1.43
-pysha3>=1.0.2
-rlp~=2.0.1
+eth-utils>=2.1.0,<3.0.0
+ledgerblue==0.1.48
+rlp~=3.0.0
diff --git a/setup.cfg b/setup.cfg
index bc3518b..2992271 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 0.7.3
+current_version = 0.8.0
 commit = True
 tag = True
 
diff --git a/setup.py b/setup.py
index aafe16f..b060965 100644
--- a/setup.py
+++ b/setup.py
@@ -52,11 +52,10 @@ def run(self):
         "Topic :: Software Development :: Libraries",
         "License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
         "Programming Language :: Python :: 3",
-        "Programming Language :: Python :: 3.4",
-        "Programming Language :: Python :: 3.5",
-        "Programming Language :: Python :: 3.6",
-        "Programming Language :: Python :: 3.7",
         "Programming Language :: Python :: 3.8",
+        "Programming Language :: Python :: 3.9",
+        "Programming Language :: Python :: 3.10",
+        "Programming Language :: Python :: 3.11",
     ],
     keywords="solidity ethereum development",
     packages=find_packages(exclude=["docs", "tests", "scripts", "build"]),


Test patch:
diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml
index a8600de..2ef9255 100644
--- a/.github/workflows/tests.yaml
+++ b/.github/workflows/tests.yaml
@@ -23,6 +23,7 @@ jobs:
           - "3.8"
           - "3.9"
           - "3.10"
+          - "3.11"
     runs-on: ubuntu-latest
     steps:
       - uses: actions/checkout@v2
diff --git a/tests/conftest.py b/tests/conftest.py
index 496b77d..f6e2e88 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -40,12 +40,9 @@ def _reset(self):
         self.account = None
         self.stack = []
 
-    def _sign_transaction(self, encoded_tx):
-        """Sign transaction data sent to the Ledger"""
-        tx = decode_transaction(encoded_tx)
-        resp = self.account.sign_transaction(tx.to_rpc_dict())
-
-        v = resp.v.to_bytes(1, "big")
+    def _resp_to_bytearray(self, resp):
+        # for large chain_id, v can be bigger than a byte. we'll take the lowest byte for the signature
+        v = resp.v.to_bytes(8, "big")[7].to_bytes(1, "big")
         r = resp.r.to_bytes(32, "big")
         s = resp.s.to_bytes(32, "big")
 
@@ -54,19 +51,19 @@ def _sign_transaction(self, encoded_tx):
 
         return bytearray(v + r + s)
 
+    def _sign_transaction(self, encoded_tx):
+        """Sign transaction data sent to the Ledger"""
+        tx = decode_transaction(encoded_tx)
+        resp = self.account.sign_transaction(tx.to_rpc_dict())
+
+        return self._resp_to_bytearray(resp)
+
     def _sign_message(self, encoded):
         """Sign message accodign to EIP-191"""
         signable = encode_defunct(encoded)
         resp = self.account.sign_message(signable)
 
-        v = resp.v.to_bytes(1, "big")
-        r = resp.r.to_bytes(32, "big")
-        s = resp.s.to_bytes(32, "big")
-
-        # Reset the stack and account MockLegder working with
-        self._reset()
-
-        return bytearray(v + r + s)
+        return self._resp_to_bytearray(resp)
 
     def _sign_typed(self, domain_hash, message_hash):
         """Sign message accodign to EIP-191"""
@@ -78,14 +75,7 @@ def _sign_typed(self, domain_hash, message_hash):
 
         resp = self.account.sign_message(signable)
 
-        v = resp.v.to_bytes(1, "big")
-        r = resp.r.to_bytes(32, "big")
-        s = resp.s.to_bytes(32, "big")
-
-        # Reset the stack and account MockLegder working with
-        self._reset()
-
-        return bytearray(v + r + s)
+        return self._resp_to_bytearray(resp)
 
     def handle_get_configuration(self, lc, data):
         # Return version 9.9.9