Skip to content

Commit

Permalink
fix: Issue with box value proxy not proxying all members through to p…
Browse files Browse the repository at this point in the history
…roxied builder
  • Loading branch information
tristanmenzel committed Dec 10, 2024
1 parent 85a25b3 commit 59fea44
Show file tree
Hide file tree
Showing 11 changed files with 2,225 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"dev:examples": "tsx src/cli.ts build examples --output-awst --output-awst-json",
"dev:approvals": "rimraf tests/approvals/out && tsx src/cli.ts build tests/approvals --dry-run",
"dev:expected-output": "tsx src/cli.ts build tests/expected-output --dry-run",
"dev:testing": "tsx src/cli.ts build tests/approvals/box-proxies.algo.ts --output-awst --output-awst-json --output-ssa-ir --log-level=info --out-dir out/[name] --optimization-level=0",
"dev:testing": "tsx src/cli.ts build tests/approvals/box-enum-contract.algo.ts --output-awst --output-awst-json --output-ssa-ir --log-level=info --out-dir out/[name] --optimization-level=0",
"audit": "better-npm-audit audit",
"format": "prettier --write .",
"lint": "eslint \"src/**/*.ts\"",
Expand Down
25 changes: 22 additions & 3 deletions src/awst_build/eb/storage/value-proxy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import type { Expression } from '../../../awst/nodes'
import type {
AppAccountStateExpression,
AppStateExpression,
Expression,
FieldExpression,
IndexExpression,
TupleExpression,
VarExpression,
} from '../../../awst/nodes'
import type { SourceLocation } from '../../../awst/source-location'
import type { PType } from '../../ptypes'
import type { PType, PTypeOrClass } from '../../ptypes'
import { typeRegistry } from '../../type-registry'
import type { BuilderBinaryOp, BuilderComparisonOp, BuilderUnaryOp, InstanceBuilder, NodeBuilder } from '../index'
import { InstanceExpressionBuilder } from '../index'
Expand All @@ -10,6 +18,12 @@ export abstract class ValueProxy<TPType extends PType> extends InstanceExpressio
return typeRegistry.getInstanceEb(this._expr, this.ptype)
}

resolve(): Expression {
return this.proxied.resolve()
}
resolveLValue(): VarExpression | FieldExpression | IndexExpression | TupleExpression | AppStateExpression | AppAccountStateExpression {
return this.proxied.resolveLValue()
}
memberAccess(name: string, sourceLocation: SourceLocation): NodeBuilder {
return this.proxied.memberAccess(name, sourceLocation)
}
Expand All @@ -34,7 +48,6 @@ export abstract class ValueProxy<TPType extends PType> extends InstanceExpressio
postfixUnaryOp(op: BuilderUnaryOp, sourceLocation: SourceLocation): InstanceBuilder {
return this.proxied.postfixUnaryOp(op, sourceLocation)
}

call(args: ReadonlyArray<NodeBuilder>, typeArgs: ReadonlyArray<PType>, sourceLocation: SourceLocation): NodeBuilder {
return this.proxied.call(args, typeArgs, sourceLocation)
}
Expand All @@ -53,4 +66,10 @@ export abstract class ValueProxy<TPType extends PType> extends InstanceExpressio
toBytes(sourceLocation: SourceLocation): Expression {
return this.proxied.toBytes(sourceLocation)
}
resolvableToPType(ptype: PTypeOrClass): boolean {
return this.proxied.resolvableToPType(ptype)
}
resolveToPType(ptype: PTypeOrClass): InstanceBuilder {
return this.proxied.resolveToPType(ptype)
}
}
21 changes: 21 additions & 0 deletions tests/approvals/box-enum-contract.algo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { arc4, assert, Box, Bytes, op, TransactionType } from '@algorandfoundation/algorand-typescript'
import { Tuple, UintN64 } from '@algorandfoundation/algorand-typescript/arc4'

export class BoxContract extends arc4.Contract {
oca = Box<arc4.OnCompleteAction>({ key: Bytes('oca') })
txn = Box<TransactionType>({ key: Bytes('txn') })

@arc4.abimethod({ name: 'store_enums' })
public storeEnums(): void {
this.oca.value = arc4.OnCompleteAction.OptIn
this.txn.value = TransactionType.ApplicationCall
}

@arc4.abimethod({ name: 'read_enums' })
public readEnums(): Tuple<[UintN64, UintN64]> {
assert(op.Box.get(Bytes('oca'))[0] === op.itob(this.oca.value))
assert(op.Box.get(Bytes('txn'))[0] === op.itob(this.txn.value))

return new Tuple(new UintN64(this.oca.value), new UintN64(this.txn.value))
}
}
213 changes: 213 additions & 0 deletions tests/approvals/out/box-enum-contract/BoxContract.approval.teal
Original file line number Diff line number Diff line change
@@ -0,0 +1,213 @@
#pragma version 10

