tealrb 0.6.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -41,621 +41,623 @@ module TEALrb
41
41
  '!': 'zero?'
42
42
  }.freeze
43
43
 
44
- def acct_params_get(field, _account = nil)
45
- TEALrb::TEAL.current[Thread.current] << "acct_params_get #{field}"
46
- end
44
+ module TEALOpcodes
45
+ def acct_params_get(field, _account = nil)
46
+ TEAL.instance << "acct_params_get #{field}"
47
+ end
48
+
49
+ def add(_a = nil, _b = nil)
50
+ TEAL.instance << '+'
51
+ end
52
+
53
+ def addr(address)
54
+ TEAL.instance << "addr #{address}"
55
+ end
56
+
57
+ def addw(_a = nil, _b = nil)
58
+ TEAL.instance << 'addw'
59
+ end
60
+
61
+ def app_global_del(_key = nil)
62
+ TEAL.instance << 'app_global_del'
63
+ end
64
+
65
+ def app_global_get(_key = nil)
66
+ TEAL.instance << 'app_global_get'
67
+ end
68
+
69
+ def app_global_get_ex(_app = nil, _key = nil)
70
+ TEAL.instance << 'app_global_get_ex'
71
+ end
72
+
73
+ def app_global_put(_key = nil, _value = nil)
74
+ TEAL.instance << 'app_global_put'
75
+ end
76
+
77
+ def app_local_del(_account = nil, _key = nil)
78
+ TEAL.instance << 'app_local_del'
79
+ end
80
+
81
+ def app_local_get(_account = nil, _key = nil)
82
+ TEAL.instance << 'app_local_get'
83
+ end
84
+
85
+ def app_local_get_ex(_account = nil, _application = nil, _key = nil)
86
+ TEAL.instance << 'app_local_get_ex'
87
+ end
88
+
89
+ def app_local_put(_account = nil, _key = nil, _value = nil)
90
+ TEAL.instance << 'app_local_put'
91
+ end
92
+
93
+ def app_opted_in(_account = nil, _app = nil)
94
+ TEAL.instance << 'app_opted_in'
95
+ end
96
+
97
+ def app_params_get(field, _app_id = nil)
98
+ TEAL.instance << "app_params_get #{field}"
99
+ end
100
+
101
+ def approve
102
+ TEAL.instance << 'int 1'
103
+ TEAL.instance << 'return'
104
+ end
47
105
 
48
- def add(_a = nil, _b = nil)
49
- TEALrb::TEAL.current[Thread.current] << '+'
50
- end
106
+ def arg(index)
107
+ TEAL.instance << "arg #{index}"
108
+ end
51
109
 
52
- def addr(address)
53
- TEALrb::TEAL.current[Thread.current] << "addr #{address}"
54
- end
110
+ def arg_0 # rubocop:disable Naming/VariableNumber
111
+ TEAL.instance << 'arg_0'
112
+ end
55
113
 
56
- def addw(_a = nil, _b = nil)
57
- TEALrb::TEAL.current[Thread.current] << 'addw'
58
- end
114
+ def arg_1 # rubocop:disable Naming/VariableNumber
115
+ TEAL.instance << 'arg_1'
116
+ end
59
117
 
60
- def app_global_del(_key = nil)
61
- TEALrb::TEAL.current[Thread.current] << 'app_global_del'
62
- end
118
+ def arg_2 # rubocop:disable Naming/VariableNumber
119
+ TEAL.instance << 'arg_2'
120
+ end
63
121
 
64
- def app_global_get(_key = nil)
65
- TEALrb::TEAL.current[Thread.current] << 'app_global_get'
66
- end
122
+ def arg_3 # rubocop:disable Naming/VariableNumber
123
+ TEAL.instance << 'arg_3'
124
+ end
67
125
 
68
- def app_global_get_ex(_app = nil, _key = nil)
69
- TEALrb::TEAL.current[Thread.current] << 'app_global_get_ex'
70
- end
126
+ def args(_index = nil)
127
+ TEAL.instance << 'args'
128
+ end
71
129
 
72
- def app_global_put(_key = nil, _value = nil)
73
- TEALrb::TEAL.current[Thread.current] << 'app_global_put'
74
- end
130
+ def assert(_expr = nil)
131
+ TEAL.instance << 'assert'
132
+ end
75
133
 
76
- def app_local_del(_account = nil, _key = nil)
77
- TEALrb::TEAL.current[Thread.current] << 'app_local_del'
78
- end
134
+ def asset_holding_get(field, _account = nil, _asset = nil)
135
+ TEAL.instance << "asset_holding_get #{field}"
136
+ end
79
137
 
80
- def app_local_get(_account = nil, _key = nil)
81
- TEALrb::TEAL.current[Thread.current] << 'app_local_get'
82
- end
138
+ def asset_params_get(field, _asset = nil)
139
+ TEAL.instance << "asset_params_get #{field}"
140
+ end
83
141
 
84
- def app_local_get_ex(_account = nil, _application = nil, _key = nil)
85
- TEALrb::TEAL.current[Thread.current] << 'app_local_get_ex'
86
- end
142
+ def b(target)
143
+ TEAL.instance << "#{__method__} #{target}"
144
+ end
87
145
 
88
- def app_local_put(_account = nil, _key = nil, _value = nil)
89
- TEALrb::TEAL.current[Thread.current] << 'app_local_put'
90
- end
146
+ def base32(input)
147
+ TEAL.instance << "byte base32(#{input})"
148
+ end
91
149
 
