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

hexFrom in @ckb-ccc/core/barrel not producing valid hex strings when an empty array is provided #91

Closed
Officeyutong opened this issue Dec 2, 2024 · 1 comment

Comments

@Officeyutong
Copy link

Officeyutong commented Dec 2, 2024

console.log(hexFrom([])); // outputs "0x"
console.log(hexFrom(new Uint8Array([]))); // outputs "0x"

hexFrom will return 0x which is an invalid hex string when an empty array was provided as argument, since bytesTo returns empty string when zero-length bytes was provided.

Illegal hex string like 0x will be refused by BigInt and leads to an exception.

Minimum reproduce: https://github.com/Officeyutong/ckb-ccc-core-hex-from-reproduce

A PR has been made to fix this issue #90

@Officeyutong
Copy link
Author

Not an issue. See #90 (comment)

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

1 participant