From d6241d43df2738899c278b612539ac30f6596a3b Mon Sep 17 00:00:00 2001 From: moisses89 <7888669+moisses89@users.noreply.github.com> Date: Thu, 16 Nov 2023 10:45:33 +0100 Subject: [PATCH] Fix duplicated LedgerAccounts --- requirements.txt | 2 +- setup.py | 2 +- tests/test_ledger_manager.py | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index aad6eb94..0ed998cd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ art==6.1 colorama==0.4.6 -ledgereth==0.9.0 +ledgereth==0.9.1 packaging>=23.1 prompt_toolkit==3.0.40 pygments==2.16.1 diff --git a/setup.py b/setup.py index 1d61479d..ff59e972 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ "safe-eth-py==6.0.0b5", "tabulate>=0.8", ], - extras_require={"ledger": ["ledgereth==0.9.0"]}, + extras_require={"ledger": ["ledgereth==0.9.1"]}, packages=setuptools.find_packages(), entry_points={ "console_scripts": [ diff --git a/tests/test_ledger_manager.py b/tests/test_ledger_manager.py index f0fc5411..c8993d81 100644 --- a/tests/test_ledger_manager.py +++ b/tests/test_ledger_manager.py @@ -153,6 +153,10 @@ def test_add_account(self, mock_get_account_by_path: MagicMock): ledger_account = list(ledger_manager.accounts)[0] self.assertEqual(ledger_account.address, account_address) self.assertEqual(ledger_account.path, derivation_path) + # Shouldn't duplicate accounts + self.assertEqual(ledger_manager.add_account(derivation_path), account_address) + self.assertEqual(len(ledger_manager.accounts), 1) + # Should accept derivation paths starting with master master_derivation_path = "m/44'/60'/0'/0" self.assertEqual(