@@ -13,6 +13,7 @@ import {
1313 ForeignCallOnChain ,
1414 TrackerMetadataStruct ,
1515 EffectOnChain ,
16+ InstructionType ,
1617} from '../modules/types'
1718import {
1819 CallingFunctionJSON ,
@@ -74,49 +75,61 @@ export function reverseParseInstructionSet(
7475 if ( currentAction == - 1 ) {
7576 currentAction = Number ( instruction )
7677 switch ( currentAction ) {
77- case 0 :
78+ case InstructionType . NUMERIC_LITERAL :
7879 currentActionIndex = 1
7980 break
80- case 1 :
81+ case InstructionType . NOT :
8182 currentActionIndex = 1
8283 break
83- case 2 :
84+ case InstructionType . PLACEHOLDER :
8485 currentActionIndex = 1
8586 break
86- case 3 :
87+ case InstructionType . ASSIGNMENT :
8788 currentActionIndex = 2
8889 break
89- case 4 :
90+ case InstructionType . MAPPED_PLACEHOLDER :
9091 currentActionIndex = 2
9192 break
92- case 5 :
93+ case InstructionType . ADDITION :
9394 currentActionIndex = 2
9495 break
95- case 6 :
96+ case InstructionType . SUBTRACTION :
9697 currentActionIndex = 2
9798 break
98- case 7 :
99+ case InstructionType . MULTIPLICATION :
99100 currentActionIndex = 2
100101 break
101- case 8 :
102+ case InstructionType . DIVISION :
102103 currentActionIndex = 2
103104 break
104- case 9 :
105+ case InstructionType . LESS_THAN :
105106 currentActionIndex = 2
106107 break
107- case 10 :
108+ case InstructionType . GREATER_THAN :
108109 currentActionIndex = 2
109110 break
110- case 11 :
111+ case InstructionType . EQUAL :
111112 currentActionIndex = 2
112113 break
113- case 12 :
114+ case InstructionType . AND :
114115 currentActionIndex = 2
115116 break
116- case 17 :
117+ case InstructionType . OR :
118+ currentActionIndex = 2
119+ break
120+ case InstructionType . GREATER_EQUAL :
121+ currentActionIndex = 2
122+ break
123+ case InstructionType . LESS_EQUAL :
124+ currentActionIndex = 2
125+ break
126+ case InstructionType . NOT_EQUAL :
127+ currentActionIndex = 2
128+ break
129+ case InstructionType . TRACKER_UPDATE :
117130 currentActionIndex = 3
118131 break
119- case 18 :
132+ case InstructionType . MAPPED_TRACKER_UPDATE :
120133 currentActionIndex = 4
121134 break
122135 default :
@@ -125,7 +138,7 @@ export function reverseParseInstructionSet(
125138 }
126139 } else {
127140 switch ( currentAction ) {
128- case 0 :
141+ case InstructionType . NUMERIC_LITERAL :
129142 var found = false
130143 for ( var raw of stringReplacements ) {
131144 if ( raw . instructionSetIndex == instructionNumber && raw . type == rawDataIndex ) {
@@ -145,7 +158,7 @@ export function reverseParseInstructionSet(
145158 }
146159 currentMemAddress += 1
147160 break
148- case 1 :
161+ case InstructionType . NOT :
149162 for ( var memValue of memAddressesMap ) {
150163 if ( memValue . memAddr == instruction ) {
151164 currentInstructionValues . push ( memValue . value )
@@ -162,7 +175,7 @@ export function reverseParseInstructionSet(
162175 currentInstructionValues = [ ]
163176 }
164177 break
165- case 2 :
178+ case InstructionType . PLACEHOLDER :
166179 memAddressesMap . push ( {
167180 memAddr : currentMemAddress ,
168181 value : placeHolderArray [ instruction ] . split ( '~' ) [ 0 ] ,
@@ -171,7 +184,7 @@ export function reverseParseInstructionSet(
171184 currentMemAddress += 1
172185 retVal = placeHolderArray [ instruction ] . split ( '~' ) [ 0 ]
173186 break
174- case 3 :
187+ case InstructionType . ASSIGNMENT :
175188 retVal = arithmeticOperatorReverseInterpretation (
176189 instruction ,
177190 currentMemAddress ,
@@ -185,7 +198,7 @@ export function reverseParseInstructionSet(
185198 currentInstructionValues = [ ]
186199 }
187200 break
188- case 4 :
201+ case InstructionType . MAPPED_PLACEHOLDER :
189202 if ( currentActionIndex == 2 ) {
190203 valueIndex = instruction
191204 } else {
@@ -207,7 +220,7 @@ export function reverseParseInstructionSet(
207220 }
208221
209222 break
210- case 5 :
223+ case InstructionType . ADDITION :
211224 retVal = arithmeticOperatorReverseInterpretation (
212225 instruction ,
213226 currentMemAddress ,
@@ -221,7 +234,7 @@ export function reverseParseInstructionSet(
221234 currentInstructionValues = [ ]
222235 }
223236 break
224- case 6 :
237+ case InstructionType . SUBTRACTION :
225238 retVal = arithmeticOperatorReverseInterpretation (
226239 instruction ,
227240 currentMemAddress ,
@@ -235,7 +248,7 @@ export function reverseParseInstructionSet(
235248 currentInstructionValues = [ ]
236249 }
237250 break
238- case 7 :
251+ case InstructionType . MULTIPLICATION :
239252 retVal = arithmeticOperatorReverseInterpretation (
240253 instruction ,
241254 currentMemAddress ,
@@ -249,7 +262,7 @@ export function reverseParseInstructionSet(
249262 currentInstructionValues = [ ]
250263 }
251264 break
252- case 8 :
265+ case InstructionType . DIVISION :
253266 retVal = arithmeticOperatorReverseInterpretation (
254267 instruction ,
255268 currentMemAddress ,
@@ -263,7 +276,7 @@ export function reverseParseInstructionSet(
263276 currentInstructionValues = [ ]
264277 }
265278 break
266- case 9 :
279+ case InstructionType . LESS_THAN :
267280 retVal = arithmeticOperatorReverseInterpretation (
268281 instruction ,
269282 currentMemAddress ,
@@ -277,7 +290,7 @@ export function reverseParseInstructionSet(
277290 currentInstructionValues = [ ]
278291 }
279292 break
280- case 10 :
293+ case InstructionType . GREATER_THAN :
281294 retVal = arithmeticOperatorReverseInterpretation (
282295 instruction ,
283296 currentMemAddress ,
@@ -291,7 +304,7 @@ export function reverseParseInstructionSet(
291304 currentInstructionValues = [ ]
292305 }
293306 break
294- case 11 :
307+ case InstructionType . EQUAL :
295308 retVal = arithmeticOperatorReverseInterpretation (
296309 instruction ,
297310 currentMemAddress ,
@@ -306,7 +319,7 @@ export function reverseParseInstructionSet(
306319 currentInstructionValues = [ ]
307320 }
308321 break
309- case 12 :
322+ case InstructionType . AND :
310323 retVal = logicalOperatorReverseInterpretation (
311324 instruction ,
312325 currentMemAddress ,
@@ -320,7 +333,7 @@ export function reverseParseInstructionSet(
320333 currentInstructionValues = [ ]
321334 }
322335 break
323- case 13 :
336+ case InstructionType . OR :
324337 retVal = logicalOperatorReverseInterpretation (
325338 instruction ,
326339 currentMemAddress ,
@@ -334,7 +347,7 @@ export function reverseParseInstructionSet(
334347 currentInstructionValues = [ ]
335348 }
336349 break
337- case 14 :
350+ case InstructionType . GREATER_EQUAL :
338351 retVal = arithmeticOperatorReverseInterpretation (
339352 instruction ,
340353 currentMemAddress ,
@@ -348,7 +361,7 @@ export function reverseParseInstructionSet(
348361 currentInstructionValues = [ ]
349362 }
350363 break
351- case 15 :
364+ case InstructionType . LESS_EQUAL :
352365 retVal = arithmeticOperatorReverseInterpretation (
353366 instruction ,
354367 currentMemAddress ,
@@ -362,7 +375,7 @@ export function reverseParseInstructionSet(
362375 currentInstructionValues = [ ]
363376 }
364377 break
365- case 16 :
378+ case InstructionType . NOT_EQUAL :
366379 retVal = arithmeticOperatorReverseInterpretation (
367380 instruction ,
368381 currentMemAddress ,
@@ -376,8 +389,8 @@ export function reverseParseInstructionSet(
376389 currentInstructionValues = [ ]
377390 }
378391 break
379- case 17 :
380- case 18 :
392+ case InstructionType . TRACKER_UPDATE :
393+ case InstructionType . MAPPED_TRACKER_UPDATE :
381394 if ( ! truUpdated ) {
382395 var str = memAddressesMap [ currentMemAddress - 1 ] . value
383396 var memVal : any = str . replace ( 'TR:' , 'TRU:' )
0 commit comments