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

Refactor get_account_id_from_seed / get_from_seed to one common place #5705

Open
bkontur opened this issue Sep 13, 2024 · 4 comments
Open

Refactor get_account_id_from_seed / get_from_seed to one common place #5705

bkontur opened this issue Sep 13, 2024 · 4 comments
Assignees
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK.

Comments

@bkontur
Copy link
Contributor

bkontur commented Sep 13, 2024

These functions are copied all over the place.

@bkontur bkontur added C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK. labels Sep 13, 2024
@bkontur
Copy link
Contributor Author

bkontur commented Sep 13, 2024

check @kianenigma's comment here: #5327 (comment)

Keyring::iter() would give the same, but I donno why no one uses it 🤷

@programskillforverification
Copy link
Contributor

I will work on this

@michalkucharczyk
Copy link
Contributor

tagging @iulianbarbu , as I know he is working on similar matter.

@iulianbarbu
Copy link
Contributor

thanks for the tag! I am happy to leave it to @programskillforverification. Leaving here the direction I got based on the comms on this subject lately and my own investigation.

There is a mention of adding sp_keyring as a frame dependency as noted here: #4739 (comment). My understanding is that the overall suggestion is to re-export sp_keyring::Keyring from frame and use Keyring::iter() instead of the widely used get_account_id_from_seed and friends. The re-export wouldn't be usable without importing frame everywhere we have the duplicated business logic (all places that implement/import get_account_id_from_seed/get_from_seed at least). These places have dependencies on sp-core and sp-runtime on their own, so we might very well remove them and use frame::deps::sp_core/sp_runtime instead where needed (hopefully feature flags will not cause issues here).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C1-mentor A task where a mentor is available. Please indicate in the issue who the mentor could be. C2-good-first-issue A task for a first time contributor to become familiar with the Polkadot-SDK.
Projects
None yet
Development

No branches or pull requests

4 participants