-
Notifications
You must be signed in to change notification settings - Fork 166
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
Added Static Method to Account Class for Key Validation #931
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unit tests?
@snowypowers thanks for looking at it, I wrote it mid project while juggling other code |
Address = "Address", | ||
WIF = "WIF", | ||
NEP2 = "NEP2", | ||
unknown = "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small nit: enum capitalisation. Should be Unknown
i have no other issues except the lack of unit tests though the code is indeed pretty straightforward. |
updated case for Unknown enum
I'm not too familiar with the current unit testing implemented. but I fixed the case for the Unknown. |
Introduced a
validateKey
static method in theAccount
class that validates a string input and returns its type if valid, orvoid
/undefined
if invalid. This method streamlines validation by reducing the need for try/catch blocks and complex conditional checks, providing a clear and direct approach for assessing the health status of a string input.