92
- def app_opted_in(_account = nil, _app = nil)
93
- TEALrb::TEAL.current[Thread.current] << 'app_opted_in'
94
- end
150
+ def balance(_account = nil)
151
+ TEAL.instance << 'balance'
152
+ end
95
153
 
96
- def app_params_get(field, _app_id = nil)
97
- TEALrb::TEAL.current[Thread.current] << "app_params_get #{field}"
98
- end
154
+ def big_endian_add(_a = nil, _b = nil)
155
+ TEAL.instance << 'b+'
156
+ end
99
157
 
100
- def approve
101
- TEALrb::TEAL.current[Thread.current] << 'int 1'
102
- TEALrb::TEAL.current[Thread.current] << 'return'
103
- end
158
+ def big_endian_divide(_a = nil, _b = nil)
159
+ TEAL.instance << 'b/'
160
+ end
104
161
 
105
- def arg(index)
106
- TEALrb::TEAL.current[Thread.current] << "arg #{index}"
107
- end
162
+ def big_endian_equal(_a = nil, _b = nil)
163
+ TEAL.instance << 'b=='
164
+ end
108
165
 
109
- def arg_0 # rubocop:disable Naming/VariableNumber
110
- TEALrb::TEAL.current[Thread.current] << 'arg_0'
111
- end
166
+ def big_endian_less(_a = nil, _b = nil)
167
+ TEAL.instance << 'b<'
168
+ end
112
169
 
113
- def arg_1 # rubocop:disable Naming/VariableNumber
114
- TEALrb::TEAL.current[Thread.current] << 'arg_1'
115
- end
170
+ def big_endian_less_eq(_a = nil, _b = nil)
171
+ TEAL.instance << 'b<='
172
+ end
116
173
 
117
- def arg_2 # rubocop:disable Naming/VariableNumber
118
- TEALrb::TEAL.current[Thread.current] << 'arg_2'
119
- end
174
+ def big_endian_modulo(_a = nil, _b = nil)
175
+ TEAL.instance << 'b%'
176
+ end
120
177
 
121
- def arg_3 # rubocop:disable Naming/VariableNumber
122
- TEALrb::TEAL.current[Thread.current] << 'arg_3'
123
- end
178
+ def big_endian_more(_a = nil, _b = nil)
179
+ TEAL.instance << 'b>'
180
+ end
124
181
 
125
- def args(_index = nil)
126
- TEALrb::TEAL.current[Thread.current] << 'args'
127
- end
182
+ def big_endian_more_eq(_a = nil, _b = nil)
183
+ TEAL.instance << 'b>='
184
+ end
128
185
 
129
- def assert(_expr = nil)
130
- TEALrb::TEAL.current[Thread.current] << 'assert'
131
- end
186
+ def big_endian_multiply(_a = nil, _b = nil)
187
+ TEAL.instance << 'b*'
188
+ end
132
189
 
133
- def asset_holding_get(field, _account = nil, _asset = nil)
134
- TEALrb::TEAL.current[Thread.current] << "asset_holding_get #{field}"
135
- end
190
+ def big_endian_not_equal(_a = nil, _b = nil)
191
+ TEAL.instance << 'b!='
192
+ end
136
193
 
137
- def asset_params_get(field, _asset = nil)
138
- TEALrb::TEAL.current[Thread.current] << "asset_params_get #{field}"
139
- end
194
+ def big_endian_subtract(_a = nil, _b = nil)
195
+ TEAL.instance << 'b-'
196
+ end
140
197
 
141
- def b(target)
142
- TEALrb::TEAL.current[Thread.current] << "#{__method__} #{target}"
143
- end
198
+ def bitlen(_input = nil)
199
+ TEAL.instance << 'bitlen'
200
+ end
144
201
 
145
- def base32(input)
146
- TEALrb::TEAL.current[Thread.current] << "byte base32(#{input})"
147
- end
202
+ def bitwise_and(_a = nil, _b = nil)
203
+ TEAL.instance << '&'
204
+ end
148
205
 
149
- def balance(_account = nil)
150
- TEALrb::TEAL.current[Thread.current] << 'balance'
151
- end
206
+ def bitwise_byte_invert(_a = nil, _b = nil)
207
+ TEAL.instance << 'b~'
208
+ end
152
209
 
153
- def big_endian_add(_a = nil, _b = nil)
154
- TEALrb::TEAL.current[Thread.current] << 'b+'
155
- end
210
+ def bitwise_invert(_a = nil, _b = nil)
211
+ TEAL.instance << '~'
212
+ end
156
213
 
157
- def big_endian_divide(_a = nil, _b = nil)
158
- TEALrb::TEAL.current[Thread.current] << 'b/'
159
- end
214
+ def bitwise_or(_a = nil, _b = nil)
215
+ TEAL.instance << '|'
216
+ end
160
217
 
161
- def big_endian_equal(_a = nil, _b = nil)
162
- TEALrb::TEAL.current[Thread.current] << 'b=='
163
- end
218
+ def bitwise_xor(_a = nil, _b = nil)
219
+ TEAL.instance << '^'
220
+ end
164
221
 
165
- def big_endian_less(_a = nil, _b = nil)
166
- TEALrb::TEAL.current[Thread.current] << 'b<'
167
- end
222
+ def bnz(target)
223
+ TEAL.instance << "#{__method__} #{target}"
224
+ end
168
225
 
