Skip to content

Commit

Permalink
Fix duplicated LedgerAccounts (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
moisses89 authored Nov 16, 2023
1 parent 42bc07d commit bdc4fd6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
4 changes: 4 additions & 0 deletions tests/test_ledger_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit bdc4fd6

Please sign in to comment.