Skip to content

Commit

Permalink
chore: Update approvals to match latest puya build output
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanmenzel committed Dec 20, 2024
1 parent 59fb439 commit d50a541
Show file tree
Hide file tree
Showing 353 changed files with 9,653 additions and 8,951 deletions.
160 changes: 83 additions & 77 deletions tests/approvals/out/abi-decorators/AbiDecorators.approval.teal
Original file line number Diff line number Diff line change
@@ -1,52 +1,53 @@
#pragma version 10
#pragma typetrack false

tests/approvals/abi-decorators.algo.ts::AbiDecorators.approvalProgram:
// @algorandfoundation/algorand-typescript/arc4/index.d.ts::Contract.approvalProgram() -> uint64:
main:
intcblock 0 1
bytecblock 0x151f7c75
txn ApplicationID
bnz main_after_if_else@2

main_if_body@1:
callsub constructor

main_after_if_else@2:
callsub __puya_arc4_router__
return


// tests/approvals/abi-decorators.algo.ts::AbiDecorators.constructor() -> void:
constructor:
// tests/approvals/abi-decorators.algo.ts:4
// export default class AbiDecorators extends Contract {
proto 0 0
// tests/approvals/abi-decorators.algo.ts:16
// globalValue = GlobalState({ initialValue: Uint64(123) })
pushbytes "globalValue"
pushint 123 // 123
app_global_put
retsub


// tests/approvals/abi-decorators.algo.ts::AbiDecorators.__puya_arc4_router__() -> uint64:
__puya_arc4_router__:
main_block@3:
// tests/approvals/abi-decorators.algo.ts:4
// export default class AbiDecorators extends Contract {
proto 0 1
txn NumAppArgs
intc_0 // 0
!=
bz __puya_arc4_router___bare_routing@9
bz main_bare_routing@12

main_abi_routing@4:
// tests/approvals/abi-decorators.algo.ts:4
// export default class AbiDecorators extends Contract {
txna ApplicationArgs 0
pushbytes 0xf9020d5a // method "justNoop()void"
pushbytes 0xe179f9d4 // method "createMethod()void"
pushbytes 0x63c27aba // method "allActions()void"
pushbytes 0x14d1b6ea // method "overrideReadonlyName()uint64"
pushbytes 0xc1367374 // method "methodWithDefaults(uint64,uint64,uint64)uint64"
uncover 5
match __puya_arc4_router___justNoop_route@2 __puya_arc4_router___createMethod_route@3 __puya_arc4_router___allActions_route@4 __puya_arc4_router___overrideReadonlyName_route@5 __puya_arc4_router___methodWithDefaults_route@6
b __puya_arc4_router___switch_case_default@7
match main_justNoop_route@5 main_createMethod_route@6 main_allActions_route@7 main_overrideReadonlyName_route@8 main_methodWithDefaults_route@9

__puya_arc4_router___justNoop_route@2:
// tests/approvals/abi-decorators.algo.ts:5
// @abimethod({ allowActions: 'NoOp' })
main_switch_case_default@10:

main_switch_case_next@11:

main_after_if_else@13:
// tests/approvals/abi-decorators.algo.ts:4
// export default class AbiDecorators extends Contract {
intc_0 // 0

main_after_inlined_tests/approvals/abi-decorators.algo.ts::AbiDecorators.__puya_arc4_router__@14:
return

