Skip to content

Address.createFromRawAddress is not validating checksum #801

@fboucquez

Description

@fboucquez
Contributor

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.

Activity

gimre-xymcity

gimre-xymcity commented on Aug 5, 2021

@gimre-xymcity
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

Jaguar0625 commented on Aug 5, 2021

@Jaguar0625

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Jaguar0625@fboucquez@gimre-xymcity

        Issue actions

          Address.createFromRawAddress is not validating checksum · Issue #801 · symbol/symbol-sdk-typescript-javascript