169
- def big_endian_less_eq(_a = nil, _b = nil)
170
- TEALrb::TEAL.current[Thread.current] << 'b<='
171
- end
226
+ def bsqrt(_big_endian_uint = nil)
227
+ TEAL.instance << 'bsqrt'
228
+ end
172
229
 
173
- def big_endian_modulo(_a = nil, _b = nil)
174
- TEALrb::TEAL.current[Thread.current] << 'b%'
175
- end
230
+ def btoi(_bytes = nil)
231
+ TEAL.instance << 'btoi'
232
+ end
176
233
 
177
- def big_endian_more(_a = nil, _b = nil)
178
- TEALrb::TEAL.current[Thread.current] << 'b>'
179
- end
234
+ def byte(string)
235
+ TEAL.instance << "byte \"#{string}\""
236
+ end
180
237
 
181
- def big_endian_more_eq(_a = nil, _b = nil)
182
- TEALrb::TEAL.current[Thread.current] << 'b>='
183
- end
238
+ def bytec(index)
239
+ TEAL.instance << "bytec #{index}"
240
+ end
184
241
 
185
- def big_endian_multiply(_a = nil, _b = nil)
186
- TEALrb::TEAL.current[Thread.current] << 'b*'
187
- end
242
+ def bytec_0 # rubocop:disable Naming/VariableNumber
243
+ TEAL.instance << 'bytec_0'
244
+ end
188
245
 
189
- def big_endian_not_equal(_a = nil, _b = nil)
190
- TEALrb::TEAL.current[Thread.current] << 'b!='
191
- end
246
+ def bytec_1 # rubocop:disable Naming/VariableNumber
247
+ TEAL.instance << 'bytec_1'
248
+ end
192
249
 
193
- def big_endian_subtract(_a = nil, _b = nil)
194
- TEALrb::TEAL.current[Thread.current] << 'b-'
195
- end
250
+ def bytec_2 # rubocop:disable Naming/VariableNumber
251
+ TEAL.instance << 'bytec_2'
252
+ end
196
253
 
197
- def bitlen(_input = nil)
198
- TEALrb::TEAL.current[Thread.current] << 'bitlen'
199
- end
254
+ def bytec_3 # rubocop:disable Naming/VariableNumber
255
+ TEAL.instance << 'bytec_3'
256
+ end
200
257
 
201
- def bitwise_and(_a = nil, _b = nil)
202
- TEALrb::TEAL.current[Thread.current] << '&'
203
- end
258
+ def bytecblock(*bytes)
259
+ TEAL.instance << "bytecblock #{bytes.join(' ')}"
260
+ end
204
261
 
205
- def bitwise_byte_invert(_a = nil, _b = nil)
206
- TEALrb::TEAL.current[Thread.current] << 'b~'
207
- end
262
+ def bz(target)
263
+ TEAL.instance << "#{__method__} #{target}"
264
+ end
208
265
 
209
- def bitwise_invert(_a = nil, _b = nil)
210
- TEALrb::TEAL.current[Thread.current] << '~'
211
- end
266
+ def bzero(_length = nil)
267
+ TEAL.instance << 'bzero'
268
+ end
212
269
 
213
- def bitwise_or(_a = nil, _b = nil)
214
- TEALrb::TEAL.current[Thread.current] << '|'
215
- end
270
+ def callsub(name, *_args)
271
+ TEAL.instance << "callsub #{name}"
272
+ end
216
273
 
217
- def bitwise_xor(_a = nil, _b = nil)
218
- TEALrb::TEAL.current[Thread.current] << '^'
219
- end
274
+ def concat(_a = nil, _b = nil)
275
+ TEAL.instance << 'concat'
276
+ end
220
277
 
221
- def bnz(target)
222
- TEALrb::TEAL.current[Thread.current] << "#{__method__} #{target}"
223
- end
278
+ def cover(count)
279
+ TEAL.instance << "cover #{count}"
280
+ end
224
281
 
225
- def bsqrt(_big_endian_uint = nil)
226
- TEALrb::TEAL.current[Thread.current] << 'bsqrt'
227
- end
282
+ def dig(index)
283
+ TEAL.instance << "dig #{index}"
284
+ end
228
285
 
229
- def btoi(_bytes = nil)
230
- TEALrb::TEAL.current[Thread.current] << 'btoi'
231
- end
286
+ def divide(_a = nil, _b = nil)
287
+ TEAL.instance << '/'
288
+ end
232
289
 
233
- def byte(string)
234
- TEALrb::TEAL.current[Thread.current] << "byte \"#{string}\""
235
- end
290
+ def divmodw(_a = nil, _b = nil)
291
+ TEAL.instance << 'divmodw'
292
+ end
236
293
 
237
- def bytec(index)
238
- TEALrb::TEAL.current[Thread.current] << "bytec #{index}"
239
- end
294
+ def divw(_a = nil, _b = nil)
295
+ TEAL.instance << 'divw'
296
+ end
240
297
 
241
- def bytec_0 # rubocop:disable Naming/VariableNumber
242
- TEALrb::TEAL.current[Thread.current] << 'bytec_0'
243
- end
298
+ def dup(_expr = nil)
299
+ TEAL.instance << 'dup'
300
+ end
244
301
 
245
- def bytec_1 # rubocop:disable Naming/VariableNumber
246
- TEALrb::TEAL.current[Thread.current] << 'bytec_1'
247
- end
302
+ def dup2(_expr_a = nil, _expr_b = nil)
303
+ TEAL.instance << 'dup2'
304
+ end
248
305
 