main_methodWithDefaults_route@9:
// tests/approvals/abi-decorators.algo.ts:18
// @abimethod({ defaultArguments: { a: { from: 'globalValue' }, b: { from: 'readonly' }, c: { constant: 145 } } })
txn OnCompletion
intc_0 // NoOp
==
Expand All @@ -55,26 +56,49 @@ __puya_arc4_router___justNoop_route@2:
intc_0 // 0
!=
assert // can only call when not creating
callsub justNoop
// tests/approvals/abi-decorators.algo.ts:4
// export default class AbiDecorators extends Contract {
txna ApplicationArgs 1
btoi
txna ApplicationArgs 2
btoi
txna ApplicationArgs 3
btoi
// tests/approvals/abi-decorators.algo.ts:18
// @abimethod({ defaultArguments: { a: { from: 'globalValue' }, b: { from: 'readonly' }, c: { constant: 145 } } })
uncover 2
uncover 2
uncover 2
callsub methodWithDefaults
itob
bytec_0 // 0x151f7c75
swap
concat
log
intc_1 // 1
retsub
b main_after_inlined_tests/approvals/abi-decorators.algo.ts::AbiDecorators.__puya_arc4_router__@14

__puya_arc4_router___createMethod_route@3:
// tests/approvals/abi-decorators.algo.ts:7
// @abimethod({ onCreate: 'require' })
main_overrideReadonlyName_route@8:
// tests/approvals/abi-decorators.algo.ts:11
// @abimethod({ readonly: true, name: 'overrideReadonlyName' })
txn OnCompletion
intc_0 // NoOp
==
assert // OnCompletion is not NoOp
txn ApplicationID
intc_0 // 0
==
assert // can only call when creating
callsub createMethod
!=
assert // can only call when not creating
callsub readonly
itob
bytec_0 // 0x151f7c75
swap
concat
log
intc_1 // 1
retsub
b main_after_inlined_tests/approvals/abi-decorators.algo.ts::AbiDecorators.__puya_arc4_router__@14

__puya_arc4_router___allActions_route@4:
main_allActions_route@7:
// tests/approvals/abi-decorators.algo.ts:9
// @abimethod({ allowActions: ['NoOp', 'OptIn', 'CloseOut', 'DeleteApplication', 'UpdateApplication'] })
txn ApplicationID
Expand All @@ -83,31 +107,26 @@ __puya_arc4_router___allActions_route@4:
assert // can only call when not creating
callsub allActions
intc_1 // 1
retsub
b main_after_inlined_tests/approvals/abi-decorators.algo.ts::AbiDecorators.__puya_arc4_router__@14

__puya_arc4_router___overrideReadonlyName_route@5:
// tests/approvals/abi-decorators.algo.ts:11
// @abimethod({ readonly: true, name: 'overrideReadonlyName' })
main_createMethod_route@6:
// tests/approvals/abi-decorators.algo.ts:7
// @abimethod({ onCreate: 'require' })
txn OnCompletion
intc_0 // NoOp
==
assert // OnCompletion is not NoOp
txn ApplicationID
intc_0 // 0
!=
assert // can only call when not creating
callsub readonly
itob
bytec_0 // 0x151f7c75
swap
concat
log
==
assert // can only call when creating
callsub createMethod
intc_1 // 1
retsub
b main_after_inlined_tests/approvals/abi-decorators.algo.ts::AbiDecorators.__puya_arc4_router__@14

__puya_arc4_router___methodWithDefaults_route@6:
// tests/approvals/abi-decorators.algo.ts:18
// @abimethod({ defaultArguments: { a: { from: 'globalValue' }, b: { from: 'readonly' }, c: { constant: 145 } } })
main_justNoop_route@5:
// tests/approvals/abi-decorators.algo.ts:5
// @abimethod({ allowActions: 'NoOp' })
txn OnCompletion
intc_0 // NoOp
==
Expand All @@ -116,37 +135,24 @@ __puya_arc4_router___methodWithDefaults_route@6:
intc_0 // 0
!=
assert // can only call when not creating
// tests/approvals/abi-decorators.algo.ts:4
// export default class AbiDecorators extends Contract {
txna ApplicationArgs 1
btoi
txna ApplicationArgs 2
btoi
txna ApplicationArgs 3
btoi
// tests/approvals/abi-decorators.algo.ts:18
// @abimethod({ defaultArguments: { a: { from: 'globalValue' }, b: { from: 'readonly' }, c: { constant: 145 } } })
uncover 2
uncover 2
uncover 2
callsub methodWithDefaults
itob
bytec_0 // 0x151f7c75
swap
concat
log
callsub justNoop
intc_1 // 1
retsub
b main_after_inlined_tests/approvals/abi-decorators.algo.ts::AbiDecorators.__puya_arc4_router__@14

