You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
abi.calldata.toString output does not match the reference format #210
abi.calldata.toString() produces output that does not match the reference implementation in the genvm repo (runners/genlayer-py-std/src/genlayer/calldata/__init__.py, to_str). There are three separate defects, all in src/abi/calldata/string.ts.
This function is public API, and it also feeds the readable field of decodeTransaction / simplifyTransactionReceipt through calldataToUserFriendlyJson, so the malformed output reaches end users.
Defects
Input
genlayer-js v1
Reference to_str
new Uint8Array([0x01, 0x02])
b#12
b#0102
20-byte address of 0x01
addr#11111111111111111111
addr#0101…0101 (40 chars)
{x: true, y: null}
{"x":true"y":null}
{"x":true,"y":null}
[1, 2, 3]
[1,2,3,]
[1,2,3]
Hex is not zero padded. Bytes and addresses use toString(16) with no padding, so 0x0a renders as a. This is lossy, not just cosmetic: Uint8Array([0x01, 0x02]) and Uint8Array([0x12]) both render as b#12. Addresses shorter than 40 hex characters are produced whenever any byte is below 0x10.
Map entries have no separator.toStringImplMap never pushes a comma, so the output is not parseable.
Arrays emit a trailing comma. The reference emits none.
Activity