249
- def bytec_2 # rubocop:disable Naming/VariableNumber
250
- TEALrb::TEAL.current[Thread.current] << 'bytec_2'
251
- end
306
+ def ecdsa_pk_decompress(index, _input = nil)
307
+ TEAL.instance << "ecdsa_pk_decompress #{index}"
308
+ end
252
309
 
253
- def bytec_3 # rubocop:disable Naming/VariableNumber
254
- TEALrb::TEAL.current[Thread.current] << 'bytec_3'
255
- end
310
+ def ecdsa_pk_recover(index, _input = nil)
311
+ TEAL.instance << "ecdsa_pk_recover #{index}"
312
+ end
256
313
 
257
- def bytecblock(*bytes)
258
- TEALrb::TEAL.current[Thread.current] << "bytecblock #{bytes.join(' ')}"
259
- end
314
+ def ecdsa_verify(index, _input = nil)
315
+ TEAL.instance << "ecdsa_verify #{index}"
316
+ end
260
317
 
261
- def bz(target)
262
- TEALrb::TEAL.current[Thread.current] << "#{__method__} #{target}"
263
- end
318
+ def ed25519verify(_input = nil)
319
+ TEAL.instance << 'ed25519verify'
320
+ end
264
321
 
265
- def bzero(_length = nil)
266
- TEALrb::TEAL.current[Thread.current] << 'bzero'
267
- end
322
+ def equal(_a = nil, _b = nil)
323
+ TEAL.instance << '=='
324
+ end
268
325
 
269
- def callsub(name, *_args)
270
- TEALrb::TEAL.current[Thread.current] << "callsub #{name}"
271
- end
326
+ def err
327
+ TEAL.instance << 'err'
328
+ end
272
329
 
273
- def concat(_a = nil, _b = nil)
274
- TEALrb::TEAL.current[Thread.current] << 'concat'
275
- end
330
+ def exp(_a = nil, _b = nil)
331
+ TEAL.instance << 'exp'
332
+ end
276
333
 
277
- def cover(count)
278
- TEALrb::TEAL.current[Thread.current] << "cover #{count}"
279
- end
334
+ def expw(_a = nil, _b = nil)
335
+ TEAL.instance << 'expw'
336
+ end
280
337
 
281
- def dig(index)
282
- TEALrb::TEAL.current[Thread.current] << "dig #{index}"
283
- end
338
+ def extract(start, length, _byte_array = nil)
339
+ TEAL.instance << "extract #{start} #{length}"
340
+ end
284
341
 
285
- def divide(_a = nil, _b = nil)
286
- TEALrb::TEAL.current[Thread.current] << '/'
287
- end
342
+ def extract3(_byte_array = nil, _start = nil, _exclusive_end = nil)
343
+ TEAL.instance << 'extract3'
344
+ end
288
345
 
289
- def divmodw(_a = nil, _b = nil)
290
- TEALrb::TEAL.current[Thread.current] << 'divmodw'
291
- end
346
+ def extract_uint16(_byte_array = nil, _start = nil)
347
+ TEAL.instance << 'extract_uint16'
348
+ end
292
349
 
293
- def divw(_a = nil, _b = nil)
294
- TEALrb::TEAL.current[Thread.current] << 'divw'
295
- end
350
+ def extract_uint32(_byte_array = nil, _start = nil)
351
+ TEAL.instance << 'extract_uint32'
352
+ end
296
353
 
297
- def dup(_expr = nil)
298
- TEALrb::TEAL.current[Thread.current] << 'dup'
299
- end
354
+ def extract_uint64(_byte_array = nil, _start = nil)
355
+ TEAL.instance << 'extract_uint64'
356
+ end
300
357
 
301
- def dup2(_expr_a = nil, _expr_b = nil)
302
- TEALrb::TEAL.current[Thread.current] << 'dup2'
303
- end
358
+ def gaid(transaction_index)
359
+ TEAL.instance << "gaid #{transaction_index}"
360
+ end
304
361
 
305
- def ecdsa_pk_decompress(index, _input = nil)
306
- TEALrb::TEAL.current[Thread.current] << "ecdsa_pk_decompress #{index}"
307
- end
362
+ def gaids(_transaction = nil)
363
+ TEAL.instance << 'gaids'
364
+ end
308
365
 
309
- def ecdsa_pk_recover(index, _input = nil)
310
- TEALrb::TEAL.current[Thread.current] << "ecdsa_pk_recover #{index}"
311
- end
366
+ def getbit(_input = nil, _bit_index = nil)
367
+ TEAL.instance << 'getbit'
368
+ end
312
369
 
313
- def ecdsa_verify(index, _input = nil)
314
- TEALrb::TEAL.current[Thread.current] << "ecdsa_verify #{index}"
315
- end
370
+ def getbyte(_input = nil, _byte_index = nil)
371
+ TEAL.instance << 'getbyte'
372
+ end
316
373
 
317
- def ed25519verify(_input = nil)
318
- TEALrb::TEAL.current[Thread.current] << 'ed25519verify'
319
- end
374
+ def gitxn(transaction_index, field)
375
+ TEAL.instance << "gitxn #{transaction_index} #{field}"
376
+ end
320
377
 
