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

Address.createFromRawAddress is not validating checksum #801

Open
fboucquez opened this issue Jul 26, 2021 · 2 comments
Open

Address.createFromRawAddress is not validating checksum #801

fboucquez opened this issue Jul 26, 2021 · 2 comments

Comments

@fboucquez
Copy link
Contributor

fboucquez commented Jul 26, 2021

When a user is creating an address, the constructor should be validating the checksum by default and not expect the user to call Address.isValidRawAddress before...

https://github.com/symbol/symbol-sdk-typescript-javascript/blob/main/src/model/account/Address.ts#L45

Note, I've added the validation and this breaks several invalid unit tests where the addresses are invalid.

@gimre-xymcity
Copy link
Member

createFromRawAddress - imo it should not do validation, you should be able anything that has size of raw address...
if user (read: developer) wants to validate, there should be explicit call to isValid()

cc: @Jaguar0625

@Jaguar0625
Copy link

i agree validation should probably happen at some higher layer

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

No branches or pull requests

3 participants