-
Notifications
You must be signed in to change notification settings - Fork 57
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
Related to issue #216 #225
base: master
Are you sure you want to change the base?
Conversation
- Added validation for Ethereum addresses using the EIP-55 checksum standard. - Implemented the `validate_eth_address` function to ensure all Ethereum addresses are correctly validated before use. - Updated the `Account::new` constructor to include checksum validation logic. - Included test cases to verify the correctness of valid and invalid Ethereum addresses. - Improved error handling for invalid addresses.
/// | ||
/// # Returns | ||
/// * `Result<Account, &'static str>` - Returns an Account if the address is valid, or an error message otherwise. | ||
pub fn new(index: Option<usize>, unverified: Unverified, cmd: Option<Command>) -> Result<Self, &'static str> { |
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.
This isn't called from anywhere.
} | ||
|
||
// Example test cases for Ethereum address validation |
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.
Why are they example test cases?
Please update the title to something meaningful and link the issue in the PR description. |
validate_eth_address
function to ensure all Ethereum addresses are correctly validated before use.Account::new
constructor to include checksum validation logic.