tests/approvals/box-enum-contract.algo.ts::BoxContract.approvalProgram:
intcblock 0 1
bytecblock "oca" "txn"
txn ApplicationID
bnz main_after_if_else@2
callsub constructor

main_after_if_else@2:
callsub __puya_arc4_router__
return


// tests/approvals/box-enum-contract.algo.ts::BoxContract.constructor() -> void:
constructor:
// tests/approvals/box-enum-contract.algo.ts:4
// export class BoxContract extends arc4.Contract {
proto 0 0
retsub


// tests/approvals/box-enum-contract.algo.ts::BoxContract.__puya_arc4_router__() -> uint64:
__puya_arc4_router__:
// tests/approvals/box-enum-contract.algo.ts:4
// export class BoxContract extends arc4.Contract {
proto 0 1
txn NumAppArgs
intc_0 // 0
!=
bz __puya_arc4_router___bare_routing@6
txna ApplicationArgs 0
pushbytes 0xf26c6d42 // method "store_enums()void"
pushbytes 0xef186cf7 // method "read_enums()(uint64,uint64)"
uncover 2
match __puya_arc4_router___store_enums_route@2 __puya_arc4_router___read_enums_route@3
b __puya_arc4_router___switch_case_default@4

__puya_arc4_router___store_enums_route@2:
// tests/approvals/box-enum-contract.algo.ts:8
// @arc4.abimethod({ name: 'store_enums' })
txn OnCompletion
intc_0 // NoOp
==
assert // OnCompletion is not NoOp
txn ApplicationID
intc_0 // 0
!=
assert // can only call when not creating
callsub storeEnums
intc_1 // 1
retsub

__puya_arc4_router___read_enums_route@3:
// tests/approvals/box-enum-contract.algo.ts:14
// @arc4.abimethod({ name: 'read_enums' })
txn OnCompletion
intc_0 // NoOp
==
assert // OnCompletion is not NoOp
txn ApplicationID
intc_0 // 0
!=
assert // can only call when not creating
callsub readEnums
pushbytes 0x151f7c75
swap
concat
log
intc_1 // 1
retsub

__puya_arc4_router___switch_case_default@4:
b __puya_arc4_router___after_if_else@10

__puya_arc4_router___bare_routing@6:
// tests/approvals/box-enum-contract.algo.ts:4
// export class BoxContract extends arc4.Contract {
txn OnCompletion
intc_0 // 0
swap
match __puya_arc4_router_____algots__.defaultCreate@7
b __puya_arc4_router___switch_case_default@8

__puya_arc4_router_____algots__.defaultCreate@7:
// tests/approvals/box-enum-contract.algo.ts:4
// export class BoxContract extends arc4.Contract {
txn ApplicationID
intc_0 // 0
==
assert // can only call when creating
callsub __algots__.defaultCreate
intc_1 // 1
retsub

__puya_arc4_router___switch_case_default@8:

__puya_arc4_router___after_if_else@10:
// tests/approvals/box-enum-contract.algo.ts:4
// export class BoxContract extends arc4.Contract {
intc_0 // 0
retsub


// tests/approvals/box-enum-contract.algo.ts::BoxContract.storeEnums() -> void:
storeEnums:
// tests/approvals/box-enum-contract.algo.ts:8-9
// @arc4.abimethod({ name: 'store_enums' })
// public storeEnums(): void {
proto 0 0
// tests/approvals/box-enum-contract.algo.ts:10
// this.oca.value = arc4.OnCompleteAction.OptIn
intc_1 // 1
itob
// tests/approvals/box-enum-contract.algo.ts:5
// oca = Box<arc4.OnCompleteAction>({ key: Bytes('oca') })
bytec_0 // "oca"
// tests/approvals/box-enum-contract.algo.ts:10
// this.oca.value = arc4.OnCompleteAction.OptIn
swap
box_put
// tests/approvals/box-enum-contract.algo.ts:11
// this.txn.value = TransactionType.ApplicationCall
pushint 6 // 6
itob
// tests/approvals/box-enum-contract.algo.ts:6
// txn = Box<TransactionType>({ key: Bytes('txn') })
bytec_1 // "txn"
// tests/approvals/box-enum-contract.algo.ts:11
// this.txn.value = TransactionType.ApplicationCall
swap
box_put
retsub


