Skip to content

[bug]: SDK Bug: blobMerkleRoot bytes with value 0x00 converted to null instead of 0 #2

@mistermc7899

Description

@mistermc7899

Affected product

SDK (JS/TS)

Version / Commit / Build

0.0.7

Platform / Environment

Browser (Chrome)

Steps to Reproduce

  1. Use @shelby-protocol/sdk version 0.0.7
  2. Try to upload a file whose merkle root contains 0x00 bytes
  3. Example merkle root: "0xa63afed6d85f2be676402661ebfa1516c6e41c4536a8c43bb09cbd9be700b1bd"
  4. The transaction simulation will fail in the wallet

Expected Behavior

The blobMerkleRoot hex string should be converted to a byte array where 0x00 becomes 0:
[166, 58, 254, ..., 231, 0, 177, 189] (position 29 = 0)

The transaction should simulate successfully and the file should upload.

Actual Behavior & Errors

The blobMerkleRoot hex string is converted to a byte array where 0x00 becomes null:
[166, 58, 254, ..., 231, null, 177, 189] (position 29 = null)

Error: Simulation error: Type mismatch for argument 2, expected 'number | string'

The transaction simulation fails and the file cannot be uploaded.

Logs / Screenshots

Contact (Optional)

No response

Pre-Checks

  • I've searched existing issues
  • This is not a security vulnerability (see SECURITY.md)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions