-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Expand supported args for uint64 constructor
- Loading branch information
1 parent
005551a
commit df9a59b
Showing
26 changed files
with
1,629 additions
and
126 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import type { SourceLocation } from '../../../awst/source-location' | ||
import { CodeError } from '../../../errors' | ||
|
||
export function stringToBigint({ value, sourceLocation }: { value: string; sourceLocation: SourceLocation }): bigint { | ||
try { | ||
return BigInt(value) | ||
} catch (e) { | ||
if (e instanceof SyntaxError) { | ||
throw new CodeError(`Cannot convert ${value} to an integer`, { sourceLocation }) | ||
} | ||
throw e | ||
} | ||
} |
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
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
36 changes: 36 additions & 0 deletions
36
tests/approvals/out/biguint-expressions/DemoContract.approval.teal
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 |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#pragma version 10 | ||
|
||
tests/approvals/biguint-expressions.algo.ts::DemoContract.approvalProgram: | ||
txn ApplicationID | ||
bnz main_after_if_else@2 | ||
callsub constructor | ||
|
||
main_after_if_else@2: | ||
// tests/approvals/biguint-expressions.algo.ts:23 | ||
// test(1, false, itob(4)) | ||
pushint 4 // 4 | ||
itob | ||
pushint 1 // 1 | ||
pushint 0 // 0 | ||
uncover 2 | ||
callsub test | ||
// tests/approvals/biguint-expressions.algo.ts:24 | ||
// return true | ||
pushint 1 // 1 | ||
return | ||
|
||
|
||
// tests/approvals/biguint-expressions.algo.ts::DemoContract.constructor() -> void: | ||
constructor: | ||
// tests/approvals/biguint-expressions.algo.ts:21 | ||
// class DemoContract extends BaseContract { | ||
proto 0 0 | ||
retsub | ||
|
||
|
||
// tests/approvals/biguint-expressions.algo.ts::test(a: uint64, b: uint64, c: bytes) -> void: | ||
test: | ||
// tests/approvals/biguint-expressions.algo.ts:5 | ||
// function test(a: uint64, b: boolean, c: bytes) { | ||
proto 3 0 | ||
retsub |
5 changes: 5 additions & 0 deletions
5
tests/approvals/out/biguint-expressions/DemoContract.clear.teal
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#pragma version 10 | ||
|
||
tests/approvals/biguint-expressions.algo.ts::DemoContract.clearStateProgram: | ||
pushint 1 // 1 | ||
return |
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
Oops, something went wrong.