symbol-sdk-typescript-javascript icon indicating copy to clipboard operation
symbol-sdk-typescript-javascript copied to clipboard

Address.createFromRawAddress is not validating checksum

Open fboucquez opened this issue 3 years ago • 2 comments

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.

fboucquez avatar Jul 26 '21 10:07 fboucquez

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

gimre-xymcity avatar Aug 05 '21 12:08 gimre-xymcity

i agree validation should probably happen at some higher layer

Jaguar0625 avatar Aug 05 '21 15:08 Jaguar0625