Skip to content

Commit

Permalink
Merge pull request #69 from algorand-devrel/dev
Browse files Browse the repository at this point in the history
0.24.0 - fix VariableDeclaration callExpression initializer
  • Loading branch information
joe-p authored Jul 7, 2023
2 parents caf1048 + d296e1d commit f251220
Show file tree
Hide file tree
Showing 12 changed files with 50 additions and 28 deletions.
2 changes: 1 addition & 1 deletion examples/arc75/ARC75Client.ts

Large diffs are not rendered by default.

14 changes: 10 additions & 4 deletions examples/arc75/artifacts/ARC75.approval.teal
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,8 @@ abi_route_deleteAppFromWhitelist:
!=
&&
assert
byte 0x; dup
byte 0x
dupn 2
txna ApplicationArgs 4
btoi
txna ApplicationArgs 3
Expand All @@ -402,7 +403,7 @@ abi_route_deleteAppFromWhitelist:
return

deleteAppFromWhitelist:
proto 6 0
proto 7 0

// examples/arc75/arc75.algo.ts:97
// preMBR = this.app.address.minBalance
Expand Down Expand Up @@ -434,8 +435,8 @@ deleteAppFromWhitelist:
concat // concat head and tail
frame_bury -6 // whitelist: Whitelist

// examples/arc75/arc75.algo.ts:102
// assert(spliced[0] === appID)
// examples/arc75/arc75.algo.ts:100
// spliced = this.whitelist.get(whitelist).splice(index, 1)
frame_dig -6 // whitelist: Whitelist
box_get
assert
Expand Down Expand Up @@ -496,6 +497,11 @@ deleteAppFromWhitelist:
pop
swap
box_put
frame_bury -7 // spliced: uint64[]

// examples/arc75/arc75.algo.ts:102
// assert(spliced[0] === appID)
frame_dig -7 // spliced: uint64[]
store 0 // full array
int 0 // initial offset
int 0
Expand Down
2 changes: 1 addition & 1 deletion examples/arc75/artifacts/ARC75.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions examples/arc75/artifacts/ARC75.src_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"arc75.algo.ts"
],
"names": [],
"mappings": ";;;;;;;;;;;;;;;AAOE;AAAA;AAAA;;AAAA;AAAA;AAAA;AAAA;AAAA;;;;AAAA;AAAA;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FM;AAAA;;;AArBlB;AAkB0B;AAAT;AAAS;AAlB1B;;;;;AAqBqC;AAAnB;;;AAfhB;AANF;;;AACiB;AAAS;AAAT;AAvBD;AAXd;AAkDF;AAAA;;;;;;AAjBA;AAqBkB",
"file": "ARC75.approval.teal",
"sourceRoot": ""
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@algorandfoundation/tealscript",
"version": "0.23.0",
"version": "0.24.0",
"description": "Enables Algorand smart contract development with native TypeScript syntax, tooling, and IDE support",
"homepage": "https://github.com/algorand-devrel/TEALScript",
"bugs": {
Expand Down
9 changes: 8 additions & 1 deletion src/lib/compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2506,7 +2506,14 @@ export default class Compiler {
}
}

