CodeChain-io / CodeChain-io/codechain-primitives-js

PlatformAddress.check returns true with the invalid string

Open
#60 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
11
Forks
9
PR merge metrics
No merged PRs in 30d

Description

Because the logic of [PlatformAddress.check](https://github.com/CodeChain-io/codechain-primitives-js/blob/f90d068cc870b50061fde480f4e8c7b5e598e015/src/address/PlatformAddress.ts#L93) is different from [PlatformAddress.fromString](https://github.com/CodeChain-io/codechain-primitives-js/blob/f90d068cc870b50061fde480f4e8c7b5e598e015/src/address/PlatformAddress.ts#L72), `check` returns `true` for the invalid string.
For example, `cccqgfrg4ncjqfrg4ncjqfrg4ncjqfrg4ncjq2tpqzg` is not a valid platform address because the version is 2, but `check` returns true.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.