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

api - Refactor removal / replacement of deprecated and obsolete funcs #4976

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

Samyoul
Copy link
Member

@Samyoul Samyoul commented Mar 22, 2024

I've resolved a number of refactor issues in the api package.

  • backend : Updated the StatusBackend interface to match usage
  • backend_test : Resolved unhandled errors, import collisions and upgraded deprecated funcs
  • eth_backend : resolved import collisions

@status-im-auto
Copy link
Member

status-im-auto commented Mar 22, 2024

Jenkins Builds

Commit #️⃣ Finished (UTC) Duration Platform Result
✖️ 64ba08e #1 2024-03-22 21:57:23 ~1 min tests 📄log
✔️ 64ba08e #1 2024-03-22 21:59:26 ~3 min linux 📦zip
✔️ 64ba08e #1 2024-03-22 22:01:50 ~5 min android 📦aar
✔️ 64ba08e #1 2024-03-22 22:02:22 ~6 min ios 📦zip
✖️ 64ba08e #2 2024-03-25 20:21:38 ~1 min tests 📄log
✖️ 64ba08e #3 2024-03-25 20:22:03 ~20 sec tests 📄log
✖️ 64ba08e #4 2024-03-26 09:53:36 ~18 sec tests 📄log


GetNodeConfig() (*params.NodeConfig, error)
UpdateRootDataDir(datadir string)

// SelectAccount(loginParams account.LoginParams) error
SelectAccount(loginParams account.LoginParams) error
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering... if this function calls func (m *DefaultManager) SelectAccount(loginParams LoginParams) error and it expects loginParams.Password to be provided, won't that return an error in case of a keycard migrated profile?

Copy link
Member Author

@Samyoul Samyoul Mar 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting questions @saledjenic. I don't think that this change will break any existing flows.

This change only reintroduces the function signature to the StatusBackend interface. The implementation details of this function (whether loginParams.Password is expected etc) are a concern for the implementing struct.

However existing code, unaltered by this PR, that implements this function signature already uses the loginParams.Password property.

func (m *DefaultManager) SelectAccount(loginParams LoginParams) error {
	m.mu.Lock()
	defer m.mu.Unlock()

	m.accountsGenerator.Reset()

	selectedChatAccount, err := m.unlockExtendedKey(loginParams.ChatAddress.String(), loginParams.Password)
	if err != nil {
		return err
	}
	m.watchAddresses = loginParams.WatchAddresses
	m.mainAccountAddress = loginParams.MainAccount
	m.selectedChatAccount = selectedChatAccount
	return nil
}

This code is called via the LoginAccount API method. So perhaps a different API method is called when logging in via Keycard, because the failure would already be an issue without the changes in this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Samyoul yes, I see what you've changed, no problem with your change at all, I just used the opportunity to ask does that somehow affect the keycard users, nothing else, sorry about confusion. :)

Copy link
Contributor

@kounkou kounkou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢 it, thanks @Samyoul !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants