Skip to content

refactor(api)_: removal / replacement of deprecated and obsolete funcs #4976

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

Merged
merged 6 commits into from
Jul 3, 2025

Conversation

Samyoul
Copy link
Contributor

@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

Click to see older builds (37)
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
✔️ 9817bd4 #2 2025-07-02 16:17:45 ~2 min android 📦aar
✖️ 9817bd4 #5 2025-07-02 16:17:46 ~2 min tests 📄log
✔️ 9817bd4 #1 2025-07-02 16:18:05 ~2 min macos 📦zip
✔️ 9817bd4 #2 2025-07-02 16:18:17 ~3 min linux 📦zip
✔️ 9817bd4 #1 2025-07-02 16:19:21 ~3 min macos 📦zip
✔️ 9817bd4 #2 2025-07-02 16:19:53 ~4 min ios 📦zip
✔️ 9817bd4 #1 2025-07-02 16:22:16 ~6 min windows 📦zip
✔️ 9817bd4 #1 2025-07-02 16:23:10 ~7 min tests-rpc 📄log
✔️ 9817bd4 #1 2025-07-02 16:25:54 ~10 min linux 📦zip
✖️ cd730e8 #6 2025-07-02 16:20:06 ~2 min tests 📄log
✔️ cd730e8 #3 2025-07-02 16:20:19 ~2 min android 📦aar
✔️ cd730e8 #2 2025-07-02 16:20:56 ~2 min macos 📦zip
✔️ cd730e8 #3 2025-07-02 16:21:33 ~3 min linux 📦zip
✔️ cd730e8 #2 2025-07-02 16:23:18 ~3 min macos 📦zip
✔️ cd730e8 #3 2025-07-02 16:24:15 ~4 min ios 📦zip
✔️ cd730e8 #2 2025-07-02 16:28:02 ~5 min windows 📦zip
✔️ cd730e8 #2 2025-07-02 16:28:48 ~5 min tests-rpc 📄log
✔️ cd730e8 #2 2025-07-02 16:33:28 ~7 min linux 📦zip
✔️ 70e916a #4 2025-07-02 16:51:45 ~2 min android 📦aar
✔️ 70e916a #3 2025-07-02 16:52:29 ~2 min macos 📦zip
✔️ 70e916a #4 2025-07-02 16:52:29 ~3 min linux 📦zip
✔️ 70e916a #3 2025-07-02 16:53:23 ~3 min macos 📦zip
✔️ 70e916a #4 2025-07-02 16:53:40 ~4 min ios 📦zip
✔️ 70e916a #3 2025-07-02 16:54:41 ~4 min windows 📦zip
✖️ 70e916a #3 2025-07-02 16:54:47 ~5 min tests-rpc 📄log
✔️ 70e916a #3 2025-07-02 16:59:14 ~9 min linux 📦zip
✖️ 70e916a #7 2025-07-02 17:15:32 ~25 min tests 📄log
✖️ 70e916a #8 2025-07-03 09:38:08 ~24 min tests 📄log
✔️ 70e916a #4 2025-07-03 10:31:40 ~5 min tests-rpc 📄log
✔️ 70e916a #6 2025-07-03 13:04:00 ~4 min tests-rpc 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ c6520e6 #5 2025-07-03 11:14:47 ~2 min android 📦aar
✔️ c6520e6 #4 2025-07-03 11:14:57 ~2 min macos 📦zip
✔️ c6520e6 #5 2025-07-03 11:15:03 ~3 min linux 📦zip
✔️ c6520e6 #4 2025-07-03 11:16:12 ~4 min macos 📦zip
✔️ c6520e6 #5 2025-07-03 11:16:36 ~4 min ios 📦zip
✔️ c6520e6 #4 2025-07-03 11:17:04 ~4 min windows 📦zip
✔️ c6520e6 #5 2025-07-03 11:17:29 ~5 min tests-rpc 📄log
✔️ c6520e6 #4 2025-07-03 11:21:56 ~9 min linux 📦zip
✖️ c6520e6 #9 2025-07-03 11:40:50 ~28 min tests 📄log
✔️ 6b70542 #6 2025-07-03 14:27:08 ~2 min android 📦aar
✔️ 6b70542 #6 2025-07-03 14:28:04 ~3 min linux 📦zip
✔️ 6b70542 #5 2025-07-03 14:29:10 ~4 min macos 📦zip
✔️ 6b70542 #5 2025-07-03 14:29:26 ~4 min windows 📦zip
✔️ 6b70542 #5 2025-07-03 14:30:02 ~5 min macos 📦zip
✔️ 6b70542 #6 2025-07-03 14:30:07 ~5 min ios 📦zip
✔️ 6b70542 #7 2025-07-03 14:32:47 ~7 min tests-rpc 📄log
✔️ 6b70542 #5 2025-07-03 14:36:39 ~11 min linux 📦zip
✔️ 6b70542 #10 2025-07-03 14:52:52 ~28 min tests 📄log

api/backend.go Outdated

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
Contributor 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 !

Copy link
Contributor

@osmaczko osmaczko left a comment

Choose a reason for hiding this comment

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

Samyoul, just bumping this. The poor PR is feeling forgotten 😅

@Samyoul
Copy link
Contributor Author

Samyoul commented Jul 4, 2024

Oh no, Poor little PR . Thank you @osmaczko , I'll resolve the conflicts on merge

@igor-sirotin igor-sirotin force-pushed the chore/api-deprecation-refactor branch from 64ba08e to 9817bd4 Compare July 2, 2025 16:14
@igor-sirotin
Copy link
Collaborator

Rebased this one. Hopefully no build issues.

@igor-sirotin igor-sirotin force-pushed the chore/api-deprecation-refactor branch from 9817bd4 to cd730e8 Compare July 2, 2025 16:16
@igor-sirotin igor-sirotin assigned igor-sirotin and unassigned Samyoul Jul 2, 2025
@igor-sirotin igor-sirotin changed the title api - Refactor removal / replacement of deprecated and obsolete funcs refactor(api)_: removal / replacement of deprecated and obsolete funcs Jul 2, 2025
Copy link

codecov bot commented Jul 3, 2025

Codecov Report

Attention: Patch coverage is 74.19355% with 8 lines in your changes missing coverage. Please review.

Project coverage is 59.20%. Comparing base (f81d7de) to head (6b70542).
Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
api/geth_backend.go 74.19% 8 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #4976       +/-   ##
============================================
+ Coverage    29.22%   59.20%   +29.97%     
============================================
  Files          791      831       +40     
  Lines        98276   101480     +3204     
============================================
+ Hits         28723    60080    +31357     
+ Misses       65068    33816    -31252     
- Partials      4485     7584     +3099     
Flag Coverage Δ
functional 28.83% <61.29%> (-0.40%) ⬇️
unit 56.44% <74.19%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
api/geth_backend.go 55.25% <74.19%> (+23.43%) ⬆️

... and 590 files with indirect coverage changes

@igor-sirotin igor-sirotin force-pushed the chore/api-deprecation-refactor branch from c6520e6 to 6b70542 Compare July 3, 2025 14:24
@igor-sirotin igor-sirotin merged commit 4342bdc into develop Jul 3, 2025
24 checks passed
@igor-sirotin igor-sirotin deleted the chore/api-deprecation-refactor branch July 3, 2025 15:03
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.

7 participants