321
- def equal(_a = nil, _b = nil)
322
- TEALrb::TEAL.current[Thread.current] << '=='
323
- end
378
+ def gitxna(transaction_index, field, index)
379
+ TEAL.instance << "gitxna #{transaction_index} #{field} #{index}"
380
+ end
324
381
 
325
- def err
326
- TEALrb::TEAL.current[Thread.current] << 'err'
327
- end
382
+ def gitxnas(transaction_index, field, _index = nil)
383
+ TEAL.instance << "gitxnas #{transaction_index} #{field}"
384
+ end
328
385
 
329
- def exp(_a = nil, _b = nil)
330
- TEALrb::TEAL.current[Thread.current] << 'exp'
331
- end
386
+ def gload(transaction_index, index)
387
+ TEAL.instance << "gload #{transaction_index} #{index}"
388
+ end
332
389
 
333
- def expw(_a = nil, _b = nil)
334
- TEALrb::TEAL.current[Thread.current] << 'expw'
335
- end
390
+ def gloads(index, _transaction_index = nil)
391
+ TEAL.instance << "gloads #{index}"
392
+ end
336
393
 
337
- def extract(start, length, _byte_array = nil)
338
- TEALrb::TEAL.current[Thread.current] << "extract #{start} #{length}"
339
- end
394
+ def gloadss(_transaction = nil, _index = nil)
395
+ TEAL.instance << 'gloadss'
396
+ end
340
397
 
341
- def extract3(_byte_array = nil, _start = nil, _exclusive_end = nil)
342
- TEALrb::TEAL.current[Thread.current] << 'extract3'
343
- end
398
+ def global(field)
399
+ TEAL.instance << "global #{field}"
400
+ end
344
401
 
345
- def extract_uint16(_byte_array = nil, _start = nil)
346
- TEALrb::TEAL.current[Thread.current] << 'extract_uint16'
347
- end
402
+ def greater(_a = nil, _b = nil)
403
+ TEAL.instance << '>'
404
+ end
348
405
 
349
- def extract_uint32(_byte_array = nil, _start = nil)
350
- TEALrb::TEAL.current[Thread.current] << 'extract_uint32'
351
- end
406
+ def greater_eq(_a = nil, _b = nil)
407
+ TEAL.instance << '>='
408
+ end
352
409
 
353
- def extract_uint64(_byte_array = nil, _start = nil)
354
- TEALrb::TEAL.current[Thread.current] << 'extract_uint64'
355
- end
410
+ def gtxn(index, field)
411
+ TEAL.instance << "gtxn #{index} #{field}"
412
+ end
356
413
 
357
- def gaid(transaction_index)
358
- TEALrb::TEAL.current[Thread.current] << "gaid #{transaction_index}"
359
- end
414
+ def gtxna(transaction_index, field, index)
415
+ TEAL.instance << "gtxna #{transaction_index} #{field} #{index}"
416
+ end
360
417
 
361
- def gaids(_transaction = nil)
362
- TEALrb::TEAL.current[Thread.current] << 'gaids'
363
- end
418
+ def gtxns(field, _transaction_index = nil)
419
+ TEAL.instance << "gtxns #{field}"
420
+ end
364
421
 
365
- def getbit(_input = nil, _bit_index = nil)
366
- TEALrb::TEAL.current[Thread.current] << 'getbit'
367
- end
422
+ def gtxnsa(field, index, _transaction_index = nil)
423
+ TEAL.instance << "gtxnsa #{field} #{index}"
424
+ end
368
425
 
369
- def getbyte(_input = nil, _byte_index = nil)
370
- TEALrb::TEAL.current[Thread.current] << 'getbyte'
371
- end
426
+ def gtxnas(transaction_index, field, _index = nil)
427
+ TEAL.instance << "gtxnas #{transaction_index} #{field}"
428
+ end
372
429
 
373
- def gitxn(transaction_index, field)
374
- TEALrb::TEAL.current[Thread.current] << "gitxn #{transaction_index} #{field}"
375
- end
430
+ def gtxnsas(field, _transaction_index = nil, _index = nil)
431
+ TEAL.instance << "gtxnsas #{field}"
432
+ end
376
433
 
377
- def gitxna(transaction_index, field, index)
378
- TEALrb::TEAL.current[Thread.current] << "gitxna #{transaction_index} #{field} #{index}"
379
- end
434
+ def int(integer)
435
+ TEAL.instance << "int #{integer}"
436
+ end
380
437
 
381
- def gitxnas(transaction_index, field, _index = nil)
382
- TEALrb::TEAL.current[Thread.current] << "gitxnas #{transaction_index} #{field}"
383
- end
438
+ def intc(index)
439
+ TEAL.instance << "intc #{index}"
440
+ end
384
441
 
385
- def gload(transaction_index, index)
386
- TEALrb::TEAL.current[Thread.current] << "gload #{transaction_index} #{index}"
387
- end
442
+ def intc_0 # rubocop:disable Naming/VariableNumber
443
+ TEAL.instance << 'intc_0'
444
+ end
388
445
 
389
- def gloads(index, _transaction_index = nil)
390
- TEALrb::TEAL.current[Thread.current] << "gloads #{index}"
391
- end
446
+ def intc_1 # rubocop:disable Naming/VariableNumber
447
+ TEAL.instance << 'intc_1'
448
+ end
392
449
 
393
- def gloadss(_transaction = nil, _index = nil)
394
- TEALrb::TEAL.current[Thread.current] << 'gloadss'
395
- end
450
+ def intc_2 # rubocop:disable Naming/VariableNumber
451
+ TEAL.instance << 'intc_2'
452
+ end
396
453
 
