-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
117ce9c
commit a798189
Showing
5 changed files
with
7,200 additions
and
7,178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,29 @@ | ||
import overloads from './overloads.json'; | ||
import { OverloadSignature, signatureContractMethodName } from './testgen'; | ||
|
||
type OverloadTest = { | ||
inputs: number[]; | ||
type OverloadTestJSON = { | ||
inputs: (number | bigint | string)[]; | ||
output: boolean | number | bigint | string; | ||
}; | ||
const transformBigInt = (o: { [methodName: string]: OverloadTest[] }) => { | ||
|
||
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); | ||
|
||
export const overloadTests: { [methodName: string]: OverloadTest[] } = overloads; | ||
export const overloadTests: { [methodName: string]: OverloadTest[] } = overloads as unknown as { | ||
[methodName: string]: OverloadTest[]; | ||
}; |
Oops, something went wrong.