__puya_arc4_router___switch_case_default@7:
b __puya_arc4_router___after_if_else@10
main_bare_routing@12:
b main_after_if_else@13

__puya_arc4_router___bare_routing@9:

__puya_arc4_router___after_if_else@10:
// tests/approvals/abi-decorators.algo.ts::AbiDecorators.constructor() -> void:
constructor:
// tests/approvals/abi-decorators.algo.ts:4
// export default class AbiDecorators extends Contract {
intc_0 // 0
proto 0 0
// tests/approvals/abi-decorators.algo.ts:16
// globalValue = GlobalState({ initialValue: Uint64(123) })
pushbytes "globalValue"
pushint 123 // 123
app_global_put
retsub


Expand Down
4 changes: 2 additions & 2 deletions tests/approvals/out/abi-decorators/AbiDecorators.arc32.json

Large diffs are not rendered by default.

34 changes: 23 additions & 11 deletions tests/approvals/out/abi-decorators/AbiDecorators.arc56.json

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion tests/approvals/out/abi-decorators/AbiDecorators.clear.teal
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma version 10
#pragma typetrack false

tests/approvals/abi-decorators.algo.ts::AbiDecorators.clearStateProgram:
// @algorandfoundation/algorand-typescript/base-contract.d.ts::BaseContract.clearStateProgram() -> uint64:
main:
pushint 1 // 1
return
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
main @algorandfoundation/algorand-typescript/arc4/index.d.ts::Contract.approvalProgram:
block@0: // L1
let reinterpret_bool%0#0: bool = (txn ApplicationID)
goto reinterpret_bool%0#0 ? block@2 : block@1
block@1: // if_body_L1
tests/approvals/abi-decorators.algo.ts::AbiDecorators.constructor()
goto block@2
block@2: // after_if_else_L1
let tmp%0#0: bool = tests/approvals/abi-decorators.algo.ts::AbiDecorators.__puya_arc4_router__()
return tmp%0#0

subroutine tests/approvals/abi-decorators.algo.ts::AbiDecorators.constructor() -> void:
block@0: // L4
(app_global_put "globalValue" 123u)
return