if (ts.isCallExpression(node.initializer) && isArray) {
if (
ts.isCallExpression(node.initializer)
&& isArray
&& ts.isPropertyAccessExpression(node.initializer.expression)
&& ts.isPropertyAccessExpression(node.initializer.expression.expression)
&& Object.keys(this.storageProps).includes(
node.initializer.expression.expression?.name?.getText(),
)) {
this.frame[name] = {
storageExpression: node.initializer,
type: initializerType,
Expand Down
13 changes: 8 additions & 5 deletions tests/contracts/artifacts/ABITestArraySpliceValue.approval.teal
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ abi_route_arraySpliceValue:
&&
assert
byte 0x
dupn 2
dupn 3
callsub arraySpliceValue
int 1
return

arraySpliceValue:
proto 3 0
proto 4 0

// tests/contracts/abi.algo.ts:442
// a: uint<16>[] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Expand Down Expand Up @@ -72,10 +72,8 @@ arraySpliceValue:
int 7
frame_bury -3 // l: uint64

// tests/contracts/abi.algo.ts:448
// return v;
// tests/contracts/abi.algo.ts:446
// a.splice(i, l)
// v = a.splice(i, l)
frame_dig -1 // a: uint16[]
frame_dig -3 // l: uint64
frame_dig -2 // i: uint64
Expand Down Expand Up @@ -111,6 +109,11 @@ arraySpliceValue:
extract3
swap
frame_bury -1 // a: uint16[]
frame_bury -4 // v: uint16[]

// tests/contracts/abi.algo.ts:448
// return v;
frame_dig -4 // v: uint16[]
dup
len
int 2
Expand Down
2 changes: 1 addition & 1 deletion tests/contracts/artifacts/ABITestArraySpliceValue.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
}
},
"source": {
"approval": "I3ByYWdtYSB2ZXJzaW9uIDgKCWIgbWFpbgoKYWJpX3JvdXRlX2FycmF5U3BsaWNlVmFsdWU6Cgl0eG4gT25Db21wbGV0aW9uCglpbnQgTm9PcAoJPT0KCXR4biBBcHBsaWNhdGlvbklECglpbnQgMAoJIT0KCSYmCglhc3NlcnQKCWJ5dGUgMHgKCWR1cG4gMgoJY2FsbHN1YiBhcnJheVNwbGljZVZhbHVlCglpbnQgMQoJcmV0dXJuCgphcnJheVNwbGljZVZhbHVlOgoJcHJvdG8gMyAwCgoJLy8gdGVzdHMvY29udHJhY3RzL2FiaS5hbGdvLnRzOjQ0MgoJLy8gYTogdWludDwxNj5bXSA9IFsxLCAyLCAzLCA0LCA1LCA2LCA3LCA4LCA5LCAxMF0KCWludCAxCglpdG9iCglleHRyYWN0IDYgMAoJaW50IDIKCWl0b2IKCWV4dHJhY3QgNiAwCgljb25jYXQKCWludCAzCglpdG9iCglleHRyYWN0IDYgMAoJY29uY2F0CglpbnQgNAoJaXRvYgoJZXh0cmFjdCA2IDAKCWNvbmNhdAoJaW50IDUKCWl0b2IKCWV4dHJhY3QgNiAwCgljb25jYXQKCWludCA2CglpdG9iCglleHRyYWN0IDYgMAoJY29uY2F0CglpbnQgNwoJaXRvYgoJZXh0cmFjdCA2IDAKCWNvbmNhdAoJaW50IDgKCWl0b2IKCWV4dHJhY3QgNiAwCgljb25jYXQKCWludCA5CglpdG9iCglleHRyYWN0IDYgMAoJY29uY2F0CglpbnQgMTAKCWl0b2IKCWV4dHJhY3QgNiAwCgljb25jYXQKCWZyYW1lX2J1cnkgLTE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sb2FkIDEzIC8vIHNwbGljZSBieXRlIGxlbmd0aAoJKwoJaW50IDIKCS0KCXN3YXAKCXN1YnN0cmluZzMKCWNvbmNhdAoJZnJhbWVfZGlnIC0xIC8vIGE6IHVpbnQxNltdCglsb2FkIDEyIC8vIHNwbGljZSBzdGFydAoJbG9hZCAxMyAvLyBzcGxpY2UgYnl0ZSBsZW5ndGgKCWludCAyCgktCglleHRyYWN0MwoJc3dhcAoJZnJhbWVfYnVyeSAtMSAvLyBhOiB1aW50MTZbXQoJZnJhbWVfYnVyeSAtNCAvLyB2OiB1aW50MTZbXQoKCS8vIHRlc3RzL2NvbnRyYWN0cy9hYmkuYWxnby50czo0NDgKCS8vIHJldHVybiB2OwoJZnJhbWVfZGlnIC00IC8vIHY6IHVpbnQxNltdCglkdXAKCWxlbgoJaW50IDIKCS8KCWl0b2IKCWV4dHJhY3QgNiAyCglzd2FwCgljb25jYXQKCWJ5dGUgMHgxNTFmN2M3NQoJc3dhcAoJY29uY2F0Cglsb2cKCXJldHN1YgoKbWFpbjoKCXR4biBOdW1BcHBBcmdzCglibnogcm91dGVfYWJpCgoJLy8gZGVmYXVsdCBjcmVhdGVBcHBsaWNhdGlvbgoJdHhuIEFwcGxpY2F0aW9uSUQKCWludCAwCgk9PQoJdHhuIE9uQ29tcGxldGlvbgoJaW50IE5vT3AKCT09CgkmJgoJcmV0dXJuCgpyb3V0ZV9hYmk6CgltZXRob2QgImFycmF5U3BsaWNlVmFsdWUoKXVpbnQxNltdIgoJdHhuYSBBcHBsaWNhdGlvbkFyZ3MgMAoJbWF0Y2ggYWJpX3JvdXRlX2FycmF5U3BsaWNlVmFsdWUKCWVycg==",
"clear": "I3ByYWdtYSB2ZXJzaW9uIDgKaW50IDEKcmV0dXJu"
},
"contract": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ abi_route_spliceFirstElementValue:
!=
&&
assert
byte 0x
byte 0x; dup
callsub spliceFirstElementValue
int 1
return

spliceFirstElementValue:
proto 1 0
proto 2 0

// tests/contracts/abi.algo.ts:493
// a: uint<16>[] = [1, 2, 3]
Expand All @@ -33,10 +33,8 @@ spliceFirstElementValue:
concat
frame_bury -1 // a: uint16[]

// tests/contracts/abi.algo.ts:497
// return v;
// tests/contracts/abi.algo.ts:495
// a.splice(0, 1)
// v = a.splice(0, 1)
frame_dig -1 // a: uint16[]
int 1
int 0
Expand Down Expand Up @@ -72,6 +70,11 @@ spliceFirstElementValue:
extract3
swap
frame_bury -1 // a: uint16[]
frame_bury -2 // v: uint16[]

// tests/contracts/abi.algo.ts:497
// return v;
frame_dig -2 // v: uint16[]
dup
len
int 2
Expand Down
Loading

0 comments on commit f251220

Please sign in to comment.