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 Duplicate Code in wallets.js #200

Open
BrosG opened this issue May 24, 2023 · 0 comments
Open

Refactor Duplicate Code in wallets.js #200

BrosG opened this issue May 24, 2023 · 0 comments

Comments

@BrosG
Copy link
Contributor

BrosG commented May 24, 2023

The getWalletTron and getWalletTronV2 functions in wallets.js have a significant amount of duplicate code. Both functions retrieve a wallet from the database, decrypt it if a keystore exists, and generate a Tron wallet from a seed.
Suggestion: Refactor these functions to eliminate duplicate code. This could be achieved by creating a reusable function that performs the common tasks. Any differences between the two functions can be handled with arguments or options passed to this new function.

Verification: After refactoring, verify that both getWalletTron and getWalletTronV2 functions are working as expected. This can be done by running your suite of tests, if available, or manually testing the functionality of these functions.

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

No branches or pull requests

1 participant