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

Improve Error Handling in GenerateAccountsWithKeyrings Function #1970

Open
coderabbitai bot opened this issue May 14, 2024 · 1 comment
Open

Improve Error Handling in GenerateAccountsWithKeyrings Function #1970

coderabbitai bot opened this issue May 14, 2024 · 1 comment
Milestone

Comments

@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 14, 2024

The function GenerateAccountsWithKeyrings is widely used across different test suites for setting up test environments. However, the search did not reveal any tests that explicitly simulate or handle errors specifically for this function. It appears that while the function is crucial, its error handling is not robustly tested, which could lead to unhandled exceptions in test setups.

Recommendation:

  • Implement specific tests that simulate keyring creation or mnemonic generation failures to ensure that all edge cases are covered and handled properly.

Relevant PR: #1953
Comment: link

@SpicyLemon
Copy link
Contributor

There are several versions of that function and they are only defined/used in unit tests. Some of the unit tests rely on the keyring being set up and those will fail if something goes wrong in GenerateAccountsWithKeyrings.

However, there's a new helper in our testutil package: GenerateTestAccountsInKeyring. We should switch all of the GenerateAccountsWithKeyrings functions to use testutil.GenerateTestAccountsInKeyring.

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

No branches or pull requests

2 participants