subroutine tests/approvals/abi-decorators.algo.ts::AbiDecorators.__puya_arc4_router__() -> bool:
block@0: // L4
let tmp%0#0: uint64 = (txn NumAppArgs)
let tmp%1#0: bool = (!= tmp%0#0 0u)
goto tmp%1#0 ? block@1 : block@9
block@1: // abi_routing_L4
let tmp%2#0: bytes = (txna ApplicationArgs 0)
switch tmp%2#0 {method "justNoop()void" => block@2, method "createMethod()void" => block@3, method "allActions()void" => block@4, method "overrideReadonlyName()uint64" => block@5, method "methodWithDefaults(uint64,uint64,uint64)uint64" => block@6, * => block@7}
block@2: // justNoop_route_L5
let tmp%3#0: uint64 = (txn OnCompletion)
let tmp%4#0: bool = (== tmp%3#0 NoOp)
(assert tmp%4#0) // OnCompletion is not NoOp
let tmp%5#0: uint64 = (txn ApplicationID)
let tmp%6#0: bool = (!= tmp%5#0 0u)
(assert tmp%6#0) // can only call when not creating
tests/approvals/abi-decorators.algo.ts::AbiDecorators.justNoop()
return 1u
block@3: // createMethod_route_L7
let tmp%7#0: uint64 = (txn OnCompletion)
let tmp%8#0: bool = (== tmp%7#0 NoOp)
(assert tmp%8#0) // OnCompletion is not NoOp
let tmp%9#0: uint64 = (txn ApplicationID)
let tmp%10#0: bool = (== tmp%9#0 0u)
(assert tmp%10#0) // can only call when creating
tests/approvals/abi-decorators.algo.ts::AbiDecorators.createMethod()
return 1u
block@4: // allActions_route_L9
let tmp%11#0: uint64 = (txn ApplicationID)
let tmp%12#0: bool = (!= tmp%11#0 0u)
(assert tmp%12#0) // can only call when not creating
tests/approvals/abi-decorators.algo.ts::AbiDecorators.allActions()
return 1u
block@5: // overrideReadonlyName_route_L11
let tmp%13#0: uint64 = (txn OnCompletion)
let tmp%14#0: bool = (== tmp%13#0 NoOp)
(assert tmp%14#0) // OnCompletion is not NoOp
let tmp%15#0: uint64 = (txn ApplicationID)
let tmp%16#0: bool = (!= tmp%15#0 0u)
(assert tmp%16#0) // can only call when not creating
let to_encode%0#0: uint64 = tests/approvals/abi-decorators.algo.ts::AbiDecorators.readonly()
let val_as_bytes%0#0: bytes = (itob to_encode%0#0)
let tmp%17#0: bytes = (concat 0x151f7c75 val_as_bytes%0#0)
(log tmp%17#0)
return 1u
block@6: // methodWithDefaults_route_L18
let tmp%18#0: uint64 = (txn OnCompletion)
let tmp%19#0: bool = (== tmp%18#0 NoOp)
(assert tmp%19#0) // OnCompletion is not NoOp
let tmp%20#0: uint64 = (txn ApplicationID)
let tmp%21#0: bool = (!= tmp%20#0 0u)
(assert tmp%21#0) // can only call when not creating
let tmp%22#0: bytes = (txna ApplicationArgs 1)
let tmp%23#0: uint64 = (btoi tmp%22#0)
let tmp%24#0: bytes = (txna ApplicationArgs 2)
let tmp%25#0: uint64 = (btoi tmp%24#0)
let tmp%26#0: bytes = (txna ApplicationArgs 3)
let tmp%27#0: uint64 = (btoi tmp%26#0)
let to_encode%1#0: uint64 = tests/approvals/abi-decorators.algo.ts::AbiDecorators.methodWithDefaults(tmp%23#0, tmp%25#0, tmp%27#0)
let val_as_bytes%1#0: bytes = (itob to_encode%1#0)
let tmp%28#0: bytes = (concat 0x151f7c75 val_as_bytes%1#0)
(log tmp%28#0)
return 1u
block@7: // switch_case_default_L4
goto block@8
block@8: // switch_case_next_L4
goto block@10
block@9: // bare_routing_L4
goto block@10
block@10: // after_if_else_L4
return 0u

subroutine tests/approvals/abi-decorators.algo.ts::AbiDecorators.justNoop() -> void:
block@0: // L5
return

subroutine tests/approvals/abi-decorators.algo.ts::AbiDecorators.createMethod() -> void:
block@0: // L7
return

subroutine tests/approvals/abi-decorators.algo.ts::AbiDecorators.allActions() -> void:
block@0: // L9
return

subroutine tests/approvals/abi-decorators.algo.ts::AbiDecorators.readonly() -> uint64:
block@0: // L11
return 5u

subroutine tests/approvals/abi-decorators.algo.ts::AbiDecorators.methodWithDefaults(a: uint64, b: uint64, c: uint64) -> uint64:
block@0: // L18
let tmp%0#0: uint64 = (* a#0 b#0)
let tmp%1#0: uint64 = (+ tmp%0#0 c#0)
return tmp%1#0
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
main @algorandfoundation/algorand-typescript/base-contract.d.ts::BaseContract.clearStateProgram:
block@0: // L1
return 1u
Loading

0 comments on commit d50a541

Please sign in to comment.