-
Notifications
You must be signed in to change notification settings - Fork 132
Pass-by-Ref / Dynamic Scratch Variables via the loads and stores opcodes
#198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
87 commits
Select commit
Hold shift + click to select a range
ca75dbf
Fresh Start: Dynamic Scratch Variables
21ea026
TDD. Stuck at dynamic_scratch.py: line 58
ccd3a8b
Next, get past dynamic_scratch.py: line 66 - need an index()
91e10e4
compiler doesn't recognize DynamicSlot - and it shouldn't have to
26ce3af
fixed load but store still reaches compiler
b395734
pass the TDD and even a more ambitions dynamic_scratch_2 case
becd971
fix incorrect comment, and make the wilt comment into a real test
c1aaa45
pass mypy... but did we cast too much?
8e9659e
more assertive and precise type casting
126ac76
new e2e circle test
1159ba6
ready for review... but it's also time for unit tests
0e5bccc
fix test logic error, plus better comments in wilt TEAL
a0a351d
unnecessary todo - given successful e2e tests
e6b9f0b
TDD: Only type Expr is allowed - so need to expand the subroutine par…
c35f017
got through a couple more exceptions hurdles
1d365f3
almost ready to load the scratchvar's
e94e9cd
commit before selectively rolling back
07a98e0
a bunch of comments
4fa0bfd
final touches before pause
968b9b2
good place to commit - working... but need to refactor
ca22c63
cleanup
097a2ac
add logcat test, remove stale tests, and hopefully pass on circle
8bff58b
ready to refactor
a7ac275
rip out before clean up
8f162c5
cleanup
6fa17cb
cleanup
004b5f5
cleanup
4c92425
cleaunp
40f473b
Merge branch 'master' of github.com:algorand/pyteal into pass-by-ref
40f818e
merge head add in missing and re-alphabetize imports
285980d
revert
8e52b60
revert
6eca022
pass unit tests locally
f67947a
mypy
992d7dd
comments
3c14bc4
better comment
1c6916d
better wording
eb33cfe
grammar
f3bcc6b
remove mistakenly included file
48adcae
better workding
92d0b93
wording
34cf121
wording
ecb2cc8
remove empty line
ba92401
dedupe bad merge in init's
1efbae8
per CR comments
9bc3539
pass the compiler options thru so can be backwards compatible with ne…
988ef0f
mypy
c0eb0fd
unit test_scratch_index()
80ee8d6
dynamicScratchvar unit tests with closer adherance to ScratchVar's API
6e69735
mypy
f4e16e7
maybe pylance has a bug. Remove Bytes anyway
cceca7a
bump up mypy to 0.931
5584158
ahh Bytes missing from .pyi
c829fa2
unit tests for storing/loading via an index_expression
d2ec80c
unit tests for dynamic scratchvar load/store
8444dbd
typo
42200ab
allow skipping new version in tests
daa4cf6
mid-refactor, lets run against Circle
8fa2d4a
per cr catch: better assumption about argument types with a new e2e c…
07c9431
more leniency on annotations
5ecf72e
mypy
49b1284
try on circle
9068277
mypy
f5221db
get rid of options that I had added
35bb603
remove comments
61055b7
remove comments
0f0ab39
remove comments
51cd869
remove comments
05e774b
Make DynamicScratchVar a subclass of ScratchVar and ensure with a tes…
9555455
make the invalid subroutine definition tests pass in python 3.6 also
57013d9
assert no setting index to a dynamic scratchvar
6335d6d
Update pyteal/ast/scratchvar.py
tzaffi 87d8644
Per CR comments - make the expected teal's in e2e tests valid TEAL
4b707b5
per CR comments
70e08c8
per CR suggestions: disallow Expr subtypes as subroutine return annot…
9962651
Per CR suggestions: tightening up SubroutineDefinition annotation typ…
9291792
sort and uniquify output of generate_init
cc3fffc
Merge remote-tracking branch 'origin/master' into pass-by-ref
74e05b3
revert ast/__init__.py's __all__
cfd5ce5
per CR suggestions: better validation and __str__() for ScratchLoad/S…
0d40db1
per CR comments: clearer tests
4f39f5b
per CR suggestion: tighter Dynamic/ScratchVar class hierarchy
69a50e6
revert
d982a3f
space
8680b48
Update pyteal/ast/subroutine_test.py
tzaffi cb34355
per CR comment: abort when dupe imports dectected
1749738
Refactor SubroutineDefinition parameter validation into method with e…
michaeldiamant File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -17,156 +17,158 @@ from .errors import TealInternalError, TealTypeError, TealInputError, TealCompil | |
| from .config import MAX_GROUP_SIZE, NUM_SLOTS | ||
|
|
||
| __all__ = [ | ||
| "Expr", | ||
| "LeafExpr", | ||
| "AccountParam", | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This file changed mostly as a result of getting the generator to sort and uniquify |
||
| "Add", | ||
| "Addr", | ||
| "Bytes", | ||
| "Int", | ||
| "EnumInt", | ||
| "MethodSignature", | ||
| "Arg", | ||
| "TxnType", | ||
| "TxnField", | ||
| "TxnExpr", | ||
| "TxnaExpr", | ||
| "TxnArray", | ||
| "TxnObject", | ||
| "Txn", | ||
| "GtxnExpr", | ||
| "GtxnaExpr", | ||
| "TxnGroup", | ||
| "Gtxn", | ||
| "GeneratedID", | ||
| "ImportScratchValue", | ||
| "Global", | ||
| "GlobalField", | ||
| "And", | ||
| "App", | ||
| "AppField", | ||
| "OnComplete", | ||
| "AppParam", | ||
| "Approve", | ||
| "Arg", | ||
| "Array", | ||
| "Assert", | ||
| "AssetHolding", | ||
| "AssetParam", | ||
| "AccountParam", | ||
| "InnerTxnBuilder", | ||
| "InnerTxn", | ||
| "InnerTxnAction", | ||
| "Gitxn", | ||
| "GitxnExpr", | ||
| "GitxnaExpr", | ||
| "InnerTxnGroup", | ||
| "Array", | ||
| "Tmpl", | ||
| "Nonce", | ||
| "UnaryExpr", | ||
| "Btoi", | ||
| "Itob", | ||
| "Len", | ||
| "BitLen", | ||
| "Sha256", | ||
| "Sha512_256", | ||
| "Keccak256", | ||
| "Not", | ||
| "BitwiseNot", | ||
| "Sqrt", | ||
| "Pop", | ||
| "Balance", | ||
| "MinBalance", | ||
| "BinaryExpr", | ||
| "Add", | ||
| "Minus", | ||
| "Mul", | ||
| "Div", | ||
| "Mod", | ||
| "Exp", | ||
| "Divw", | ||
| "BitLen", | ||
| "BitwiseAnd", | ||
| "BitwiseNot", | ||
| "BitwiseOr", | ||
| "BitwiseXor", | ||
| "ShiftLeft", | ||
| "ShiftRight", | ||
| "Eq", | ||
| "Neq", | ||
| "Lt", | ||
| "Le", | ||
| "Gt", | ||
| "Ge", | ||
| "GetBit", | ||
| "GetByte", | ||
| "Ed25519Verify", | ||
| "Substring", | ||
| "Extract", | ||
| "Suffix", | ||
| "SetBit", | ||
| "SetByte", | ||
| "NaryExpr", | ||
| "And", | ||
| "Or", | ||
| "Concat", | ||
| "WideRatio", | ||
| "If", | ||
| "Cond", | ||
| "Seq", | ||
| "Assert", | ||
| "Err", | ||
| "Return", | ||
| "Approve", | ||
| "Reject", | ||
| "Subroutine", | ||
| "SubroutineDefinition", | ||
| "SubroutineDeclaration", | ||
| "SubroutineCall", | ||
| "SubroutineFnWrapper", | ||
| "ScratchSlot", | ||
| "ScratchLoad", | ||
| "ScratchStore", | ||
| "ScratchStackStore", | ||
| "ScratchVar", | ||
| "MaybeValue", | ||
| "MultiValue", | ||
| "Break", | ||
| "Btoi", | ||
| "Bytes", | ||
| "BytesAdd", | ||
| "BytesMinus", | ||
| "BytesDiv", | ||
| "BytesMul", | ||
| "BytesMod", | ||
| "BytesAnd", | ||
| "BytesOr", | ||
| "BytesXor", | ||
| "BytesDiv", | ||
| "BytesEq", | ||
| "BytesNeq", | ||
| "BytesLt", | ||
| "BytesLe", | ||
| "BytesGt", | ||
| "BytesGe", | ||
| "BytesGt", | ||
| "BytesLe", | ||
| "BytesLt", | ||
| "BytesMinus", | ||
| "BytesMod", | ||
| "BytesMul", | ||
| "BytesNeq", | ||
| "BytesNot", | ||
| "BytesOr", | ||
| "BytesSqrt", | ||
| "BytesXor", | ||
| "BytesZero", | ||
| "CompileOptions", | ||
| "Concat", | ||
| "Cond", | ||
| "Continue", | ||
| "DEFAULT_TEAL_VERSION", | ||
| "Div", | ||
| "Divw", | ||
| "DynamicScratchVar", | ||
| "Ed25519Verify", | ||
| "EnumInt", | ||
| "Eq", | ||
| "Err", | ||
| "Exp", | ||
| "Expr", | ||
| "Extract", | ||
| "ExtractUint16", | ||
| "ExtractUint32", | ||
| "ExtractUint64", | ||
| "Log", | ||
| "While", | ||
| "For", | ||
| "Break", | ||
| "Continue", | ||
| "Op", | ||
| "Ge", | ||
| "GeneratedID", | ||
| "GetBit", | ||
| "GetByte", | ||
| "Gitxn", | ||
| "GitxnExpr", | ||
| "GitxnaExpr", | ||
| "Global", | ||
| "GlobalField", | ||
| "Gt", | ||
| "Gtxn", | ||
| "GtxnExpr", | ||
| "GtxnaExpr", | ||
| "If", | ||
| "ImportScratchValue", | ||
| "InnerTxn", | ||
| "InnerTxnAction", | ||
| "InnerTxnBuilder", | ||
| "InnerTxnGroup", | ||
| "Int", | ||
| "Itob", | ||
| "Keccak256", | ||
| "LabelReference", | ||
| "Le", | ||
| "LeafExpr", | ||
| "Len", | ||
| "Log", | ||
| "Lt", | ||
| "MAX_GROUP_SIZE", | ||
| "MAX_TEAL_VERSION", | ||
| "MIN_TEAL_VERSION", | ||
| "MaybeValue", | ||
| "MethodSignature", | ||
| "MinBalance", | ||
| "Minus", | ||
| "Mod", | ||
| "Mode", | ||
| "Mul", | ||
| "MultiValue", | ||
| "NUM_SLOTS", | ||
| "NaryExpr", | ||
| "Neq", | ||
| "Nonce", | ||
| "Not", | ||
| "OnComplete", | ||
| "Op", | ||
| "Or", | ||
| "Pop", | ||
| "Reject", | ||
| "Return", | ||
| "ScratchIndex", | ||
| "ScratchLoad", | ||
| "ScratchSlot", | ||
| "ScratchStackStore", | ||
| "ScratchStore", | ||
| "ScratchVar", | ||
| "Seq", | ||
| "SetBit", | ||
| "SetByte", | ||
| "Sha256", | ||
| "Sha512_256", | ||
| "ShiftLeft", | ||
| "ShiftRight", | ||
| "Sqrt", | ||
| "Subroutine", | ||
| "SubroutineCall", | ||
| "SubroutineDeclaration", | ||
| "SubroutineDefinition", | ||
| "SubroutineFnWrapper", | ||
| "Substring", | ||
| "Suffix", | ||
| "TealBlock", | ||
| "TealCompileError", | ||
| "TealComponent", | ||
| "TealOp", | ||
| "TealConditionalBlock", | ||
| "TealInputError", | ||
| "TealInternalError", | ||
| "TealLabel", | ||
| "TealBlock", | ||
| "TealOp", | ||
| "TealSimpleBlock", | ||
| "TealConditionalBlock", | ||
| "LabelReference", | ||
| "MAX_TEAL_VERSION", | ||
| "MIN_TEAL_VERSION", | ||
| "DEFAULT_TEAL_VERSION", | ||
| "CompileOptions", | ||
| "compileTeal", | ||
| "TealType", | ||
| "TealInternalError", | ||
| "TealTypeError", | ||
| "TealInputError", | ||
| "TealCompileError", | ||
| "MAX_GROUP_SIZE", | ||
| "NUM_SLOTS", | ||
| "Tmpl", | ||
| "Txn", | ||
| "TxnArray", | ||
| "TxnExpr", | ||
| "TxnField", | ||
| "TxnGroup", | ||
| "TxnObject", | ||
| "TxnType", | ||
| "TxnaExpr", | ||
| "UnaryExpr", | ||
| "While", | ||
| "WideRatio", | ||
| "compileTeal", | ||
| ] | ||
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.