397
- def global(field)
398
- TEALrb::TEAL.current[Thread.current] << "global #{field}"
399
- end
454
+ def intc_3 # rubocop:disable Naming/VariableNumber
455
+ TEAL.instance << 'intc_3'
456
+ end
400
457
 
401
- def greater(_a = nil, _b = nil)
402
- TEALrb::TEAL.current[Thread.current] << '>'
403
- end
458
+ def intcblock(*ints)
459
+ TEAL.instance << "intcblock #{ints.join(' ')}"
460
+ end
404
461
 
405
- def greater_eq(_a = nil, _b = nil)
406
- TEALrb::TEAL.current[Thread.current] << '>='
407
- end
462
+ def itob(_bytes = nil)
463
+ TEAL.instance << 'itob'
464
+ end
408
465
 
409
- def gtxn(index, field)
410
- TEALrb::TEAL.current[Thread.current] << "gtxn #{index} #{field}"
411
- end
466
+ def itxn_begin
467
+ TEAL.instance << 'itxn_begin'
468
+ end
412
469
 
413
- def gtxna(transaction_index, field, index)
414
- TEALrb::TEAL.current[Thread.current] << "gtxna #{transaction_index} #{field} #{index}"
415
- end
470
+ def itxn_field(field, _value = nil)
471
+ TEAL.instance << "itxn_field #{field}"
472
+ end
416
473
 
417
- def gtxns(field, _transaction_index = nil)
418
- TEALrb::TEAL.current[Thread.current] << "gtxns #{field}"
419
- end
474
+ def itxn_next
475
+ TEAL.instance << 'itxn_next'
476
+ end
420
477
 
421
- def gtxnsa(field, index, _transaction_index = nil)
422
- TEALrb::TEAL.current[Thread.current] << "gtxnsa #{field} #{index}"
423
- end
478
+ def itxn_submit
479
+ TEAL.instance << 'itxn_submit'
480
+ end
424
481
 
425
- def gtxnas(transaction_index, field, _index = nil)
426
- TEALrb::TEAL.current[Thread.current] << "gtxnas #{transaction_index} #{field}"
427
- end
482
+ def itxna(field, index)
483
+ TEAL.instance << "itxna #{field} #{index}"
484
+ end
428
485
 
429
- def gtxnsas(field, _transaction_index = nil, _index = nil)
430
- TEALrb::TEAL.current[Thread.current] << "gtxnsas #{field}"
431
- end
486
+ def itxnas(field, _index = nil)
487
+ TEAL.instance << "itxnas #{field}"
488
+ end
432
489
 
433
- def int(integer)
434
- TEALrb::TEAL.current[Thread.current] << "int #{integer}"
435
- end
490
+ def keccak256(_input = nil)
491
+ TEAL.instance << 'keccak256'
492
+ end
436
493
 
437
- def intc(index)
438
- TEALrb::TEAL.current[Thread.current] << "intc #{index}"
439
- end
494
+ def label(label_name)
495
+ TEAL.instance << "#{label_name}:"
496
+ end
440
497
 
441
- def intc_0 # rubocop:disable Naming/VariableNumber
442
- TEALrb::TEAL.current[Thread.current] << 'intc_0'
443
- end
498
+ def len(_input = nil)
499
+ TEAL.instance << 'len'
500
+ end
444
501
 
445
- def intc_1 # rubocop:disable Naming/VariableNumber
446
- TEALrb::TEAL.current[Thread.current] << 'intc_1'
447
- end
502
+ def less(_a = nil, _b = nil)
503
+ TEAL.instance << '<'
504
+ end
448
505
 
449
- def intc_2 # rubocop:disable Naming/VariableNumber
450
- TEALrb::TEAL.current[Thread.current] << 'intc_2'
451
- end
506
+ def less_eq(_a = nil, _b = nil)
507
+ TEAL.instance << '<='
508
+ end
452
509
 
453
- def intc_3 # rubocop:disable Naming/VariableNumber
454
- TEALrb::TEAL.current[Thread.current] << 'intc_3'
455
- end
510
+ def load(index)
511
+ TEAL.instance << "load #{index}"
512
+ end
456
513
 
457
- def intcblock(*ints)
458
- TEALrb::TEAL.current[Thread.current] << "intcblock #{ints.join(' ')}"
459
- end
514
+ def loads(_index = nil)
515
+ TEAL.instance << 'loads'
516
+ end
460
517
 
461
- def itob(_bytes = nil)
462
- TEALrb::TEAL.current[Thread.current] << 'itob'
463
- end
518
+ def log(_byte_array = nil)
519
+ TEAL.instance << 'log'
520
+ end
464
521
 
465
- def itxn_begin
466
- TEALrb::TEAL.current[Thread.current] << 'itxn_begin'
467
- end
522
+ def method_signature(signature)
523
+ TEAL.instance << %(method "#{signature}")
524
+ end
468
525
 
469
- def itxn_field(field, _value = nil)
470
- TEALrb::TEAL.current[Thread.current] << "itxn_field #{field}"
471
- end
526
+ def min_balance(_account = nil)
527
+ TEAL.instance << 'min_balance'
528
+ end
472
529
 
473
- def itxn_next
474
- TEALrb::TEAL.current[Thread.current] << 'itxn_next'
475
- end
530
+ def modulo(_a = nil, _b = nil)
531
+ TEAL.instance << '%'
532
+ end
476
533
 
