Skip to content

Commit

Permalink
Use parseBigInt in Contract's argument parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelmanzanera committed Jun 12, 2024
1 parent ecb524b commit dbf62bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/contract.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ContractAction } from "./types.js";
import { parseBigInt } from "./utils.js";

export function extractActionsFromContract(code: string): ContractAction[] {
const regex = /actions\s+triggered_by:\s+transaction,\s+on:\s+([\w\s.,()]+?)\s+do/g;
Expand Down Expand Up @@ -27,7 +28,7 @@ export function parseTypedArgument(input: any): any {
return input; // Return input as is
} else if (!isNaN(input)) {
// Check if input is a number
return parseFloat(input); // Parse input as a float
return parseBigInt(input); // Parse input as a bigint
} else {
return input; // Return input as string
}
Expand Down

0 comments on commit dbf62bc

Please sign in to comment.