Skip to content

Commit ff8dd95

Browse files
jasonpaulosalgoidurovic
authored andcommitted
Revert "Pass-by-Ref / Dynamic Scratch Variables via the loads and stores opcodes (algorand#198)"
This reverts commit cf95165.
1 parent d3080d0 commit ff8dd95

23 files changed

+183
-1327
lines changed

pyteal/__init__.pyi

Lines changed: 124 additions & 126 deletions
Original file line numberDiff line numberDiff line change
@@ -17,158 +17,156 @@ from .errors import TealInternalError, TealTypeError, TealInputError, TealCompil
1717
from .config import MAX_GROUP_SIZE, NUM_SLOTS
1818

1919
__all__ = [
20-
"AccountParam",
21-
"Add",
20+
"Expr",
21+
"LeafExpr",
2222
"Addr",
23-
"And",
23+
"Bytes",
24+
"Int",
25+
"EnumInt",
26+
"MethodSignature",
27+
"Arg",
28+
"TxnType",
29+
"TxnField",
30+
"TxnExpr",
31+
"TxnaExpr",
32+
"TxnArray",
33+
"TxnObject",
34+
"Txn",
35+
"GtxnExpr",
36+
"GtxnaExpr",
37+
"TxnGroup",
38+
"Gtxn",
39+
"GeneratedID",
40+
"ImportScratchValue",
41+
"Global",
42+
"GlobalField",
2443
"App",
2544
"AppField",
45+
"OnComplete",
2646
"AppParam",
27-
"Approve",
28-
"Arg",
29-
"Array",
30-
"Assert",
3147
"AssetHolding",
3248
"AssetParam",
49+
"AccountParam",
50+
"InnerTxnBuilder",
51+
"InnerTxn",
52+
"InnerTxnAction",
53+
"Gitxn",
54+
"GitxnExpr",
55+
"GitxnaExpr",
56+
"InnerTxnGroup",
57+
"Array",
58+
"Tmpl",
59+
"Nonce",
60+
"UnaryExpr",
61+
"Btoi",
62+
"Itob",
63+
"Len",
64+
"BitLen",
65+
"Sha256",
66+
"Sha512_256",
67+
"Keccak256",
68+
"Not",
69+
"BitwiseNot",
70+
"Sqrt",
71+
"Pop",
3372
"Balance",
73+
"MinBalance",
3474
"BinaryExpr",
35-
"BitLen",
75+
"Add",
76+
"Minus",
77+
"Mul",
78+
"Div",
79+
"Mod",
80+
"Exp",
81+
"Divw",
3682
"BitwiseAnd",
37-
"BitwiseNot",
3883
"BitwiseOr",
3984
"BitwiseXor",
40-
"Break",
41-
"Btoi",
42-
"Bytes",
85+
"ShiftLeft",
86+
"ShiftRight",
87+
"Eq",
88+
"Neq",
89+
"Lt",
90+
"Le",
91+
"Gt",
92+
"Ge",
93+
"GetBit",
94+
"GetByte",
95+
"Ed25519Verify",
96+
"Substring",
97+
"Extract",
98+
"Suffix",
99+
"SetBit",
100+
"SetByte",
101+
"NaryExpr",
102+
"And",
103+
"Or",
104+
"Concat",
105+
"WideRatio",
106+
"If",
107+
"Cond",
108+
"Seq",
109+
"Assert",
110+
"Err",
111+
"Return",
112+
"Approve",
113+
"Reject",
114+
"Subroutine",
115+
"SubroutineDefinition",
116+
"SubroutineDeclaration",
117+
"SubroutineCall",
118+
"SubroutineFnWrapper",
119+
"ScratchSlot",
120+
"ScratchLoad",
121+
"ScratchStore",
122+
"ScratchStackStore",
123+
"ScratchVar",
124+
"MaybeValue",
125+
"MultiValue",
43126
"BytesAdd",
44-
"BytesAnd",
45-
"BytesDiv",
46-
"BytesEq",
47-
"BytesGe",
48-
"BytesGt",
49-
"BytesLe",
50-
"BytesLt",
51127
"BytesMinus",
52-
"BytesMod",
128+
"BytesDiv",
53129
"BytesMul",
130+
"BytesMod",
131+
"BytesAnd",
132+
"BytesOr",
133+
"BytesXor",
134+
"BytesEq",
54135
"BytesNeq",
136+
"BytesLt",
137+
"BytesLe",
138+
"BytesGt",
139+
"BytesGe",
55140
"BytesNot",
56-
"BytesOr",
57141
"BytesSqrt",
58-
"BytesXor",
59142
"BytesZero",
60-
"CompileOptions",
61-
"Concat",
62-
"Cond",
63-
"Continue",
64-
"DEFAULT_TEAL_VERSION",
65-
"Div",
66-
"Divw",
67-
"DynamicScratchVar",
68-
"Ed25519Verify",
69-
"EnumInt",
70-
"Eq",
71-
"Err",
72-
"Exp",
73-
"Expr",
74-
"Extract",
75143
"ExtractUint16",
76144
"ExtractUint32",
77145
"ExtractUint64",
78-
"For",
79-
"Ge",
80-
"GeneratedID",
81-
"GetBit",
82-
"GetByte",
83-
"Gitxn",
84-
"GitxnExpr",
85-
"GitxnaExpr",
86-
"Global",
87-
"GlobalField",
88-
"Gt",
89-
"Gtxn",
90-
"GtxnExpr",
91-
"GtxnaExpr",
92-
"If",
93-
"ImportScratchValue",
94-
"InnerTxn",
95-
"InnerTxnAction",
96-
"InnerTxnBuilder",
97-
"InnerTxnGroup",
98-
"Int",
99-
"Itob",
100-
"Keccak256",
101-
"LabelReference",
102-
"Le",
103-
"LeafExpr",
104-
"Len",
105146
"Log",
106-
"Lt",
107-
"MAX_GROUP_SIZE",
108-
"MAX_TEAL_VERSION",
109-
"MIN_TEAL_VERSION",
110-
"MaybeValue",
111-
"MethodSignature",
112-
"MinBalance",
113-
"Minus",
114-
"Mod",
115-
"Mode",
116-
"Mul",
117-
"MultiValue",
118-
"NUM_SLOTS",
119-
"NaryExpr",
120-
"Neq",
121-
"Nonce",
122-
"Not",
123-
"OnComplete",
147+
"While",
148+
"For",
149+
"Break",
150+
"Continue",
124151
"Op",
125-
"Or",
126-
"Pop",
127-
"Reject",
128-
"Return",
129-
"ScratchIndex",
130-
"ScratchLoad",
131-
"ScratchSlot",
132-
"ScratchStackStore",
133-
"ScratchStore",
134-
"ScratchVar",
135-
"Seq",
136-
"SetBit",
137-
"SetByte",
138-
"Sha256",
139-
"Sha512_256",
140-
"ShiftLeft",
141-
"ShiftRight",
142-
"Sqrt",
143-
"Subroutine",
144-
"SubroutineCall",
145-
"SubroutineDeclaration",
146-
"SubroutineDefinition",
147-
"SubroutineFnWrapper",
148-
"Substring",
149-
"Suffix",
150-
"TealBlock",
151-
"TealCompileError",
152+
"Mode",
152153
"TealComponent",
153-
"TealConditionalBlock",
154-
"TealInputError",
155-
"TealInternalError",
156-
"TealLabel",
157154
"TealOp",
155+
"TealLabel",
156+
"TealBlock",
158157
"TealSimpleBlock",
158+
"TealConditionalBlock",
159+
"LabelReference",
160+
"MAX_TEAL_VERSION",
161+
"MIN_TEAL_VERSION",
162+
"DEFAULT_TEAL_VERSION",
163+
"CompileOptions",
164+
"compileTeal",
159165
"TealType",
166+
"TealInternalError",
160167
"TealTypeError",
161-
"Tmpl",
162-
"Txn",
163-
"TxnArray",
164-
"TxnExpr",
165-
"TxnField",
166-
"TxnGroup",
167-
"TxnObject",
168-
"TxnType",
169-
"TxnaExpr",
170-
"UnaryExpr",
171-
"While",
172-
"WideRatio",
173-
"compileTeal",
168+
"TealInputError",
169+
"TealCompileError",
170+
"MAX_GROUP_SIZE",
171+
"NUM_SLOTS",
174172
]