477
- def itxn_submit
478
- TEALrb::TEAL.current[Thread.current] << 'itxn_submit'
479
- end
534
+ def multiply(_a = nil, _b = nil)
535
+ TEAL.instance << '*'
536
+ end
480
537
 
481
- def itxna(field, index)
482
- TEALrb::TEAL.current[Thread.current] << "itxna #{field} #{index}"
483
- end
538
+ def mulw(_a = nil, _b = nil)
539
+ TEAL.instance << 'mulw'
540
+ end
484
541
 
485
- def itxnas(field, _index = nil)
486
- TEALrb::TEAL.current[Thread.current] << "itxnas #{field}"
487
- end
542
+ def zero?(_expr = nil)
543
+ TEAL.instance << '!'
544
+ end
488
545
 
489
- def keccak256(_input = nil)
490
- TEALrb::TEAL.current[Thread.current] << 'keccak256'
491
- end
546
+ def not_equal(_a = nil, _b = nil)
547
+ TEAL.instance << '!='
548
+ end
492
549
 
493
- def label(label_name)
494
- TEALrb::TEAL.current[Thread.current] << "#{label_name}:"
495
- end
550
+ def padded_bitwise_and(_a = nil, _b = nil)
551
+ TEAL.instance << 'b&'
552
+ end
496
553
 
497
- def len(_input = nil)
498
- TEALrb::TEAL.current[Thread.current] << 'len'
499
- end
554
+ def padded_bitwise_or(_a = nil, _b = nil)
555
+ TEAL.instance << 'b|'
556
+ end
500
557
 
501
- def less(_a = nil, _b = nil)
502
- TEALrb::TEAL.current[Thread.current] << '<'
503
- end
558
+ def padded_bitwise_xor(_a = nil, _b = nil)
559
+ TEAL.instance << 'b^'
560
+ end
504
561
 
505
- def less_eq(_a = nil, _b = nil)
506
- TEALrb::TEAL.current[Thread.current] << '<='
507
- end
562
+ def pop(_expr = nil)
563
+ TEAL.instance << 'pop'
564
+ end
508
565
 
509
- def load(index)
510
- TEALrb::TEAL.current[Thread.current] << "load #{index}"
511
- end
566
+ def pushbytes(string)
567
+ TEAL.instance << "pushbytes \"#{string}\""
568
+ end
512
569
 
513
- def loads(_index = nil)
514
- TEALrb::TEAL.current[Thread.current] << 'loads'
515
- end
570
+ def pushint(integer)
571
+ TEAL.instance << "pushint #{integer}"
572
+ end
516
573
 
517
- def log(_byte_array = nil)
518
- TEALrb::TEAL.current[Thread.current] << 'log'
519
- end
574
+ def retsub
575
+ TEAL.instance << 'retsub'
576
+ end
520
577
 
521
- def method_signature(signature)
522
- TEALrb::TEAL.current[Thread.current] << %(method "#{signature}")
523
- end
578
+ def select(_expr_a = nil, _expr_b = nil, _expr_c = nil)
579
+ TEAL.instance << 'select'
580
+ end
524
581
 
525
- def min_balance(_account = nil)
526
- TEALrb::TEAL.current[Thread.current] << 'min_balance'
527
- end
582
+ def setbit(_input = nil, _bit_index = nil, _value = nil)
583
+ TEAL.instance << 'setbit'
584
+ end
528
585
 
529
- def modulo(_a = nil, _b = nil)
530
- TEALrb::TEAL.current[Thread.current] << '%'
531
- end
586
+ def setbyte(_byte_array = nil, _byte_index = nil, _value = nil)
587
+ TEAL.instance << 'setbyte'
588
+ end
532
589
 
533
- def multiply(_a = nil, _b = nil)
534
- TEALrb::TEAL.current[Thread.current] << '*'
535
- end
590
+ def sha256(_input = nil)
591
+ TEAL.instance << 'sha256'
592
+ end
536
593
 
537
- def mulw(_a = nil, _b = nil)
538
- TEALrb::TEAL.current[Thread.current] << 'mulw'
539
- end
594
+ def sha512_256(_input = nil) # rubocop:disable Naming/VariableNumber
595
+ TEAL.instance << 'sha512_256'
596
+ end
540
597
 
541
- def zero?(_expr = nil)
542
- TEALrb::TEAL.current[Thread.current] << '!'
543
- end
598
+ def shl(_a = nil, _b = nil)
599
+ TEAL.instance << 'shl'
600
+ end
544
601
 
545
- def not_equal(_a = nil, _b = nil)
546
- TEALrb::TEAL.current[Thread.current] << '!='
547
- end
602
+ def shr(_a = nil, _b = nil)
603
+ TEAL.instance << 'shr'
604
+ end
548
605
 
549
- def padded_bitwise_and(_a = nil, _b = nil)
550
- TEALrb::TEAL.current[Thread.current] << 'b&'
551
- end
606
+ def sqrt(_integer = nil)
607
+ TEAL.instance << 'sqrt'
608
+ end
552
609
 
553
- def padded_bitwise_or(_a = nil, _b = nil)
554
- TEALrb::TEAL.current[Thread.current] << 'b|'
555
- end
610
+ def store(index, _value = nil)
611
+ TEAL.instance << "store #{index}"
612
+ end
556
613
 
