-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: make
algopy.arc4.Address
immutable
BREAKING CHANGE: modifying an `algopy.arc4.Address` will now raise an error
- Loading branch information
1 parent
9704011
commit ad77f29
Showing
20 changed files
with
59 additions
and
103 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
38 changes: 13 additions & 25 deletions
38
test_cases/arc4_types/out/Arc4AddressContract.approval.mir
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 |
---|---|---|
@@ -1,38 +1,26 @@ | ||
// Op Stack (out) | ||
// Op Stack (out) | ||
// test_cases.arc4_types.address.Arc4AddressContract.approval_program() -> uint64: | ||
main_block@0: | ||
// arc4_types/address.py:8 | ||
// address = arc4.Address(Txn.sender) | ||
txn Sender address#0 | ||
txn Sender address#0 | ||
// arc4_types/address.py:9 | ||
// assert address == Txn.sender | ||
txn Sender address#0,tmp%0#0 | ||
l-load-copy address#0 1 address#0,tmp%0#0,address#0 (copy) | ||
l-load tmp%0#0 1 address#0,address#0 (copy),tmp%0#0 | ||
== address#0,tmp%1#0 | ||
assert address#0 | ||
txn Sender address#0,tmp%0#0 | ||
l-load-copy address#0 1 address#0,tmp%0#0,address#0 (copy) | ||
l-load tmp%0#0 1 address#0,address#0 (copy),tmp%0#0 | ||
== address#0,tmp%1#0 | ||
assert address#0 | ||
// arc4_types/address.py:11 | ||
// assert address.native == Txn.sender | ||
txn Sender address#0,tmp%3#0 | ||
l-load address#0 1 tmp%3#0,address#0 | ||
l-load tmp%3#0 1 address#0,tmp%3#0 | ||
== tmp%4#0 | ||
txn Sender address#0,tmp%3#0 | ||
l-load address#0 1 tmp%3#0,address#0 | ||
l-load tmp%3#0 1 address#0,tmp%3#0 | ||
== tmp%4#0 | ||
assert | ||
// arc4_types/address.py:16 | ||
// some_address = arc4.Address(SOME_ADDRESS) | ||
addr "VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA" Address(VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA) | ||
// arc4_types/address.py:19 | ||
// some_address[0] = arc4.Byte(123) | ||
byte 0x7b Address(VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA),0x7b | ||
replace2 0 some_address#1 | ||
// arc4_types/address.py:20 | ||
// assert some_address != SOME_ADDRESS | ||
addr "VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA" some_address#1,Address(VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA) | ||
!= tmp%10#0 | ||
assert | ||
// arc4_types/address.py:21 | ||
// arc4_types/address.py:22 | ||
// return True | ||
int 1 1 | ||
int 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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#pragma version 10 | ||
|
||
test_cases.arc4_types.address.Arc4AddressContract.clear_state_program: | ||
// arc4_types/address.py:24 | ||
// arc4_types/address.py:25 | ||
// return True | ||
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
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
7 changes: 0 additions & 7 deletions
7
test_cases/arc4_types/out_O2/Arc4AddressContract.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 |
---|---|---|
@@ -1,19 +1,12 @@ | ||
#pragma version 10 | ||
|
||
test_cases.arc4_types.address.Arc4AddressContract.approval_program: | ||
bytecblock base32(VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJPQ) | ||
txn Sender | ||
dupn 2 | ||
== | ||
assert | ||
txn Sender | ||
== | ||
assert | ||
bytec_0 // addr VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA | ||
pushbytes 0x7b | ||
replace2 0 | ||
bytec_0 // addr VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA | ||
!= | ||
assert | ||
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
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
2 changes: 1 addition & 1 deletion
2
test_cases/arc4_types/out_unoptimized/Arc4AddressContract.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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#pragma version 10 | ||
|
||
test_cases.arc4_types.address.Arc4AddressContract.clear_state_program: | ||
// arc4_types/address.py:24 | ||
// arc4_types/address.py:25 | ||
// return True | ||
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
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 |
---|---|---|
|
@@ -982,8 +982,8 @@ debug: Sealing block@3: // after_if_else_L6 | |
debug: Terminated block@3: // after_if_else_L6 | ||
debug: Sealing block@0: // L7 | ||
debug: Terminated block@0: // L7 | ||
debug: Sealing block@0: // L23 | ||
debug: Terminated block@0: // L23 | ||
debug: Sealing block@0: // L24 | ||
debug: Terminated block@0: // L24 | ||
debug: Sealing block@0: // L6 | ||
debug: Terminated block@0: // L6 | ||
debug: Sealing block@1: // abi_routing_L6 | ||
|
@@ -18665,19 +18665,17 @@ debug: Optimizer: Constant Replacer | |
debug: Optimizer: Copy Propagation | ||
debug: Found equivalence set: awst_tmp%0#0, zero_address#0 | ||
debug: Replacing {awst_tmp%0#0} with zero_address#0 made 2 modifications | ||
debug: Found equivalence set: updated_target%0#0, some_address#1 | ||
debug: Replacing {updated_target%0#0} with some_address#1 made 1 modifications | ||
debug: Optimizer: Intrinsic Simplifier | ||
debug: Simplified (== 32u 32u) to 1u | ||
debug: Simplified (len zero_address#0) to 32u | ||
debug: Simplified (== zero_address#0 tmp%7#0) to 1u | ||
debug: Simplified (== addr VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA addr VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA) to 1u | ||
debug: Simplified (replace3 addr VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA 0u 0x7b) to ((replace2 0) addr VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA 0x7b) | ||
debug: Simplified (== addr VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA addr VCMJKWOY5P5P7SKMZFFOCEROPJCZOTIJMNIYNUCKH7LRO45JMJP6UYBIJA) to 1u | ||
debug: Optimizer: Remove Unused Variables | ||
debug: Removing unused variable zero_address#0 | ||
debug: Removing unused variable tmp%7#0 | ||
debug: Removing unused variable some_address#0 | ||
debug: Removing unused variable assigned_value%0#0 | ||
debug: Removing unused variable address_copy#0 | ||
debug: Optimizer: Inner Txn Field Replacer | ||
debug: Optimizer: Replace Compiled References | ||
debug: Optimizer: Simplify Control Ops | ||
|
@@ -18712,6 +18710,7 @@ debug: Removing unused variable tmp%2#0 | |
debug: Removing unused variable tmp%5#0 | ||
debug: Removing unused variable tmp%8#0 | ||
debug: Removing unused variable tmp%9#0 | ||
debug: Removing unused variable tmp%10#0 | ||
debug: Optimizer: Inner Txn Field Replacer | ||
debug: Optimizer: Replace Compiled References | ||
debug: Optimizer: Simplify Control Ops | ||
|
@@ -18805,10 +18804,6 @@ debug: Inserted [email protected][7]: 'l-store-copy tmp%1#0 0' | |
debug: Replaced [email protected][9]: 'v-load tmp%1#0' with 'l-load tmp%1#0' | ||
debug: Inserted [email protected][16]: 'l-store-copy tmp%4#0 0' | ||
debug: Replaced [email protected][18]: 'v-load tmp%4#0' with 'l-load tmp%4#0' | ||
debug: Inserted [email protected][23]: 'l-store-copy some_address#1 0' | ||
debug: Replaced [email protected][25]: 'v-load some_address#1' with 'l-load some_address#1' | ||
debug: Inserted [email protected][28]: 'l-store-copy tmp%10#0 0' | ||
debug: Replaced [email protected][30]: 'v-load tmp%10#0' with 'l-load tmp%10#0' | ||
debug: Inserted [email protected][3]: 'l-store-copy tmp%0#0 0' | ||
debug: Replaced [email protected][6]: 'v-load tmp%0#0' with 'l-load tmp%0#0' | ||
debug: Inserted [email protected][13]: 'l-store-copy tmp%3#0 0' | ||
|
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