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 client initialization logic to use a generic lazy-loaded method #265

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cypherpepe
Copy link

Replaced individual client initializations with a getClient method that lazily loads and stores clients in a single object. This reduces code duplication and simplifies the management of client instances.

Description

This PR refactors the client initialization logic by introducing a getClient method that lazily loads and caches clients in a single object. The previous approach initialized each client separately, leading to duplicated code and less maintainability. The new method reduces redundancy and makes the code more modular and easier to extend.

Test Plan

  1. Ensure that lazy initialization occurs without errors and that subsequent calls retrieve the cached instance.
  2. Confirm that client functionality is not impacted by the refactoring using both wallet and account configurations.

Related Issue

No related issue. This is an internal refactoring to improve code structure.

Notes

No additional front-end or navigation changes required.

Replaced individual client initializations with a getClient method that lazily loads and stores clients in a single object. This reduces code duplication and simplifies the management of client instances.
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.

1 participant