mirror of
https://github.com/zama-ai/fhevm-solidity.git
synced 2026-01-11 05:28:01 -05:00
29 lines
790 B
TypeScript
29 lines
790 B
TypeScript
import overloads from './overloads.json';
|
|
|
|
type OverloadTestJSON = {
|
|
inputs: (number | bigint | string)[];
|
|
output: boolean | number | bigint | string;
|
|
};
|
|
|
|
type OverloadTest = {
|
|
inputs: (number | bigint)[];
|
|
output: boolean | number | bigint;
|
|
};
|
|
|
|
const transformBigInt = (o: { [methodName: string]: OverloadTestJSON[] }) => {
|
|
Object.keys(o).forEach((k) => {
|
|
o[k].forEach((test) => {
|
|
test.inputs.forEach((input, i) => {
|
|
if (typeof input === 'string') test.inputs[i] = BigInt(input);
|
|
});
|
|
if (typeof test.output === 'string') test.output = BigInt(test.output);
|
|
});
|
|
});
|
|
};
|
|
|
|
transformBigInt(overloads);
|
|
|
|
type OverloadTests = { [methodName: string]: OverloadTest[] };
|
|
|
|
export const overloadTests: OverloadTests = overloads as unknown as OverloadTests;
|