557
- def padded_bitwise_xor(_a = nil, _b = nil)
558
- TEALrb::TEAL.current[Thread.current] << 'b^'
559
- end
614
+ def stores(_index = nil, _value = nil)
615
+ TEAL.instance << 'stores'
616
+ end
560
617
 
561
- def pop(_expr = nil)
562
- TEALrb::TEAL.current[Thread.current] << 'pop'
563
- end
618
+ def substring(start, exclusive_end, _byte_array = nil)
619
+ TEAL.instance << "substring #{start} #{exclusive_end}"
620
+ end
564
621
 
565
- def pushbytes(string)
566
- TEALrb::TEAL.current[Thread.current] << "pushbytes \"#{string}\""
567
- end
622
+ def substring3(_byte_array = nil, _start = nil, _exclusive_end = nil)
623
+ TEAL.instance << 'substring3'
624
+ end
568
625
 
569
- def pushint(integer)
570
- TEALrb::TEAL.current[Thread.current] << "pushint #{integer}"
571
- end
626
+ def subtract(_a = nil, _b = nil)
627
+ TEAL.instance << '-'
628
+ end
572
629
 
573
- def retsub
574
- TEALrb::TEAL.current[Thread.current] << 'retsub'
575
- end
630
+ def swap(_expr_a = nil, _expr_b = nil)
631
+ TEAL.instance << 'swap'
632
+ end
576
633
 
577
- def select(_expr_a = nil, _expr_b = nil, _expr_c = nil)
578
- TEALrb::TEAL.current[Thread.current] << 'select'
579
- end
634
+ def teal_return(_expr = nil)
635
+ TEAL.instance << 'return'
636
+ end
580
637
 
581
- def setbit(_input = nil, _bit_index = nil, _value = nil)
582
- TEALrb::TEAL.current[Thread.current] << 'setbit'
583
- end
638
+ def txn(field)
639
+ TEAL.instance << "txn #{field}"
640
+ end
584
641
 
585
- def setbyte(_byte_array = nil, _byte_index = nil, _value = nil)
586
- TEALrb::TEAL.current[Thread.current] << 'setbyte'
587
- end
642
+ def txna(field, index)
643
+ TEAL.instance << "txna #{field} #{index}"
644
+ end
588
645
 
589
- def sha256(_input = nil)
590
- TEALrb::TEAL.current[Thread.current] << 'sha256'
591
- end
646
+ def txnas(field, _index = nil)
647
+ TEAL.instance << "txnas #{field}"
648
+ end
592
649
 
593
- def sha512_256(_input = nil) # rubocop:disable Naming/VariableNumber
594
- TEALrb::TEAL.current[Thread.current] << 'sha512_256'
595
- end
596
-
597
- def shl(_a = nil, _b = nil)
598
- TEALrb::TEAL.current[Thread.current] << 'shl'
599
- end
600
-
601
- def shr(_a = nil, _b = nil)
602
- TEALrb::TEAL.current[Thread.current] << 'shr'
603
- end
650
+ def uncover(count)
651
+ TEAL.instance << "uncover #{count}"
652
+ end
604
653
 
605
- def sqrt(_integer = nil)
606
- TEALrb::TEAL.current[Thread.current] << 'sqrt'
607
- end
608
-
609
- def store(index, _value = nil)
610
- TEALrb::TEAL.current[Thread.current] << "store #{index}"
611
- end
612
-
613
- def stores(_index = nil, _value = nil)
614
- TEALrb::TEAL.current[Thread.current] << 'stores'
615
- end
616
-
617
- def substring(start, exclusive_end, _byte_array = nil)
618
- TEALrb::TEAL.current[Thread.current] << "substring #{start} #{exclusive_end}"
619
- end
620
-
621
- def substring3(_byte_array = nil, _start = nil, _exclusive_end = nil)
622
- TEALrb::TEAL.current[Thread.current] << 'substring3'
623
- end
624
-
625
- def subtract(_a = nil, _b = nil)
626
- TEALrb::TEAL.current[Thread.current] << '-'
627
- end
628
-
629
- def swap(_expr_a = nil, _expr_b = nil)
630
- TEALrb::TEAL.current[Thread.current] << 'swap'
631
- end
632
-
633
- def teal_return(_expr = nil)
634
- TEALrb::TEAL.current[Thread.current] << 'return'
635
- end
636
-
637
- def txn(field)
638
- TEALrb::TEAL.current[Thread.current] << "txn #{field}"
639
- end
640
-
641
- def txna(field, index)
642
- TEALrb::TEAL.current[Thread.current] << "txna #{field} #{index}"
643
- end
644
-
645
- def txnas(field, _index = nil)
646
- TEALrb::TEAL.current[Thread.current] << "txnas #{field}"
647
- end
648
-
649
- def uncover(count)
650
- TEALrb::TEAL.current[Thread.current] << "uncover #{count}"
651
- end
652
-
653
- def boolean_and(_a = nil, _b = nil)
654
- TEALrb::TEAL.current[Thread.current] << '&&'
655
- end
654
+ def boolean_and(_a = nil, _b = nil)
655
+ TEAL.instance << '&&'
656
+ end
656
657
 
657
- def boolean_or(_a = nil, _b = nil)
658
- TEALrb::TEAL.current[Thread.current] << '||'
658
+ def boolean_or(_a = nil, _b = nil)
659
+ TEAL.instance << '||'
660
+ end
659
661
  end
660
662
  end
661
663
  end