Skip to content

Commit

Permalink
fix(Calldata.compile): do not split long entrypoint names before ca…
Browse files Browse the repository at this point in the history
…lling `getSelectorFromName`

Since `getSelectorFromName` uses keccak on its input, we don't need to split the given text value, as there are practically no limits on the input it can handle
  • Loading branch information
avimak authored and penovicp committed Dec 10, 2023
1 parent ab6a05c commit 89715da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils/calldata/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ export class CallData {
const oe = Array.isArray(o) ? [o.length.toString(), ...o] : o;
return Object.entries(oe).flatMap(([k, v]) => {
let value = v;
if (isLongText(value)) value = splitLongString(value);
if (k === 'entrypoint') value = getSelectorFromName(value);
else if (isLongText(value)) value = splitLongString(value);
const kk = Array.isArray(oe) && k === '0' ? '$$len' : k;
if (isBigInt(value)) return [[`${prefix}${kk}`, felt(value)]];
if (Object(value) === value) {
Expand Down

0 comments on commit 89715da

Please sign in to comment.