pyteal/ast/__init__.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,8 @@
120120

121121

122122
# misc
123-
from .scratch import (
124-
ScratchIndex,
125-
ScratchLoad,
126-
ScratchSlot,
127-
ScratchStackStore,
128-
ScratchStore,
129-
)
130-
from .scratchvar import DynamicScratchVar, ScratchVar
123+
from .scratch import ScratchSlot, ScratchLoad, ScratchStore, ScratchStackStore
124+
from .scratchvar import ScratchVar
131125
from .maybe import MaybeValue
132126
from .multi import MultiValue
133127

@@ -231,12 +225,10 @@
231225
"SubroutineDeclaration",
232226
"SubroutineCall",
233227
"SubroutineFnWrapper",
234-
"ScratchIndex",
235-
"ScratchLoad",
236228
"ScratchSlot",
237-
"ScratchStackStore",
229+
"ScratchLoad",
238230
"ScratchStore",
239-
"DynamicScratchVar",
231+
"ScratchStackStore",
240232
"ScratchVar",
241233
"MaybeValue",
242234
"MultiValue",

pyteal/ast/multi_test.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
from typing import List
1+
import pytest
22

33
from .. import *
4+
from typing import List
5+
6+
# this is not necessary but mypy complains if it's not included
7+
from .. import CompileOptions
48

59
options = CompileOptions()
610

0 commit comments

Comments
 (0)