Skip to content

Commit

Permalink
fix: use of uint256 in array in calls
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippeR26 committed May 16, 2023
1 parent ebdcb43 commit 969b3c1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/utils/calldata/requestParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ function parseCalldataValue(
return acc.concat(parsedData);
}, [] as string[]);
}
// check if u256
if (isTypeUint256(type)) {
if (typeof element === 'object') {
const { low, high } = element;
return [felt(low as BigNumberish), felt(high as BigNumberish)];
}
const el_uint256 = uint256(element);
return [felt(el_uint256.low), felt(el_uint256.high)];
}
if (typeof element === 'object') {
throw Error(`Parameter ${element} do not align with abi parameter ${type}`);
}
Expand Down

0 comments on commit 969b3c1

Please sign in to comment.