// tests/approvals/box-enum-contract.algo.ts::BoxContract.readEnums() -> bytes:
readEnums:
// tests/approvals/box-enum-contract.algo.ts:14-15
// @arc4.abimethod({ name: 'read_enums' })
// public readEnums(): Tuple<[UintN64, UintN64]> {
proto 0 1
// tests/approvals/box-enum-contract.algo.ts:16
// assert(op.Box.get(Bytes('oca'))[0] === op.itob(this.oca.value))
bytec_0 // "oca"
box_get
pop
// tests/approvals/box-enum-contract.algo.ts:5
// oca = Box<arc4.OnCompleteAction>({ key: Bytes('oca') })
bytec_0 // "oca"
// tests/approvals/box-enum-contract.algo.ts:16
// assert(op.Box.get(Bytes('oca'))[0] === op.itob(this.oca.value))
box_get
swap
btoi
swap
assert // Box must have value
itob
==
assert
// tests/approvals/box-enum-contract.algo.ts:17
// assert(op.Box.get(Bytes('txn'))[0] === op.itob(this.txn.value))
bytec_1 // "txn"
box_get
pop
// tests/approvals/box-enum-contract.algo.ts:6
// txn = Box<TransactionType>({ key: Bytes('txn') })
bytec_1 // "txn"
// tests/approvals/box-enum-contract.algo.ts:17
// assert(op.Box.get(Bytes('txn'))[0] === op.itob(this.txn.value))
box_get
swap
btoi
swap
assert // Box must have value
itob
==
assert
// tests/approvals/box-enum-contract.algo.ts:5
// oca = Box<arc4.OnCompleteAction>({ key: Bytes('oca') })
bytec_0 // "oca"
// tests/approvals/box-enum-contract.algo.ts:19
// return new Tuple(new UintN64(this.oca.value), new UintN64(this.txn.value))
box_get
swap
btoi
swap
assert // Box must have value
itob
// tests/approvals/box-enum-contract.algo.ts:6
// txn = Box<TransactionType>({ key: Bytes('txn') })
bytec_1 // "txn"
// tests/approvals/box-enum-contract.algo.ts:19
// return new Tuple(new UintN64(this.oca.value), new UintN64(this.txn.value))
box_get
swap
btoi
swap
assert // Box must have value
itob
pushbytes 0x
uncover 2
concat
swap
concat
retsub


// tests/approvals/box-enum-contract.algo.ts::BoxContract.__algots__.defaultCreate() -> void:
__algots__.defaultCreate:
// tests/approvals/box-enum-contract.algo.ts:4
// export class BoxContract extends arc4.Contract {
proto 0 0
retsub
63 changes: 63 additions & 0 deletions tests/approvals/out/box-enum-contract/BoxContract.arc32.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"hints": {
"store_enums()void": {
"call_config": {
"no_op": "CALL"
}
},
"read_enums()(uint64,uint64)": {
"call_config": {
"no_op": "CALL"
}
}
},
"source": {
"approval": "I3ByYWdtYSB2ZXJzaW9uIDEwCgp0ZXN0cy9hcHByb3ZhbHMvYm94LWVudW0tY29udHJhY3QuYWxnby50czo6Qm94Q29udHJhY3QuYXBwcm92YWxQcm9ncmFt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gICBwdXNoYnl0ZXMgMHgKICAgIHVuY292ZXIgMgogICAgY29uY2F0CiAgICBzd2FwCiAgICBjb25jYXQKICAgIHJldHN1YgoKCi8vIHRlc3RzL2FwcHJvdmFscy9ib3gtZW51bS1jb250cmFjdC5hbGdvLnRzOjpCb3hDb250cmFjdC5fX2FsZ290c19fLmRlZmF1bHRDcmVhdGUoKSAtPiB2b2lkOgpfX2FsZ290c19fLmRlZmF1bHRDcmVhdGU6CiAgICAvLyB0ZXN0cy9hcHByb3ZhbHMvYm94LWVudW0tY29udHJhY3QuYWxnby50czo0CiAgICAvLyBleHBvcnQgY2xhc3MgQm94Q29udHJhY3QgZXh0ZW5kcyBhcmM0LkNvbnRyYWN0IHsKICAgIHByb3RvIDAgMAogICAgcmV0c3ViCg==",
"clear": "I3ByYWdtYSB2ZXJzaW9uIDEwCgp0ZXN0cy9hcHByb3ZhbHMvYm94LWVudW0tY29udHJhY3QuYWxnby50czo6Qm94Q29udHJhY3QuY2xlYXJTdGF0ZVByb2dyYW06CiAgICBwdXNoaW50IDEgLy8gMQogICAgcmV0dXJuCg=="
},
"state": {
"global": {
"num_byte_slices": 0,
"num_uints": 0
},
"local": {
"num_byte_slices": 0,
"num_uints": 0
}
},
"schema": {
"global": {
"declared": {},
"reserved": {}
},
"local": {
"declared": {},
"reserved": {}
}
},
"contract": {
"name": "BoxContract",
"methods": [
{
"name": "store_enums",
"args": [],
"readonly": false,
"returns": {
"type": "void"
}
},
{
"name": "read_enums",
"args": [],
"readonly": false,
"returns": {
"type": "(uint64,uint64)"
}
}
],
"networks": {}
},
"bare_call_config": {
"no_op": "CREATE"
}
}
Loading

0 comments on commit 59fea44

Please sign in to comment.