Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools → Key Management → Search by Public Key only accepted 'legacy format' keys. #1347

Open
RichardSlater opened this issue Jun 27, 2023 · 1 comment
Assignees
Labels
anchor bug Something isn't working

Comments

@RichardSlater
Copy link

Description

In trying to diagnose #1343, I tried to search for public keys held by Anchor Desktop. However I discovered that when you search for a key only the legacy format will yield results.

I believe the issue to be /app/shared/components/Tools/Keys.js#L99:

filtered = [...pubkeys.available].filter(k => k.toLowerCase().includes(searchFilter.toLowerCase()));

I suspect changing the logic as follows would correct the defect, apologies for the lack of testing I can't currently get Anchor to run from source without a code signing cert:

filtered = [...pubkeys.available].filter(k => k.toLowerCase().includes(searchFilter.toLowerCase()) || k.toLowerCase().map(pk => pk.toPublic().toLegacyString(connection.keyPrefix)).includes(searchFilter.toLowerCase()));

This would also require injection of connection into the components props.

Platform

Desktop (Windows)

Steps To Reproduce

Not Happy Path

  1. Open Anchor Deskop
  2. Navigate to Tools → Manage Keys
  3. Copy a "modern" format key from the list, and paste it into "Search by Public Key"
  4. yields no results
image image

Happy Path

  1. Open Anchor Desktop
  2. Navigate to Tools → Manage Keys
  3. Copy a "lecacy" format key from the list, and paste it into "Search by Public Key"
  4. Should exactly one result

Expected Result

Regardless of the state of "Show Legacy Format" entering either a modern key (i.e. PUB_K1_...) or a legacy key (i.e. EOS...) should show that public key.

Actual Result

Searching for a public key of the modern format or simply "PUB_K1" will yield no results.

Relevant log output

[2023-06-27 15:32:38.199] [info]  initManager /
[2023-06-27 15:32:38.200] [info]  wallet ui: creating
[2023-06-27 15:32:38.222] [info]  initProtocolHandler: initializing protocol handler
[2023-06-27 15:32:38.222] [info]  protocol handler: creating ui
[2023-06-27 15:32:38.223] [info]  initial request false
[2023-06-27 15:32:39.170] [info]  initSessionManager: initializing session manager
[2023-06-27 15:32:39.171] [info]  initSessionManager: initializing session manager (lock is false)
[2023-06-27 15:32:39.172] [info]  [ 'SessionManager::constructor' ]
[2023-06-27 15:32:39.173] [info]  [ 'SessionManager::createHandler' ]
[2023-06-27 15:32:39.212] [info]  protocol handler: loaded ui
[2023-06-27 15:32:40.053] [info]  initHardwareLedger: initializing hardware ledger
[2023-06-27 15:32:40.097] [info]  initHardwareLedger: hardware ledger transport success
[2023-06-27 15:32:40.236] [info]  manager: successfully loaded

Contact Details

Scetrov on Discord

Anything else?

Chain: WAX Mainnet, EOS Mainnet, WAX Testnet
Anchor: 1.3.11
Windows 11 Pro

@RichardSlater RichardSlater added anchor bug Something isn't working labels Jun 27, 2023
@aaroncox
Copy link
Member

Thanks for this, we'll get this addressed in the next release 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
anchor bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants