-
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.
- Loading branch information
1 parent
b057a70
commit 59e176e
Showing
16 changed files
with
2,808 additions
and
21 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
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,3 @@ | ||
export function intersectSets<T>(...sets: Set<T>[]): Set<T> { | ||
return new Set<T>(sets.flatMap((s) => [...s])) | ||
} |
70 changes: 70 additions & 0 deletions
70
tests/approvals/out/reserve-scratch/ReserveScratchAlgo.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,70 @@ | ||
#pragma version 10 | ||
|
||
tests/approvals/reserve-scratch.algo.ts::ReserveScratchAlgo.approvalProgram: | ||
intcblock 1 0 15 45 | ||
bytecblock "hello" | ||
txn ApplicationID | ||
bnz main_after_if_else@2 | ||
callsub constructor | ||
|
||
main_after_if_else@2: | ||
// tests/approvals/reserve-scratch.algo.ts:13 | ||
// this.setThings() | ||
callsub setThings | ||
// tests/approvals/reserve-scratch.algo.ts:15 | ||
// assert(Scratch.loadUint64(0) === 1) | ||
intc_1 // 0 | ||
loads | ||
intc_0 // 1 | ||
== | ||
assert | ||
// tests/approvals/reserve-scratch.algo.ts:16 | ||
// assert(Scratch.loadBytes(0) === Bytes('hello')) | ||
intc_1 // 0 | ||
loads | ||
bytec_0 // "hello" | ||
== | ||
assert | ||
// tests/approvals/reserve-scratch.algo.ts:17 | ||
// assert(Scratch.loadUint64(15) === 45) | ||
intc_2 // 15 | ||
loads | ||
intc_3 // 45 | ||
== | ||
assert | ||
// tests/approvals/reserve-scratch.algo.ts:18 | ||
// return true | ||
intc_0 // 1 | ||
return | ||
|
||
|
||
// tests/approvals/reserve-scratch.algo.ts::ReserveScratchAlgo.constructor() -> void: | ||
constructor: | ||
// tests/approvals/reserve-scratch.algo.ts:4-5 | ||
// @contract({ scratchSlots: [0, 1, { from: 10, to: 20 }] }) | ||
// export class ReserveScratchAlgo extends BaseContract { | ||
proto 0 0 | ||
retsub | ||
|
||
|
||
// tests/approvals/reserve-scratch.algo.ts::ReserveScratchAlgo.setThings() -> void: | ||
setThings: | ||
// tests/approvals/reserve-scratch.algo.ts:6 | ||
// setThings() { | ||
proto 0 0 | ||
// tests/approvals/reserve-scratch.algo.ts:7 | ||
// Scratch.store(0, 1) | ||
intc_1 // 0 | ||
intc_0 // 1 | ||
stores | ||
// tests/approvals/reserve-scratch.algo.ts:8 | ||
// Scratch.store(1, Bytes('hello')) | ||
intc_0 // 1 | ||
bytec_0 // "hello" | ||
stores | ||
// tests/approvals/reserve-scratch.algo.ts:9 | ||
// Scratch.store(15, 45) | ||
intc_2 // 15 | ||
intc_3 // 45 | ||
stores | ||
retsub |
5 changes: 5 additions & 0 deletions
5
tests/approvals/out/reserve-scratch/ReserveScratchAlgo.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/reserve-scratch.algo.ts::ReserveScratchAlgo.clearStateProgram: | ||
pushint 1 // 1 | ||
return |
37 changes: 37 additions & 0 deletions
37
tests/approvals/out/reserve-scratch/ReserveScratchAlgo.ssa.ir
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,37 @@ | ||
contract tests/approvals/reserve-scratch.algo.ts::ReserveScratchAlgo: | ||
program approval: | ||
subroutine tests/approvals/reserve-scratch.algo.ts::ReserveScratchAlgo.approvalProgram() -> bool: | ||
block@0: // L12 | ||
let reinterpret_bool%0#0: bool = (txn ApplicationID) | ||
goto reinterpret_bool%0#0 ? block@2 : block@1 | ||
block@1: // if_body_L1 | ||
tests/approvals/reserve-scratch.algo.ts::ReserveScratchAlgo.constructor() | ||
goto block@2 | ||
block@2: // after_if_else_L1 | ||
tests/approvals/reserve-scratch.algo.ts::ReserveScratchAlgo.setThings() | ||
let tmp%0#0: uint64 = (loads 0u) | ||
let tmp%1#0: bool = (== tmp%0#0 1u) | ||
(assert tmp%1#0) | ||
let tmp%2#0: bytes = (loads 0u) | ||
let tmp%3#0: bool = (== tmp%2#0 "hello") | ||
(assert tmp%3#0) | ||
let tmp%4#0: uint64 = (loads 15u) | ||
let tmp%5#0: bool = (== tmp%4#0 45u) | ||
(assert tmp%5#0) | ||
return 1u | ||
|
||
subroutine tests/approvals/reserve-scratch.algo.ts::ReserveScratchAlgo.constructor() -> void: | ||
block@0: // L4 | ||
return | ||
|
||
subroutine tests/approvals/reserve-scratch.algo.ts::ReserveScratchAlgo.setThings() -> void: | ||
block@0: // L6 | ||
(stores 0u 1u) | ||
(stores 1u "hello") | ||
(stores 15u 45u) | ||
return | ||
|
||
program clear-state: | ||
subroutine @algorandfoundation/algorand-typescript/base-contract.d.ts::BaseContract.clearStateProgram() -> bool: | ||
block@0: // L1 | ||
return 1u |
105 changes: 105 additions & 0 deletions
105
tests/approvals/out/reserve-scratch/SubReserveScratchAlgo.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,105 @@ | ||
#pragma version 10 | ||
|
||
tests/approvals/reserve-scratch.algo.ts::SubReserveScratchAlgo.approvalProgram: | ||
intcblock 1 0 15 45 | ||
bytecblock "world" "hello" | ||
txn ApplicationID | ||
bnz main_after_if_else@2 | ||
callsub constructor | ||
|
||
main_after_if_else@2: | ||
// tests/approvals/reserve-scratch.algo.ts:25 | ||
// super.approvalProgram() | ||
callsub approvalProgram | ||
pop | ||
// tests/approvals/reserve-scratch.algo.ts:26 | ||
// Scratch.store(50, Bytes('world')) | ||
pushint 50 // 50 | ||
bytec_0 // "world" | ||
stores | ||
// tests/approvals/reserve-scratch.algo.ts:27 | ||
// Scratch.store(16, Bytes('world')) | ||
pushint 16 // 16 | ||
bytec_0 // "world" | ||
stores | ||
// tests/approvals/reserve-scratch.algo.ts:28 | ||
// return true | ||
intc_0 // 1 | ||
return | ||
|
||
|
||
// tests/approvals/reserve-scratch.algo.ts::SubReserveScratchAlgo.constructor() -> void: | ||
constructor: | ||
// tests/approvals/reserve-scratch.algo.ts:22-23 | ||
// @contract({ scratchSlots: [50] }) | ||
// export class SubReserveScratchAlgo extends ReserveScratchAlgo { | ||
proto 0 0 | ||
callsub tests/approvals/reserve-scratch.algo.ts::ReserveScratchAlgo.constructor | ||
retsub | ||
|
||
|
||
// tests/approvals/reserve-scratch.algo.ts::ReserveScratchAlgo.constructor() -> void: | ||
tests/approvals/reserve-scratch.algo.ts::ReserveScratchAlgo.constructor: | ||
// tests/approvals/reserve-scratch.algo.ts:4-5 | ||
// @contract({ scratchSlots: [0, 1, { from: 10, to: 20 }] }) | ||
// export class ReserveScratchAlgo extends BaseContract { | ||
proto 0 0 | ||
retsub | ||
|
||
|
||
// tests/approvals/reserve-scratch.algo.ts::ReserveScratchAlgo.approvalProgram() -> uint64: | ||
approvalProgram: | ||
// tests/approvals/reserve-scratch.algo.ts:12 | ||
// approvalProgram(): boolean { | ||
proto 0 1 | ||
// tests/approvals/reserve-scratch.algo.ts:13 | ||
// this.setThings() | ||
callsub setThings | ||
// tests/approvals/reserve-scratch.algo.ts:15 | ||
// assert(Scratch.loadUint64(0) === 1) | ||
intc_1 // 0 | ||
loads | ||
intc_0 // 1 | ||
== | ||
assert | ||
// tests/approvals/reserve-scratch.algo.ts:16 | ||
// assert(Scratch.loadBytes(0) === Bytes('hello')) | ||
intc_1 // 0 | ||
loads | ||
bytec_1 // "hello" | ||
== | ||
assert | ||
// tests/approvals/reserve-scratch.algo.ts:17 | ||
// assert(Scratch.loadUint64(15) === 45) | ||
intc_2 // 15 | ||
loads | ||
intc_3 // 45 | ||
== | ||
assert | ||
// tests/approvals/reserve-scratch.algo.ts:18 | ||
// return true | ||
intc_0 // 1 | ||
retsub | ||
|
||
|
||
// tests/approvals/reserve-scratch.algo.ts::ReserveScratchAlgo.setThings() -> void: | ||
setThings: | ||
// tests/approvals/reserve-scratch.algo.ts:6 | ||
// setThings() { | ||
proto 0 0 | ||
// tests/approvals/reserve-scratch.algo.ts:7 | ||
// Scratch.store(0, 1) | ||
intc_1 // 0 | ||
intc_0 // 1 | ||
stores | ||
// tests/approvals/reserve-scratch.algo.ts:8 | ||
// Scratch.store(1, Bytes('hello')) | ||
intc_0 // 1 | ||
bytec_1 // "hello" | ||
stores | ||
// tests/approvals/reserve-scratch.algo.ts:9 | ||
// Scratch.store(15, 45) | ||
intc_2 // 15 | ||
intc_3 // 45 | ||
stores | ||
retsub |
Oops, something went wrong.