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 convertToKeycardAccount not to take Account and Settings argument #5359

Open
igor-sirotin opened this issue Jun 14, 2024 · 0 comments
Labels

Comments

@igor-sirotin
Copy link
Contributor

Problem

convertToKeycardAccount method takse Account and Settings as arguments.
This shouldn't be done, we should not use those structs directly. Instead, a single CovertToKeycardAccountRequest struct should be created and all required parameters should be added there.

func (b *GethStatusBackend) ConvertToKeycardAccount(account multiaccounts.Account, s settings.Settings, keycardUID string, password string, newPassword string) error {

Implementation

type CovertToKeycardAccountRequest struct {
	KeyUID             string
	KeycardInstanceUID string
	KeycardUID         string
	Password           string
	NewPassword        string
}

Notes:

  • account multiaccounts.Account can be read from multiaccountsDB
  • KeycardPairedOn - just set to time.Now()
  • KeycardPairing- should be read from settings.KeycardPairingsDataFile

Acceptance Criteria

This code can be removed from status-desktop:

https://github.com/status-im/status-desktop/blob/ca879b7facedaf5c54372ee059b3d4fe913d715a/src/app_service/service/accounts/service.nim#L491-L495

https://github.com/status-im/status-desktop/blob/ca879b7facedaf5c54372ee059b3d4fe913d715a/src/app_service/service/accounts/service.nim#L190-L202

Notes

To keep the API backwards compatible, we should introduce convertToKeycardAccountV2 and deprecate the old one. Remove it when both clients switch to the new endpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

No branches or pull requests

1 participant