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

Remove generate_ed25519_address() from the wallet? #1536

Closed
Thoralf-M opened this issue Oct 30, 2023 · 3 comments · Fixed by #1586
Closed

Remove generate_ed25519_address() from the wallet? #1536

Thoralf-M opened this issue Oct 30, 2023 · 3 comments · Fixed by #1586
Assignees
Labels
m-wallet Module - Wallet t-investigate Task - Investigation

Comments

@Thoralf-M
Copy link
Member

Description

Move generate_ed25519_address() out of the wallet? Users can just generate with the secret manager before and then provide it to the wallet

Motivation

Simplification and clearer logic, no secret manager required for the wallet at this point

Open questions (optional)

Are there good reasons to not remove it?

Are you planning to do it yourself in a pull request?

No.

@Thoralf-M Thoralf-M added the m-wallet Module - Wallet label Oct 30, 2023
@Thoralf-M Thoralf-M added this to the v2.0.0 milestone Oct 30, 2023
@Thoralf-M Thoralf-M changed the title Move generate_ed25519_address() out of the wallet? Remove generate_ed25519_address() from the wallet? Oct 30, 2023
@thibault-martinez thibault-martinez added the t-investigate Task - Investigation label Nov 2, 2023
@Alex6323 Alex6323 linked a pull request Nov 10, 2023 that will close this issue
@Alex6323
Copy link
Contributor

Alex6323 commented Dec 7, 2023

Pros:

  • changes to the signature of that fn in the secretmanager don't have to be replicated in the corresponding wallet fn, so refactoring is easier
  • we have get_secret_manager fn in the wallet, so we basically have this fn on the wallet by just one noticeable indirection
  • we can more easily make the SecretManager optional in the wallet if we wawnted to: get_secret_manager would then just return a None if none is present.

Cons:

  • users need to call get_secret_manager before being able to call that fn (1 more indirection)

So my current take on this matter is, that we SHOULD remove the method from the wallet. I don't see any huge downsides and mostly upsides.

Related questions:

  • if we keep requiring a SecretManager, then WalletBuilder::with_address should be removed.

@DaughterOfMars
Copy link

On the flip side: The nice thing about this method is that it will use the wallet's configuration (generation bip44, bech32_hrp) but removing it means the user needs to get those things first then call the secret manager method then potentially iterate and convert the addresses to Bech32.

@thibault-martinez
Copy link
Member

Closed by #1586

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
m-wallet Module - Wallet t-investigate Task - Investigation
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

4 participants