diff --git a/src/awst/intrinsic-factory.ts b/src/awst/intrinsic-factory.ts index 49cee9da..18bd0388 100644 --- a/src/awst/intrinsic-factory.ts +++ b/src/awst/intrinsic-factory.ts @@ -27,23 +27,19 @@ export const intrinsicFactory = { }) }, err({ sourceLocation, comment }: { sourceLocation: SourceLocation; comment: string | null }) { - return nodeFactory.intrinsicCall({ - opCode: 'err', + return nodeFactory.assertExpression({ + condition: null, sourceLocation, - stackArgs: [], - immediates: [], wtype: wtypes.voidWType, - comment, + errorMessage: comment, }) }, assert({ sourceLocation, comment, condition }: { sourceLocation: SourceLocation; comment: string | null; condition: Expression }) { - return nodeFactory.intrinsicCall({ - opCode: 'assert', + return nodeFactory.assertExpression({ sourceLocation, - stackArgs: [condition], - immediates: [], + condition, wtype: wtypes.voidWType, - comment, + errorMessage: comment, }) }, bytesLen({ value, sourceLocation }: { value: awst.Expression; sourceLocation: SourceLocation }) { diff --git a/src/awst/node-factory.ts b/src/awst/node-factory.ts index 4ca0c68d..1a91b4d6 100644 --- a/src/awst/node-factory.ts +++ b/src/awst/node-factory.ts @@ -17,7 +17,6 @@ import { Copy, ExpressionStatement, IntegerConstant, - IntrinsicCall, MethodDocumentation, Not, NumericComparisonExpression, @@ -213,12 +212,6 @@ const explicitNodeFactory = { returns: props?.returns ?? null, }) }, - intrinsicCall(props: Omit, 'comment'> & { comment?: string | null }) { - return new IntrinsicCall({ - ...props, - comment: props.comment ?? null, - }) - }, copy({ value, sourceLocation }: { value: Expression; sourceLocation: SourceLocation }) { return new Copy({ value, diff --git a/src/awst/nodes.ts b/src/awst/nodes.ts index d76d9be0..f3e1648b 100644 --- a/src/awst/nodes.ts +++ b/src/awst/nodes.ts @@ -134,6 +134,19 @@ export class ReturnStatement extends Statement { return visitor.visitReturnStatement(this) } } +export class AssertExpression extends Expression { + constructor(props: Props) { + super(props) + this.condition = props.condition + this.errorMessage = props.errorMessage + this.wtype = props.wtype + } + condition: Expression | null + errorMessage: string | null + accept(visitor: ExpressionVisitor): T { + return visitor.visitAssertExpression(this) + } +} export class IntegerConstant extends Expression { constructor(props: Props) { super(props) @@ -316,12 +329,10 @@ export class IntrinsicCall extends Expression { this.opCode = props.opCode this.immediates = props.immediates this.stackArgs = props.stackArgs - this.comment = props.comment } opCode: string immediates: Array stackArgs: Array - comment: string | null accept(visitor: ExpressionVisitor): T { return visitor.visitIntrinsicCall(this) } @@ -1309,6 +1320,7 @@ export const concreteNodes = { loopExit: LoopExit, loopContinue: LoopContinue, returnStatement: ReturnStatement, + assertExpression: AssertExpression, integerConstant: IntegerConstant, decimalConstant: DecimalConstant, boolConstant: BoolConstant, @@ -1393,6 +1405,7 @@ export const concreteNodes = { bigUIntConstant: IntegerConstant, } as const export interface ExpressionVisitor { + visitAssertExpression(expression: AssertExpression): T visitIntegerConstant(expression: IntegerConstant): T visitDecimalConstant(expression: DecimalConstant): T visitBoolConstant(expression: BoolConstant): T diff --git a/src/awst/to-code-visitor.ts b/src/awst/to-code-visitor.ts index 3154b499..9a674bb7 100644 --- a/src/awst/to-code-visitor.ts +++ b/src/awst/to-code-visitor.ts @@ -3,7 +3,15 @@ import { TodoError } from '../errors' import { logger } from '../logger' import { uint8ArrayToBase32, uint8ArrayToUtf8 } from '../util' import type { ContractReference } from './models' -import type { AppStorageDefinition, ContractMemberNodeVisitor, Emit, ExpressionVisitor, RootNodeVisitor, StatementVisitor } from './nodes' +import type { + AppStorageDefinition, + AssertExpression, + ContractMemberNodeVisitor, + Emit, + ExpressionVisitor, + RootNodeVisitor, + StatementVisitor, +} from './nodes' import * as nodes from './nodes' import { AppStorageKind, BytesEncoding, ContractMethodTarget, InstanceMethodTarget, InstanceSuperMethodTarget, SubroutineID } from './nodes' import { SymbolToNumber } from './util' @@ -331,6 +339,14 @@ export class ToCodeVisitor visitLogicSignature(moduleStatement: nodes.LogicSignature): string[] { return ['', `logicsig ${moduleStatement.id} {`, ...indent(moduleStatement.program.body.accept(this)), '}'] } + visitAssertExpression(expression: AssertExpression): string { + return [ + expression.condition ? 'assert(' : 'err(', + expression.condition?.accept(this) ?? '', + expression.errorMessage ? `, comment=${expression.errorMessage}` : '', + ')', + ].join('') + } private currentContract: ContractReference[] = [] visitContract(c: nodes.Contract): string[] { diff --git a/tests/approvals/out/abi-decorators/abi-decorators.awst.json b/tests/approvals/out/abi-decorators/abi-decorators.awst.json index d5d55351..6a049fed 100644 --- a/tests/approvals/out/abi-decorators/abi-decorators.awst.json +++ b/tests/approvals/out/abi-decorators/abi-decorators.awst.json @@ -109,8 +109,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, diff --git a/tests/approvals/out/accounts/accounts.awst.json b/tests/approvals/out/accounts/accounts.awst.json index b290e39d..710fbd10 100644 --- a/tests/approvals/out/accounts/accounts.awst.json +++ b/tests/approvals/out/accounts/accounts.awst.json @@ -109,8 +109,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, @@ -1114,8 +1113,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -1190,8 +1188,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -1282,8 +1279,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" } @@ -1359,8 +1355,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -1435,8 +1430,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -1511,8 +1505,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -1587,8 +1580,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -1663,8 +1655,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -1739,8 +1730,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -1815,8 +1805,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -1891,8 +1880,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -1967,8 +1955,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -2029,11 +2016,9 @@ "immediates": [ "CurrentApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } - ], - "comment": null + ] }, { "_type": "TupleItemExpression", @@ -2124,8 +2109,7 @@ }, "name": "asset" } - ], - "comment": null + ] }, "index": "1" } @@ -2538,8 +2522,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -2614,8 +2597,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -2706,8 +2688,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" } @@ -2783,8 +2764,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -2859,8 +2839,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -2935,8 +2914,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -3011,8 +2989,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -3087,8 +3064,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -3163,8 +3139,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -3239,8 +3214,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -3315,8 +3289,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -3391,8 +3364,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -3453,11 +3425,9 @@ "immediates": [ "CurrentApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } - ], - "comment": null + ] }, { "_type": "TupleItemExpression", @@ -3548,8 +3518,7 @@ }, "name": "asset" } - ], - "comment": null + ] }, "index": "1" } @@ -3962,8 +3931,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -4038,8 +4006,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -4130,8 +4097,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" } @@ -4207,8 +4173,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -4283,8 +4248,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -4359,8 +4323,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -4435,8 +4398,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -4511,8 +4473,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -4587,8 +4548,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -4663,8 +4623,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -4739,8 +4698,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -4815,8 +4773,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -4877,11 +4834,9 @@ "immediates": [ "CurrentApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } - ], - "comment": null + ] }, { "_type": "TupleItemExpression", @@ -4972,8 +4927,7 @@ }, "name": "asset" } - ], - "comment": null + ] }, "index": "1" } @@ -5386,8 +5340,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -5462,8 +5415,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -5554,8 +5506,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" } @@ -5631,8 +5582,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -5707,8 +5657,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -5783,8 +5732,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -5859,8 +5807,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -5935,8 +5882,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -6011,8 +5957,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -6087,8 +6032,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -6163,8 +6107,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -6239,8 +6182,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -6301,11 +6243,9 @@ "immediates": [ "CurrentApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } - ], - "comment": null + ] }, { "_type": "TupleItemExpression", @@ -6396,8 +6336,7 @@ }, "name": "asset" } - ], - "comment": null + ] }, "index": "1" } @@ -6810,8 +6749,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -6886,8 +6824,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -6978,8 +6915,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" } @@ -7055,8 +6991,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -7131,8 +7066,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -7207,8 +7141,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -7283,8 +7216,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -7359,8 +7291,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -7435,8 +7366,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -7511,8 +7441,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -7587,8 +7516,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -7663,8 +7591,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -7725,11 +7652,9 @@ "immediates": [ "CurrentApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } - ], - "comment": null + ] }, { "_type": "TupleItemExpression", @@ -7820,8 +7745,7 @@ }, "name": "asset" } - ], - "comment": null + ] }, "index": "1" } @@ -8234,8 +8158,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -8310,8 +8233,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -8402,8 +8324,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" } @@ -8479,8 +8400,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -8555,8 +8475,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -8631,8 +8550,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -8707,8 +8625,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -8783,8 +8700,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -8859,8 +8775,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -8935,8 +8850,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -9011,8 +8925,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -9087,8 +9000,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -9149,11 +9061,9 @@ "immediates": [ "CurrentApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } - ], - "comment": null + ] }, { "_type": "TupleItemExpression", @@ -9244,8 +9154,7 @@ }, "name": "asset" } - ], - "comment": null + ] }, "index": "1" } @@ -9658,8 +9567,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -9734,8 +9642,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -9826,8 +9733,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" } @@ -9903,8 +9809,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -9979,8 +9884,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -10055,8 +9959,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -10131,8 +10034,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -10207,8 +10109,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -10283,8 +10184,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -10359,8 +10259,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -10435,8 +10334,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -10511,8 +10409,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -10573,11 +10470,9 @@ "immediates": [ "CurrentApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } - ], - "comment": null + ] }, { "_type": "TupleItemExpression", @@ -10668,8 +10563,7 @@ }, "name": "asset" } - ], - "comment": null + ] }, "index": "1" } @@ -11082,8 +10976,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -11158,8 +11051,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -11250,8 +11142,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" } @@ -11327,8 +11218,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -11403,8 +11293,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -11479,8 +11368,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -11555,8 +11443,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -11631,8 +11518,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -11707,8 +11593,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -11783,8 +11668,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -11859,8 +11743,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -11935,8 +11818,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -11997,11 +11879,9 @@ "immediates": [ "CurrentApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } - ], - "comment": null + ] }, { "_type": "TupleItemExpression", @@ -12092,8 +11972,7 @@ }, "name": "asset" } - ], - "comment": null + ] }, "index": "1" } @@ -12506,8 +12385,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -12582,8 +12460,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -12674,8 +12551,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" } @@ -12751,8 +12627,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -12827,8 +12702,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -12903,8 +12777,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -12979,8 +12852,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -13055,8 +12927,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -13131,8 +13002,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -13207,8 +13077,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -13283,8 +13152,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -13359,8 +13227,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -13421,11 +13288,9 @@ "immediates": [ "CurrentApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } - ], - "comment": null + ] }, { "_type": "TupleItemExpression", @@ -13516,8 +13381,7 @@ }, "name": "asset" } - ], - "comment": null + ] }, "index": "1" } @@ -13930,8 +13794,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -14006,8 +13869,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -14098,8 +13960,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" } @@ -14175,8 +14036,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -14251,8 +14111,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -14327,8 +14186,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -14403,8 +14261,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -14479,8 +14336,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -14555,8 +14411,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -14631,8 +14486,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -14707,8 +14561,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -14783,8 +14636,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -14845,11 +14697,9 @@ "immediates": [ "CurrentApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } - ], - "comment": null + ] }, { "_type": "TupleItemExpression", @@ -14940,8 +14790,7 @@ }, "name": "asset" } - ], - "comment": null + ] }, "index": "1" } @@ -15354,8 +15203,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -15430,8 +15278,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -15522,8 +15369,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" } @@ -15599,8 +15445,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -15675,8 +15520,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -15751,8 +15595,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -15827,8 +15670,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -15903,8 +15745,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -15979,8 +15820,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -16055,8 +15895,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -16131,8 +15970,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -16207,8 +16045,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -16269,11 +16106,9 @@ "immediates": [ "CurrentApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } - ], - "comment": null + ] }, { "_type": "TupleItemExpression", @@ -16364,8 +16199,7 @@ }, "name": "asset" } - ], - "comment": null + ] }, "index": "1" } @@ -16778,8 +16612,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -16854,8 +16687,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -16946,8 +16778,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" } @@ -17023,8 +16854,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -17099,8 +16929,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -17175,8 +17004,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -17251,8 +17079,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -17327,8 +17154,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -17403,8 +17229,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -17479,8 +17304,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -17555,8 +17379,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -17631,8 +17454,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -17693,11 +17515,9 @@ "immediates": [ "CurrentApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } - ], - "comment": null + ] }, { "_type": "TupleItemExpression", @@ -17788,8 +17608,7 @@ }, "name": "asset" } - ], - "comment": null + ] }, "index": "1" } @@ -18202,8 +18021,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -18278,8 +18096,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -18370,8 +18187,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" } @@ -18447,8 +18263,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -18523,8 +18338,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -18599,8 +18413,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -18675,8 +18488,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -18751,8 +18563,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -18827,8 +18638,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -18903,8 +18713,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -18979,8 +18788,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -19055,8 +18863,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -19117,11 +18924,9 @@ "immediates": [ "CurrentApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } - ], - "comment": null + ] }, { "_type": "TupleItemExpression", @@ -19212,8 +19017,7 @@ }, "name": "asset" } - ], - "comment": null + ] }, "index": "1" } @@ -19626,8 +19430,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -19702,8 +19505,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -19794,8 +19596,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" } @@ -19871,8 +19672,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -19947,8 +19747,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -20023,8 +19822,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -20099,8 +19897,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -20175,8 +19972,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -20251,8 +20047,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -20327,8 +20122,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -20403,8 +20197,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -20479,8 +20272,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -20541,11 +20333,9 @@ "immediates": [ "CurrentApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } - ], - "comment": null + ] }, { "_type": "TupleItemExpression", @@ -20636,8 +20426,7 @@ }, "name": "asset" } - ], - "comment": null + ] }, "index": "1" } @@ -21050,8 +20839,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -21126,8 +20914,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -21218,8 +21005,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" } @@ -21295,8 +21081,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -21371,8 +21156,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -21447,8 +21231,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -21523,8 +21306,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -21599,8 +21381,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -21675,8 +21456,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -21751,8 +21531,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -21827,8 +21606,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -21903,8 +21681,7 @@ }, "name": "account" } - ], - "comment": null + ] }, "comment": "account funded" }, @@ -21965,11 +21742,9 @@ "immediates": [ "CurrentApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } - ], - "comment": null + ] }, { "_type": "TupleItemExpression", @@ -22060,8 +21835,7 @@ }, "name": "asset" } - ], - "comment": null + ] }, "index": "1" } diff --git a/tests/approvals/out/arc4-struct/arc4-struct.awst.json b/tests/approvals/out/arc4-struct/arc4-struct.awst.json index a794c1c9..99d963cc 100644 --- a/tests/approvals/out/arc4-struct/arc4-struct.awst.json +++ b/tests/approvals/out/arc4-struct/arc4-struct.awst.json @@ -109,8 +109,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, @@ -985,8 +984,7 @@ "name": "x" } } - ], - "comment": null + ] } }, { @@ -1123,8 +1121,7 @@ "name": "y" } } - ], - "comment": null + ] } }, { @@ -2336,7 +2333,7 @@ "end_column": 25 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-struct.algo.ts", "line": 15, @@ -2351,11 +2348,24 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-struct.algo.ts", + "line": 15, + "end_line": 15, + "column": 11, + "end_column": 24 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/arc4-struct.algo.ts", "line": 15, @@ -2365,29 +2375,62 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "ReinterpretCast", + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-struct.algo.ts", "line": 15, "end_line": 15, "column": 11, - "end_column": 24 + "end_column": 13 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4Struct", + "name": "Vector", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", + "scalar_type": 1, + "native_type": null, + "arc4_name": "uint64,uint64", + "fields": { + "x": { + "_type": "ARC4UIntN", + "name": "arc4.uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "arc4_name": "uint64", + "n": "64" + }, + "y": { + "_type": "ARC4UIntN", + "name": "arc4.uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "arc4_name": "uint64", + "n": "64" + } + }, "source_location": { "file": "tests/approvals/arc4-struct.algo.ts", "line": 15, @@ -2395,79 +2438,79 @@ "column": 11, "end_column": 13 }, - "wtype": { - "_type": "ARC4Struct", - "name": "Vector", - "immutable": true, - "ephemeral": false, - "scalar_type": 1, - "native_type": null, - "arc4_name": "uint64,uint64", - "fields": { - "x": { - "_type": "ARC4UIntN", - "name": "arc4.uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint64", - "n": "64" - }, - "y": { - "_type": "ARC4UIntN", - "name": "arc4.uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint64", - "n": "64" - } - }, - "source_location": { - "file": "tests/approvals/arc4-struct.algo.ts", - "line": 15, - "end_line": 15, - "column": 11, - "end_column": 13 - }, - "frozen": false - }, - "name": "v1" - } + "frozen": false + }, + "name": "v1" + } + }, + "operator": "==", + "rhs": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/arc4-struct.algo.ts", + "line": 15, + "end_line": 15, + "column": 11, + "end_column": 24 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 }, - "operator": "==", - "rhs": { - "_type": "ReinterpretCast", + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-struct.algo.ts", "line": 15, "end_line": 15, - "column": 11, - "end_column": 24 + "column": 21, + "end_column": 23 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4Struct", + "name": "Vector", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", + "scalar_type": 1, + "native_type": null, + "arc4_name": "uint64,uint64", + "fields": { + "x": { + "_type": "ARC4UIntN", + "name": "arc4.uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "arc4_name": "uint64", + "n": "64" + }, + "y": { + "_type": "ARC4UIntN", + "name": "arc4.uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "arc4_name": "uint64", + "n": "64" + } + }, "source_location": { "file": "tests/approvals/arc4-struct.algo.ts", "line": 15, @@ -2475,63 +2518,13 @@ "column": 21, "end_column": 23 }, - "wtype": { - "_type": "ARC4Struct", - "name": "Vector", - "immutable": true, - "ephemeral": false, - "scalar_type": 1, - "native_type": null, - "arc4_name": "uint64,uint64", - "fields": { - "x": { - "_type": "ARC4UIntN", - "name": "arc4.uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint64", - "n": "64" - }, - "y": { - "_type": "ARC4UIntN", - "name": "arc4.uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint64", - "n": "64" - } - }, - "source_location": { - "file": "tests/approvals/arc4-struct.algo.ts", - "line": 15, - "end_line": 15, - "column": 21, - "end_column": 23 - }, - "frozen": false - }, - "name": "v2" - } + "frozen": false + }, + "name": "v2" } } - ], - "comment": null + }, + "error_message": null } } ], @@ -5617,7 +5610,7 @@ "end_column": 33 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-struct.algo.ts", "line": 28, @@ -5632,123 +5625,169 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-struct.algo.ts", + "line": 28, + "end_line": 28, + "column": 11, + "end_column": 32 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/arc4-struct.algo.ts", "line": 28, "end_line": 28, "column": 11, - "end_column": 32 + "end_column": 19 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "ReinterpretCast", + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-struct.algo.ts", "line": 28, "end_line": 28, "column": 11, - "end_column": 19 + "end_column": 13 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4Struct", + "name": "Vector", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-struct.algo.ts", - "line": 28, - "end_line": 28, - "column": 11, - "end_column": 13 - }, - "wtype": { - "_type": "ARC4Struct", - "name": "Vector", - "immutable": true, - "ephemeral": false, - "scalar_type": 1, - "native_type": null, - "arc4_name": "uint64,uint64", - "fields": { - "x": { - "_type": "ARC4UIntN", - "name": "arc4.uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint64", - "n": "64" - }, - "y": { - "_type": "ARC4UIntN", - "name": "arc4.uint64", + "scalar_type": 1, + "native_type": null, + "arc4_name": "uint64,uint64", + "fields": { + "x": { + "_type": "ARC4UIntN", + "name": "arc4.uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint64", - "n": "64" - } - }, - "source_location": { - "file": "tests/approvals/arc4-struct.algo.ts", - "line": 28, - "end_line": 28, - "column": 11, - "end_column": 13 + "scalar_type": 2 + }, + "arc4_name": "uint64", + "n": "64" }, - "frozen": false + "y": { + "_type": "ARC4UIntN", + "name": "arc4.uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "arc4_name": "uint64", + "n": "64" + } }, - "name": "v1" - } + "source_location": { + "file": "tests/approvals/arc4-struct.algo.ts", + "line": 28, + "end_line": 28, + "column": 11, + "end_column": 13 + }, + "frozen": false + }, + "name": "v1" + } + }, + "operator": "==", + "rhs": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/arc4-struct.algo.ts", + "line": 28, + "end_line": 28, + "column": 24, + "end_column": 32 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 }, - "operator": "==", - "rhs": { - "_type": "ReinterpretCast", + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-struct.algo.ts", "line": 28, "end_line": 28, "column": 24, - "end_column": 32 + "end_column": 26 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4Struct", + "name": "Vector", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", + "scalar_type": 1, + "native_type": null, + "arc4_name": "uint64,uint64", + "fields": { + "x": { + "_type": "ARC4UIntN", + "name": "arc4.uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "arc4_name": "uint64", + "n": "64" + }, + "y": { + "_type": "ARC4UIntN", + "name": "arc4.uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "arc4_name": "uint64", + "n": "64" + } + }, "source_location": { "file": "tests/approvals/arc4-struct.algo.ts", "line": 28, @@ -5756,63 +5795,13 @@ "column": 24, "end_column": 26 }, - "wtype": { - "_type": "ARC4Struct", - "name": "Vector", - "immutable": true, - "ephemeral": false, - "scalar_type": 1, - "native_type": null, - "arc4_name": "uint64,uint64", - "fields": { - "x": { - "_type": "ARC4UIntN", - "name": "arc4.uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint64", - "n": "64" - }, - "y": { - "_type": "ARC4UIntN", - "name": "arc4.uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint64", - "n": "64" - } - }, - "source_location": { - "file": "tests/approvals/arc4-struct.algo.ts", - "line": 28, - "end_line": 28, - "column": 24, - "end_column": 26 - }, - "frozen": false - }, - "name": "v2" - } + "frozen": false + }, + "name": "v2" } } - ], - "comment": null + }, + "error_message": null } }, { @@ -5825,7 +5814,7 @@ "end_column": 33 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-struct.algo.ts", "line": 29, @@ -5840,43 +5829,89 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-struct.algo.ts", + "line": 29, + "end_line": 29, + "column": 11, + "end_column": 32 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/arc4-struct.algo.ts", "line": 29, "end_line": 29, "column": 11, - "end_column": 32 + "end_column": 19 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "ReinterpretCast", + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-struct.algo.ts", "line": 29, "end_line": 29, "column": 11, - "end_column": 19 + "end_column": 13 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4Struct", + "name": "Vector", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", + "scalar_type": 1, + "native_type": null, + "arc4_name": "uint64,uint64", + "fields": { + "x": { + "_type": "ARC4UIntN", + "name": "arc4.uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "arc4_name": "uint64", + "n": "64" + }, + "y": { + "_type": "ARC4UIntN", + "name": "arc4.uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "arc4_name": "uint64", + "n": "64" + } + }, "source_location": { "file": "tests/approvals/arc4-struct.algo.ts", "line": 29, @@ -5884,79 +5919,79 @@ "column": 11, "end_column": 13 }, - "wtype": { - "_type": "ARC4Struct", - "name": "Vector", - "immutable": true, - "ephemeral": false, - "scalar_type": 1, - "native_type": null, - "arc4_name": "uint64,uint64", - "fields": { - "x": { - "_type": "ARC4UIntN", - "name": "arc4.uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint64", - "n": "64" - }, - "y": { - "_type": "ARC4UIntN", - "name": "arc4.uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint64", - "n": "64" - } - }, - "source_location": { - "file": "tests/approvals/arc4-struct.algo.ts", - "line": 29, - "end_line": 29, - "column": 11, - "end_column": 13 - }, - "frozen": false - }, - "name": "v3" - } + "frozen": false + }, + "name": "v3" + } + }, + "operator": "==", + "rhs": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/arc4-struct.algo.ts", + "line": 29, + "end_line": 29, + "column": 24, + "end_column": 32 }, - "operator": "==", - "rhs": { - "_type": "ReinterpretCast", + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-struct.algo.ts", "line": 29, "end_line": 29, "column": 24, - "end_column": 32 + "end_column": 26 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4Struct", + "name": "Vector", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", + "scalar_type": 1, + "native_type": null, + "arc4_name": "uint64,uint64", + "fields": { + "x": { + "_type": "ARC4UIntN", + "name": "arc4.uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "arc4_name": "uint64", + "n": "64" + }, + "y": { + "_type": "ARC4UIntN", + "name": "arc4.uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "arc4_name": "uint64", + "n": "64" + } + }, "source_location": { "file": "tests/approvals/arc4-struct.algo.ts", "line": 29, @@ -5964,63 +5999,13 @@ "column": 24, "end_column": 26 }, - "wtype": { - "_type": "ARC4Struct", - "name": "Vector", - "immutable": true, - "ephemeral": false, - "scalar_type": 1, - "native_type": null, - "arc4_name": "uint64,uint64", - "fields": { - "x": { - "_type": "ARC4UIntN", - "name": "arc4.uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint64", - "n": "64" - }, - "y": { - "_type": "ARC4UIntN", - "name": "arc4.uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint64", - "n": "64" - } - }, - "source_location": { - "file": "tests/approvals/arc4-struct.algo.ts", - "line": 29, - "end_line": 29, - "column": 24, - "end_column": 26 - }, - "frozen": false - }, - "name": "v1" - } + "frozen": false + }, + "name": "v1" } } - ], - "comment": null + }, + "error_message": null } } ], diff --git a/tests/approvals/out/arc4-types/arc4-types.awst b/tests/approvals/out/arc4-types/arc4-types.awst index 94e78577..db9b3369 100644 --- a/tests/approvals/out/arc4-types/arc4-types.awst +++ b/tests/approvals/out/arc4-types/arc4-types.awst @@ -23,15 +23,15 @@ subroutine test(n: uint64, b: biguint, c: arc4.uint256): void subroutine testStr(): void { s1: arc4.dynamic_array = "" - assert(reinterpret_cast(s1) == reinterpret_cast(0)) + assert(reinterpret_cast(s1) == reinterpret_cast(0), comment=Empty string should equal the uint16 length prefix) s2: arc4.dynamic_array = "Hello" assert(ARC4_DECODE(s2) == "Hello") } subroutine testDynamicBytes(someBytes: bytes): void { db1: arc4.dynamic_array = 0x0000 - assert(ARC4_DECODE(db1) == 0x) - assert(reinterpret_cast(db1) == reinterpret_cast(0)) + assert(ARC4_DECODE(db1) == 0x, comment=No args should give empty bytes) + assert(reinterpret_cast(db1) == reinterpret_cast(0), comment=bytes prop should return length header (of 0)) db2: arc4.dynamic_array = ARC4_ENCODE(someBytes, wtype=arc4.dynamic_array) assert(ARC4_DECODE(db2) == someBytes) db3: arc4.dynamic_array = 0x000568656c6c6f @@ -61,9 +61,9 @@ subroutine testAddress(): void { a: arc4.static_array = Address("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ") b: arc4.static_array = reinterpret_cast>(txn()) - assert(!reinterpret_cast(a) == reinterpret_cast(b)) - assert(reinterpret_cast(a) == reinterpret_cast(Address("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ"))) - assert(reinterpret_cast(a[0]) == reinterpret_cast(0)) + assert(!reinterpret_cast(a) == reinterpret_cast(b), comment=Zero address should not match sender) + assert(reinterpret_cast(a) == reinterpret_cast(Address("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ")), comment=Two zero addresses should match) + assert(reinterpret_cast(a[0]) == reinterpret_cast(0), comment=Zero address should start with zero byte) } subroutine testTuple(): void { diff --git a/tests/approvals/out/arc4-types/arc4-types.awst.json b/tests/approvals/out/arc4-types/arc4-types.awst.json index dc96d337..61cb2879 100644 --- a/tests/approvals/out/arc4-types/arc4-types.awst.json +++ b/tests/approvals/out/arc4-types/arc4-types.awst.json @@ -168,7 +168,7 @@ "end_column": 21 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 20, @@ -183,11 +183,24 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 20, + "end_line": 20, + "column": 9, + "end_column": 20 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 20, @@ -197,105 +210,88 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "ReinterpretCast", + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 20, "end_line": 20, "column": 9, - "end_column": 20 + "end_column": 10 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4UFixedNxM", + "name": "arc4.ufixed32x4", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 20, - "end_line": 20, - "column": 9, - "end_column": 10 - }, - "wtype": { - "_type": "ARC4UFixedNxM", - "name": "arc4.ufixed32x4", + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "ufixed32x4", - "n": "32", - "m": "4" + "scalar_type": 2 }, - "name": "a" - } + "arc4_name": "ufixed32x4", + "n": "32", + "m": "4" + }, + "name": "a" + } + }, + "operator": "==", + "rhs": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 20, + "end_line": 20, + "column": 9, + "end_column": 20 }, - "operator": "==", - "rhs": { - "_type": "ReinterpretCast", + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 20, "end_line": 20, - "column": 9, - "end_column": 20 + "column": 18, + "end_column": 19 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4UFixedNxM", + "name": "arc4.ufixed32x4", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 20, - "end_line": 20, - "column": 18, - "end_column": 19 - }, - "wtype": { - "_type": "ARC4UFixedNxM", - "name": "arc4.ufixed32x4", + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "ufixed32x4", - "n": "32", - "m": "4" + "scalar_type": 2 }, - "name": "c" - } + "arc4_name": "ufixed32x4", + "n": "32", + "m": "4" + }, + "name": "c" } } - ], - "comment": null + }, + "error_message": null } } ], @@ -477,7 +473,7 @@ "end_column": 30 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 25, @@ -492,114 +488,109 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 25, + "end_line": 25, + "column": 9, + "end_column": 29 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 25, "end_line": 25, "column": 9, - "end_column": 29 + "end_column": 23 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 25, - "end_line": 25, - "column": 9, - "end_column": 23 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "op_code": "len", - "immediates": [], - "stack_args": [ - { - "_type": "ReinterpretCast", + "op_code": "len", + "immediates": [], + "stack_args": [ + { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 25, + "end_line": 25, + "column": 9, + "end_column": 16 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 25, "end_line": 25, "column": 9, - "end_column": 16 + "end_column": 10 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4UIntN", + "name": "arc4.uint8", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 25, - "end_line": 25, - "column": 9, - "end_column": 10 - }, - "wtype": { - "_type": "ARC4UIntN", - "name": "arc4.uint8", + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint8", - "n": "8" + "scalar_type": 2 }, - "name": "x" - } + "arc4_name": "uint8", + "n": "8" + }, + "name": "x" } - ], - "comment": null + } + ] + }, + "operator": "==", + "rhs": { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 25, + "end_line": 25, + "column": 28, + "end_column": 29 }, - "operator": "==", - "rhs": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 25, - "end_line": 25, - "column": 28, - "end_column": 29 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "1", - "teal_alias": null - } + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "value": "1", + "teal_alias": null } - ], - "comment": null + }, + "error_message": null } }, { @@ -677,7 +668,7 @@ "end_column": 42 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 27, @@ -692,92 +683,88 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 27, + "end_line": 27, + "column": 9, + "end_column": 41 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 27, "end_line": 27, "column": 9, - "end_column": 41 + "end_column": 17 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "ReinterpretCast", + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 27, "end_line": 27, "column": 9, - "end_column": 17 + "end_column": 11 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4UIntN", + "name": "arc4.uint8", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 27, - "end_line": 27, - "column": 9, - "end_column": 11 + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 }, - "wtype": { - "_type": "ARC4UIntN", - "name": "arc4.uint8", - "immutable": true, - "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint8", - "n": "8" - }, - "name": "x2" - } - }, - "operator": "==", - "rhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 27, - "end_line": 27, - "column": 22, - "end_column": 41 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 + "arc4_name": "uint8", + "n": "8" }, - "value": "{{", - "encoding": "base16" + "name": "x2" } + }, + "operator": "==", + "rhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 27, + "end_line": 27, + "column": 22, + "end_column": 41 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "{{", + "encoding": "base16" } - ], - "comment": null + }, + "error_message": null } }, { @@ -855,7 +842,7 @@ "end_column": 30 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 30, @@ -870,114 +857,109 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 30, + "end_line": 30, + "column": 9, + "end_column": 29 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 30, "end_line": 30, "column": 9, - "end_column": 29 + "end_column": 23 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 30, - "end_line": 30, - "column": 9, - "end_column": 23 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "op_code": "len", - "immediates": [], - "stack_args": [ - { - "_type": "ReinterpretCast", + "op_code": "len", + "immediates": [], + "stack_args": [ + { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 30, + "end_line": 30, + "column": 9, + "end_column": 16 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 30, "end_line": 30, "column": 9, - "end_column": 16 + "end_column": 10 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4UIntN", + "name": "arc4.uint16", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 30, - "end_line": 30, - "column": 9, - "end_column": 10 - }, - "wtype": { - "_type": "ARC4UIntN", - "name": "arc4.uint16", + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint16", - "n": "16" + "scalar_type": 2 }, - "name": "y" - } + "arc4_name": "uint16", + "n": "16" + }, + "name": "y" } - ], - "comment": null + } + ] + }, + "operator": "==", + "rhs": { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 30, + "end_line": 30, + "column": 28, + "end_column": 29 }, - "operator": "==", - "rhs": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 30, - "end_line": 30, - "column": 28, - "end_column": 29 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "2", - "teal_alias": null - } + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "value": "2", + "teal_alias": null } - ], - "comment": null + }, + "error_message": null } }, { @@ -1143,7 +1125,7 @@ "end_column": 24 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 33, @@ -1158,65 +1140,61 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 33, + "end_line": 33, + "column": 9, + "end_column": 23 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 33, "end_line": 33, "column": 9, - "end_column": 23 + "end_column": 17 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 33, - "end_line": 33, - "column": 9, - "end_column": 17 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "z_native" + "name": "z_native" + }, + "operator": "==", + "rhs": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 33, + "end_line": 33, + "column": 22, + "end_column": 23 }, - "operator": "==", - "rhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 33, - "end_line": 33, - "column": 22, - "end_column": 23 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "n" - } + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "name": "n" } - ], - "comment": null + }, + "error_message": null } }, { @@ -1382,7 +1360,7 @@ "end_column": 24 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 36, @@ -1397,65 +1375,61 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 36, + "end_line": 36, + "column": 9, + "end_column": 23 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 36, "end_line": 36, "column": 9, + "end_column": 17 + }, + "wtype": { + "_type": "WType", + "name": "biguint", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "name": "a_native" + }, + "operator": "==", + "rhs": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 36, + "end_line": 36, + "column": 22, "end_column": 23 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "biguint", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 36, - "end_line": 36, - "column": 9, - "end_column": 17 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "a_native" - }, - "operator": "==", - "rhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 36, - "end_line": 36, - "column": 22, - "end_column": 23 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "b" - } + "name": "b" } - ], - "comment": null + }, + "error_message": null } }, { @@ -1468,7 +1442,7 @@ "end_column": 36 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 38, @@ -1483,114 +1457,109 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 38, + "end_line": 38, + "column": 9, + "end_column": 35 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 38, "end_line": 38, "column": 9, - "end_column": 35 + "end_column": 23 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 38, - "end_line": 38, - "column": 9, - "end_column": 23 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "op_code": "len", - "immediates": [], - "stack_args": [ - { - "_type": "ReinterpretCast", + "op_code": "len", + "immediates": [], + "stack_args": [ + { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 38, + "end_line": 38, + "column": 9, + "end_column": 16 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 38, "end_line": 38, "column": 9, - "end_column": 16 + "end_column": 10 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4UIntN", + "name": "arc4.uint256", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 38, - "end_line": 38, - "column": 9, - "end_column": 10 - }, - "wtype": { - "_type": "ARC4UIntN", - "name": "arc4.uint256", + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "biguint", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "arc4_name": "uint256", - "n": "256" + "scalar_type": 1 }, - "name": "c" - } + "arc4_name": "uint256", + "n": "256" + }, + "name": "c" } - ], - "comment": null + } + ] + }, + "operator": "==", + "rhs": { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 38, + "end_line": 38, + "column": 28, + "end_column": 35 }, - "operator": "==", - "rhs": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 38, - "end_line": 38, - "column": 28, - "end_column": 35 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "32", - "teal_alias": null - } + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "value": "32", + "teal_alias": null } - ], - "comment": null + }, + "error_message": null } } ], @@ -1739,7 +1708,7 @@ "end_column": 99 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 43, @@ -1754,134 +1723,130 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 43, + "end_line": 43, + "column": 9, + "end_column": 44 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 43, "end_line": 43, "column": 9, - "end_column": 44 + "end_column": 17 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "ReinterpretCast", + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 43, "end_line": 43, "column": 9, - "end_column": 17 + "end_column": 11 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4DynamicArray", + "name": "arc4.dynamic_array", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 43, - "end_line": 43, - "column": 9, - "end_column": 11 + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "string", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 }, - "wtype": { - "_type": "ARC4DynamicArray", - "name": "arc4.dynamic_array", + "arc4_name": "string", + "element_type": { + "_type": "ARC4UIntN", + "name": "arc4.byte", "immutable": true, "ephemeral": false, "scalar_type": 1, "native_type": { "_type": "WType", - "name": "string", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "arc4_name": "string", - "element_type": { - "_type": "ARC4UIntN", - "name": "arc4.byte", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "byte", - "n": "8" + "scalar_type": 2 }, - "source_location": null + "arc4_name": "byte", + "n": "8" }, - "name": "s1" - } + "source_location": null + }, + "name": "s1" + } + }, + "operator": "==", + "rhs": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 43, + "end_line": 43, + "column": 22, + "end_column": 44 }, - "operator": "==", - "rhs": { - "_type": "ReinterpretCast", + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "expr": { + "_type": "IntegerConstant", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 43, "end_line": 43, "column": 22, - "end_column": 44 + "end_column": 38 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4UIntN", + "name": "arc4.uint16", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 43, - "end_line": 43, - "column": 22, - "end_column": 38 - }, - "wtype": { - "_type": "ARC4UIntN", - "name": "arc4.uint16", + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint16", - "n": "16" + "scalar_type": 2 }, - "value": "0", - "teal_alias": null - } + "arc4_name": "uint16", + "n": "16" + }, + "value": "0", + "teal_alias": null } } - ], - "comment": "Empty string should equal the uint16 length prefix" + }, + "error_message": "Empty string should equal the uint16 length prefix" } }, { @@ -1990,7 +1955,7 @@ "end_column": 31 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 45, @@ -2005,107 +1970,103 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 45, + "end_line": 45, + "column": 9, + "end_column": 30 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "ARC4Decode", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 45, "end_line": 45, "column": 9, - "end_column": 30 + "end_column": 18 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "string", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "ARC4Decode", + "value": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 45, "end_line": 45, "column": 9, - "end_column": 18 + "end_column": 11 }, "wtype": { - "_type": "WType", - "name": "string", + "_type": "ARC4DynamicArray", + "name": "arc4.dynamic_array", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "value": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 45, - "end_line": 45, - "column": 9, - "end_column": 11 + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "string", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 }, - "wtype": { - "_type": "ARC4DynamicArray", - "name": "arc4.dynamic_array", + "arc4_name": "string", + "element_type": { + "_type": "ARC4UIntN", + "name": "arc4.byte", "immutable": true, "ephemeral": false, "scalar_type": 1, "native_type": { "_type": "WType", - "name": "string", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "arc4_name": "string", - "element_type": { - "_type": "ARC4UIntN", - "name": "arc4.byte", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "byte", - "n": "8" + "scalar_type": 2 }, - "source_location": null + "arc4_name": "byte", + "n": "8" }, - "name": "s2" - } - }, - "operator": "==", - "rhs": { - "_type": "StringConstant", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 45, - "end_line": 45, - "column": 23, - "end_column": 30 - }, - "wtype": { - "_type": "WType", - "name": "string", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 + "source_location": null }, - "value": "Hello" + "name": "s2" } + }, + "operator": "==", + "rhs": { + "_type": "StringConstant", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 45, + "end_line": 45, + "column": 23, + "end_column": 30 + }, + "wtype": { + "_type": "WType", + "name": "string", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "Hello" } - ], - "comment": null + }, + "error_message": null } } ], @@ -2274,7 +2235,7 @@ "end_column": 67 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 50, @@ -2289,108 +2250,104 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 50, + "end_line": 50, + "column": 9, + "end_column": 31 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "ARC4Decode", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 50, "end_line": 50, "column": 9, - "end_column": 31 + "end_column": 19 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "ARC4Decode", + "value": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 50, "end_line": 50, "column": 9, - "end_column": 19 + "end_column": 12 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4DynamicArray", + "name": "arc4.dynamic_array", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "value": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 50, - "end_line": 50, - "column": 9, - "end_column": 12 + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 }, - "wtype": { - "_type": "ARC4DynamicArray", - "name": "arc4.dynamic_array", + "arc4_name": "byte[]", + "element_type": { + "_type": "ARC4UIntN", + "name": "arc4.byte", "immutable": true, "ephemeral": false, "scalar_type": 1, "native_type": { "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "arc4_name": "byte[]", - "element_type": { - "_type": "ARC4UIntN", - "name": "arc4.byte", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "byte", - "n": "8" + "scalar_type": 2 }, - "source_location": null + "arc4_name": "byte", + "n": "8" }, - "name": "db1" - } - }, - "operator": "==", - "rhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 50, - "end_line": 50, - "column": 24, - "end_column": 31 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 + "source_location": null }, - "value": "", - "encoding": "unknown" + "name": "db1" } + }, + "operator": "==", + "rhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 50, + "end_line": 50, + "column": 24, + "end_column": 31 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "", + "encoding": "unknown" } - ], - "comment": "No args should give empty bytes" + }, + "error_message": "No args should give empty bytes" } }, { @@ -2403,7 +2360,7 @@ "end_column": 95 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 51, @@ -2418,134 +2375,130 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 51, + "end_line": 51, + "column": 9, + "end_column": 45 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 51, "end_line": 51, "column": 9, - "end_column": 45 + "end_column": 18 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "ReinterpretCast", + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 51, "end_line": 51, "column": 9, - "end_column": 18 + "end_column": 12 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4DynamicArray", + "name": "arc4.dynamic_array", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 51, - "end_line": 51, - "column": 9, - "end_column": 12 + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 }, - "wtype": { - "_type": "ARC4DynamicArray", - "name": "arc4.dynamic_array", + "arc4_name": "byte[]", + "element_type": { + "_type": "ARC4UIntN", + "name": "arc4.byte", "immutable": true, "ephemeral": false, "scalar_type": 1, "native_type": { "_type": "WType", - "name": "bytes", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1 + "scalar_type": 2 }, - "arc4_name": "byte[]", - "element_type": { - "_type": "ARC4UIntN", - "name": "arc4.byte", - "immutable": true, - "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "byte", - "n": "8" - }, - "source_location": null + "arc4_name": "byte", + "n": "8" }, - "name": "db1" - } + "source_location": null + }, + "name": "db1" + } + }, + "operator": "==", + "rhs": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 51, + "end_line": 51, + "column": 23, + "end_column": 45 }, - "operator": "==", - "rhs": { - "_type": "ReinterpretCast", + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "expr": { + "_type": "IntegerConstant", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 51, "end_line": 51, "column": 23, - "end_column": 45 + "end_column": 39 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4UIntN", + "name": "arc4.uint16", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 51, - "end_line": 51, - "column": 23, - "end_column": 39 - }, - "wtype": { - "_type": "ARC4UIntN", - "name": "arc4.uint16", + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint16", - "n": "16" + "scalar_type": 2 }, - "value": "0", - "teal_alias": null - } + "arc4_name": "uint16", + "n": "16" + }, + "value": "0", + "teal_alias": null } } - ], - "comment": "bytes prop should return length header (of 0)" + }, + "error_message": "bytes prop should return length header (of 0)" } }, { @@ -2671,7 +2624,7 @@ "end_column": 34 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 53, @@ -2686,107 +2639,103 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 53, + "end_line": 53, + "column": 9, + "end_column": 33 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "ARC4Decode", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 53, "end_line": 53, "column": 9, - "end_column": 33 + "end_column": 19 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "ARC4Decode", + "value": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 53, "end_line": 53, "column": 9, - "end_column": 19 + "end_column": 12 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4DynamicArray", + "name": "arc4.dynamic_array", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "value": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 53, - "end_line": 53, - "column": 9, - "end_column": 12 + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 }, - "wtype": { - "_type": "ARC4DynamicArray", - "name": "arc4.dynamic_array", + "arc4_name": "byte[]", + "element_type": { + "_type": "ARC4UIntN", + "name": "arc4.byte", "immutable": true, "ephemeral": false, "scalar_type": 1, "native_type": { "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "arc4_name": "byte[]", - "element_type": { - "_type": "ARC4UIntN", - "name": "arc4.byte", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "byte", - "n": "8" + "scalar_type": 2 }, - "source_location": null + "arc4_name": "byte", + "n": "8" }, - "name": "db2" - } - }, - "operator": "==", - "rhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 53, - "end_line": 53, - "column": 24, - "end_column": 33 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 + "source_location": null }, - "name": "someBytes" + "name": "db2" } + }, + "operator": "==", + "rhs": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 53, + "end_line": 53, + "column": 24, + "end_column": 33 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "name": "someBytes" } - ], - "comment": null + }, + "error_message": null } }, { @@ -2896,7 +2845,7 @@ "end_column": 39 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 56, @@ -2911,110 +2860,106 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 56, + "end_line": 56, + "column": 9, + "end_column": 38 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "ARC4Decode", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 56, "end_line": 56, "column": 9, - "end_column": 38 + "end_column": 19 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "ARC4Decode", + "value": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 56, "end_line": 56, "column": 9, - "end_column": 19 + "end_column": 12 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4DynamicArray", + "name": "arc4.dynamic_array", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "value": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 56, - "end_line": 56, - "column": 9, - "end_column": 12 + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 }, - "wtype": { - "_type": "ARC4DynamicArray", - "name": "arc4.dynamic_array", + "arc4_name": "byte[]", + "element_type": { + "_type": "ARC4UIntN", + "name": "arc4.byte", "immutable": true, "ephemeral": false, "scalar_type": 1, "native_type": { "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "arc4_name": "byte[]", - "element_type": { - "_type": "ARC4UIntN", - "name": "arc4.byte", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "byte", - "n": "8" + "scalar_type": 2 }, - "source_location": null + "arc4_name": "byte", + "n": "8" }, - "name": "db3" - } - }, - "operator": "==", - "rhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 56, - "end_line": 56, - "column": 30, - "end_column": 37 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 + "source_location": null }, - "value": "Xk~0{Zv", - "encoding": "utf8" + "name": "db3" } - } - ], - "comment": null - } - } + }, + "operator": "==", + "rhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 56, + "end_line": 56, + "column": 30, + "end_column": 37 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "Xk~0{Zv", + "encoding": "utf8" + } + }, + "error_message": null + } + } ], "label": null, "comment": null @@ -3890,7 +3835,7 @@ "end_column": 43 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 75, @@ -3905,11 +3850,24 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 75, + "end_line": 75, + "column": 9, + "end_column": 42 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 75, @@ -3919,195 +3877,178 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "ReinterpretCast", + "expr": { + "_type": "IndexExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 75, "end_line": 75, "column": 9, - "end_column": 42 + "end_column": 20 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4UIntN", + "name": "arc4.uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1 + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "arc4_name": "uint64", + "n": "64" }, - "expr": { - "_type": "IndexExpression", + "base": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 75, "end_line": 75, "column": 9, - "end_column": 20 + "end_column": 17 }, "wtype": { - "_type": "ARC4UIntN", - "name": "arc4.uint64", - "immutable": true, + "_type": "ARC4StaticArray", + "name": "arc4.static_array", + "immutable": false, "ephemeral": false, "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", + "native_type": null, + "arc4_name": "uint64[2]", + "element_type": { + "_type": "ARC4UIntN", + "name": "arc4.uint64", "immutable": true, "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint64", - "n": "64" - }, - "base": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 75, - "end_line": 75, - "column": 9, - "end_column": 17 - }, - "wtype": { - "_type": "ARC4StaticArray", - "name": "arc4.static_array", - "immutable": false, - "ephemeral": false, "scalar_type": 1, - "native_type": null, - "arc4_name": "uint64[2]", - "element_type": { - "_type": "ARC4UIntN", - "name": "arc4.uint64", + "native_type": { + "_type": "WType", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint64", - "n": "64" + "scalar_type": 2 }, - "source_location": null, - "array_size": "2" + "arc4_name": "uint64", + "n": "64" }, - "name": "myStatic" + "source_location": null, + "array_size": "2" }, - "index": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 75, - "end_line": 75, - "column": 18, - "end_column": 19 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "0", - "teal_alias": null - } + "name": "myStatic" + }, + "index": { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 75, + "end_line": 75, + "column": 18, + "end_column": 19 + }, + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "value": "0", + "teal_alias": null } + } + }, + "operator": "==", + "rhs": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 75, + "end_line": 75, + "column": 9, + "end_column": 42 }, - "operator": "==", - "rhs": { - "_type": "ReinterpretCast", + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "expr": { + "_type": "ArrayPop", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 75, "end_line": 75, - "column": 9, - "end_column": 42 + "column": 28, + "end_column": 41 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4UIntN", + "name": "arc4.uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1 + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "arc4_name": "uint64", + "n": "64" }, - "expr": { - "_type": "ArrayPop", + "base": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 75, "end_line": 75, "column": 28, - "end_column": 41 + "end_column": 35 }, "wtype": { - "_type": "ARC4UIntN", - "name": "arc4.uint64", - "immutable": true, + "_type": "ARC4DynamicArray", + "name": "arc4.dynamic_array", + "immutable": false, "ephemeral": false, "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", + "native_type": null, + "arc4_name": "uint64[]", + "element_type": { + "_type": "ARC4UIntN", + "name": "arc4.uint64", "immutable": true, "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint64", - "n": "64" - }, - "base": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 75, - "end_line": 75, - "column": 28, - "end_column": 35 - }, - "wtype": { - "_type": "ARC4DynamicArray", - "name": "arc4.dynamic_array", - "immutable": false, - "ephemeral": false, "scalar_type": 1, - "native_type": null, - "arc4_name": "uint64[]", - "element_type": { - "_type": "ARC4UIntN", - "name": "arc4.uint64", + "native_type": { + "_type": "WType", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint64", - "n": "64" + "scalar_type": 2 }, - "source_location": null + "arc4_name": "uint64", + "n": "64" }, - "name": "myArray" - } + "source_location": null + }, + "name": "myArray" } } } - ], - "comment": null + }, + "error_message": null } }, { @@ -4411,7 +4352,7 @@ "end_column": 22 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 85, @@ -4426,11 +4367,24 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 85, + "end_line": 85, + "column": 9, + "end_column": 21 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 85, @@ -4440,103 +4394,86 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "ReinterpretCast", + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 85, "end_line": 85, "column": 9, - "end_column": 21 + "end_column": 10 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4UIntN", + "name": "arc4.byte", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 85, - "end_line": 85, - "column": 9, - "end_column": 10 - }, - "wtype": { - "_type": "ARC4UIntN", - "name": "arc4.byte", + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "byte", - "n": "8" + "scalar_type": 2 }, - "name": "b" - } + "arc4_name": "byte", + "n": "8" + }, + "name": "b" + } + }, + "operator": "==", + "rhs": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 85, + "end_line": 85, + "column": 9, + "end_column": 21 }, - "operator": "==", - "rhs": { - "_type": "ReinterpretCast", + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 85, "end_line": 85, - "column": 9, - "end_column": 21 + "column": 18, + "end_column": 20 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4UIntN", + "name": "arc4.byte", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 85, - "end_line": 85, - "column": 18, - "end_column": 20 - }, - "wtype": { - "_type": "ARC4UIntN", - "name": "arc4.byte", + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "byte", - "n": "8" + "scalar_type": 2 }, - "name": "b2" - } + "arc4_name": "byte", + "n": "8" + }, + "name": "b2" } } - ], - "comment": null + }, + "error_message": null } } ], @@ -4792,8 +4729,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, @@ -4807,7 +4743,7 @@ "end_column": 62 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 92, @@ -4822,16 +4758,29 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "Not", + "condition": { + "_type": "Not", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 92, + "end_line": 92, + "column": 9, + "end_column": 21 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { + "_type": "BytesComparisonExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 92, "end_line": 92, - "column": 9, + "column": 10, "end_column": 21 }, "wtype": { @@ -4841,8 +4790,8 @@ "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "BytesComparisonExpression", + "lhs": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 92, @@ -4852,138 +4801,121 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "ReinterpretCast", + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 92, "end_line": 92, "column": 10, - "end_column": 21 + "end_column": 11 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4StaticArray", + "name": "arc4.static_array", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 92, - "end_line": 92, - "column": 10, - "end_column": 11 + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "account", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 }, - "wtype": { - "_type": "ARC4StaticArray", - "name": "arc4.static_array", + "arc4_name": "address", + "element_type": { + "_type": "ARC4UIntN", + "name": "arc4.byte", "immutable": true, "ephemeral": false, "scalar_type": 1, "native_type": { "_type": "WType", - "name": "account", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "arc4_name": "address", - "element_type": { - "_type": "ARC4UIntN", - "name": "arc4.byte", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "byte", - "n": "8" + "scalar_type": 2 }, - "source_location": null, - "array_size": "32" + "arc4_name": "byte", + "n": "8" }, - "name": "a" - } + "source_location": null, + "array_size": "32" + }, + "name": "a" + } + }, + "operator": "==", + "rhs": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 92, + "end_line": 92, + "column": 10, + "end_column": 21 }, - "operator": "==", - "rhs": { - "_type": "ReinterpretCast", + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 92, "end_line": 92, - "column": 10, - "end_column": 21 + "column": 19, + "end_column": 20 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4StaticArray", + "name": "arc4.static_array", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 92, - "end_line": 92, - "column": 19, - "end_column": 20 + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "account", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 }, - "wtype": { - "_type": "ARC4StaticArray", - "name": "arc4.static_array", + "arc4_name": "address", + "element_type": { + "_type": "ARC4UIntN", + "name": "arc4.byte", "immutable": true, "ephemeral": false, "scalar_type": 1, "native_type": { "_type": "WType", - "name": "account", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "arc4_name": "address", - "element_type": { - "_type": "ARC4UIntN", - "name": "arc4.byte", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "byte", - "n": "8" + "scalar_type": 2 }, - "source_location": null, - "array_size": "32" + "arc4_name": "byte", + "n": "8" }, - "name": "b" - } + "source_location": null, + "array_size": "32" + }, + "name": "b" } } } - ], - "comment": "Zero address should not match sender" + }, + "error_message": "Zero address should not match sender" } }, { @@ -4996,7 +4928,7 @@ "end_column": 68 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 93, @@ -5011,11 +4943,24 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 93, + "end_line": 93, + "column": 9, + "end_column": 32 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 93, @@ -5025,137 +4970,120 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "ReinterpretCast", + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 93, "end_line": 93, "column": 9, - "end_column": 32 + "end_column": 10 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4StaticArray", + "name": "arc4.static_array", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 93, - "end_line": 93, - "column": 9, - "end_column": 10 - }, - "wtype": { - "_type": "ARC4StaticArray", - "name": "arc4.static_array", - "immutable": true, - "ephemeral": false, + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "account", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "arc4_name": "address", + "element_type": { + "_type": "ARC4UIntN", + "name": "arc4.byte", + "immutable": true, + "ephemeral": false, "scalar_type": 1, "native_type": { "_type": "WType", - "name": "account", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "arc4_name": "address", - "element_type": { - "_type": "ARC4UIntN", - "name": "arc4.byte", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "byte", - "n": "8" + "scalar_type": 2 }, - "source_location": null, - "array_size": "32" + "arc4_name": "byte", + "n": "8" }, - "name": "a" - } + "source_location": null, + "array_size": "32" + }, + "name": "a" + } + }, + "operator": "==", + "rhs": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 93, + "end_line": 93, + "column": 9, + "end_column": 32 }, - "operator": "==", - "rhs": { - "_type": "ReinterpretCast", + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "expr": { + "_type": "AddressConstant", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 93, "end_line": 93, - "column": 9, - "end_column": 32 + "column": 18, + "end_column": 31 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4StaticArray", + "name": "arc4.static_array", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "AddressConstant", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 93, - "end_line": 93, - "column": 18, - "end_column": 31 + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "account", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 }, - "wtype": { - "_type": "ARC4StaticArray", - "name": "arc4.static_array", + "arc4_name": "address", + "element_type": { + "_type": "ARC4UIntN", + "name": "arc4.byte", "immutable": true, "ephemeral": false, "scalar_type": 1, "native_type": { "_type": "WType", - "name": "account", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "arc4_name": "address", - "element_type": { - "_type": "ARC4UIntN", - "name": "arc4.byte", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "byte", - "n": "8" + "scalar_type": 2 }, - "source_location": null, - "array_size": "32" + "arc4_name": "byte", + "n": "8" }, - "value": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ" - } + "source_location": null, + "array_size": "32" + }, + "value": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAY5HFKQ" } } - ], - "comment": "Two zero addresses should match" + }, + "error_message": "Two zero addresses should match" } }, { @@ -5168,7 +5096,7 @@ "end_column": 77 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 94, @@ -5183,11 +5111,24 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 94, + "end_line": 94, + "column": 9, + "end_column": 32 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 94, @@ -5197,166 +5138,149 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "ReinterpretCast", + "expr": { + "_type": "IndexExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 94, "end_line": 94, "column": 9, - "end_column": 32 + "end_column": 13 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4UIntN", + "name": "arc4.byte", "immutable": true, "ephemeral": false, - "scalar_type": 1 + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "arc4_name": "byte", + "n": "8" }, - "expr": { - "_type": "IndexExpression", + "base": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 94, "end_line": 94, "column": 9, - "end_column": 13 + "end_column": 10 }, "wtype": { - "_type": "ARC4UIntN", - "name": "arc4.byte", + "_type": "ARC4StaticArray", + "name": "arc4.static_array", "immutable": true, "ephemeral": false, "scalar_type": 1, "native_type": { "_type": "WType", - "name": "uint64", + "name": "account", "immutable": true, "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "byte", - "n": "8" - }, - "base": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 94, - "end_line": 94, - "column": 9, - "end_column": 10 + "scalar_type": 1 }, - "wtype": { - "_type": "ARC4StaticArray", - "name": "arc4.static_array", + "arc4_name": "address", + "element_type": { + "_type": "ARC4UIntN", + "name": "arc4.byte", "immutable": true, "ephemeral": false, "scalar_type": 1, "native_type": { "_type": "WType", - "name": "account", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "arc4_name": "address", - "element_type": { - "_type": "ARC4UIntN", - "name": "arc4.byte", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "byte", - "n": "8" + "scalar_type": 2 }, - "source_location": null, - "array_size": "32" + "arc4_name": "byte", + "n": "8" }, - "name": "a" + "source_location": null, + "array_size": "32" }, - "index": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 94, - "end_line": 94, - "column": 11, - "end_column": 12 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "0", - "teal_alias": null - } - } - }, - "operator": "==", - "rhs": { - "_type": "ReinterpretCast", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 94, - "end_line": 94, - "column": 9, - "end_column": 32 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 + "name": "a" }, - "expr": { + "index": { "_type": "IntegerConstant", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 94, "end_line": 94, - "column": 21, - "end_column": 31 + "column": 11, + "end_column": 12 }, "wtype": { - "_type": "ARC4UIntN", - "name": "arc4.byte", + "_type": "WType", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "byte", - "n": "8" + "scalar_type": 2 }, "value": "0", "teal_alias": null } } + }, + "operator": "==", + "rhs": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 94, + "end_line": 94, + "column": 9, + "end_column": 32 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "expr": { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 94, + "end_line": 94, + "column": 21, + "end_column": 31 + }, + "wtype": { + "_type": "ARC4UIntN", + "name": "arc4.byte", + "immutable": true, + "ephemeral": false, + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "arc4_name": "byte", + "n": "8" + }, + "value": "0", + "teal_alias": null + } } - ], - "comment": "Zero address should start with zero byte" + }, + "error_message": "Zero address should start with zero byte" } } ], @@ -5808,7 +5732,7 @@ "end_column": 44 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 101, @@ -5823,11 +5747,24 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 101, + "end_line": 101, + "column": 9, + "end_column": 43 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 101, @@ -5837,103 +5774,86 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "ReinterpretCast", + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 101, "end_line": 101, "column": 9, - "end_column": 43 + "end_column": 18 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4UIntN", + "name": "arc4.uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 101, - "end_line": 101, - "column": 9, - "end_column": 18 - }, - "wtype": { - "_type": "ARC4UIntN", - "name": "arc4.uint64", + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint64", - "n": "64" + "scalar_type": 2 }, - "name": "firstItem" - } + "arc4_name": "uint64", + "n": "64" + }, + "name": "firstItem" + } + }, + "operator": "==", + "rhs": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 101, + "end_line": 101, + "column": 9, + "end_column": 43 }, - "operator": "==", - "rhs": { - "_type": "ReinterpretCast", + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 101, "end_line": 101, - "column": 9, - "end_column": 43 + "column": 26, + "end_column": 42 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "ARC4UIntN", + "name": "arc4.uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 101, - "end_line": 101, - "column": 26, - "end_column": 42 - }, - "wtype": { - "_type": "ARC4UIntN", - "name": "arc4.uint64", + "scalar_type": 1, + "native_type": { + "_type": "WType", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint64", - "n": "64" + "scalar_type": 2 }, - "name": "firstItemIndexer" - } + "arc4_name": "uint64", + "n": "64" + }, + "name": "firstItemIndexer" } } - ], - "comment": null + }, + "error_message": null } }, { @@ -6247,7 +6167,7 @@ "end_column": 25 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 103, @@ -6262,67 +6182,63 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 103, + "end_line": 103, + "column": 9, + "end_column": 24 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "IntegerConstant", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 103, "end_line": 103, "column": 9, - "end_column": 24 + "end_column": 18 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 103, - "end_line": 103, - "column": 9, - "end_column": 18 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "2", - "teal_alias": null + "value": "2", + "teal_alias": null + }, + "operator": "==", + "rhs": { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 103, + "end_line": 103, + "column": 23, + "end_column": 24 }, - "operator": "==", - "rhs": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 103, - "end_line": 103, - "column": 23, - "end_column": 24 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "2", - "teal_alias": null - } + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "value": "2", + "teal_alias": null } - ], - "comment": null + }, + "error_message": null } } ], @@ -6446,8 +6362,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, @@ -7133,7 +7048,7 @@ "end_column": 31 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 124, @@ -7148,126 +7063,121 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 124, + "end_line": 124, + "column": 11, + "end_column": 30 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/arc4-types.algo.ts", "line": 124, "end_line": 124, "column": 11, - "end_column": 30 + "end_column": 24 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 124, - "end_line": 124, - "column": 11, - "end_column": 24 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "op_code": "extract_uint16", - "immediates": [], - "stack_args": [ - { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 124, - "end_line": 124, - "column": 11, - "end_column": 17 - }, - "wtype": { - "_type": "ARC4DynamicArray", - "name": "arc4.dynamic_array", - "immutable": false, + "op_code": "extract_uint16", + "immediates": [], + "stack_args": [ + { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 124, + "end_line": 124, + "column": 11, + "end_column": 17 + }, + "wtype": { + "_type": "ARC4DynamicArray", + "name": "arc4.dynamic_array", + "immutable": false, + "ephemeral": false, + "scalar_type": 1, + "native_type": null, + "arc4_name": "uint64[]", + "element_type": { + "_type": "ARC4UIntN", + "name": "arc4.uint64", + "immutable": true, "ephemeral": false, "scalar_type": 1, - "native_type": null, - "arc4_name": "uint64[]", - "element_type": { - "_type": "ARC4UIntN", - "name": "arc4.uint64", + "native_type": { + "_type": "WType", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1, - "native_type": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "arc4_name": "uint64", - "n": "64" + "scalar_type": 2 }, - "source_location": null + "arc4_name": "uint64", + "n": "64" }, - "name": "result" + "source_location": null }, - { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 124, - "end_line": 124, - "column": 11, - "end_column": 24 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "0", - "teal_alias": null - } - ], - "comment": null - }, - "operator": "==", - "rhs": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/arc4-types.algo.ts", - "line": 124, - "end_line": 124, - "column": 29, - "end_column": 30 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 + "name": "result" }, - "value": "0", - "teal_alias": null - } + { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 124, + "end_line": 124, + "column": 11, + "end_column": 24 + }, + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "value": "0", + "teal_alias": null + } + ] + }, + "operator": "==", + "rhs": { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/arc4-types.algo.ts", + "line": 124, + "end_line": 124, + "column": 29, + "end_column": 30 + }, + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "value": "0", + "teal_alias": null } - ], - "comment": null + }, + "error_message": null } }, { diff --git a/tests/approvals/out/array-destructuring/array-destructuring.awst.json b/tests/approvals/out/array-destructuring/array-destructuring.awst.json index 1d67bb78..24e2da40 100644 --- a/tests/approvals/out/array-destructuring/array-destructuring.awst.json +++ b/tests/approvals/out/array-destructuring/array-destructuring.awst.json @@ -1728,7 +1728,7 @@ "end_column": 17 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/array-destructuring.algo.ts", "line": 27, @@ -1743,65 +1743,61 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/array-destructuring.algo.ts", + "line": 27, + "end_line": 27, + "column": 9, + "end_column": 16 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/array-destructuring.algo.ts", "line": 27, "end_line": 27, "column": 9, - "end_column": 16 + "end_column": 10 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/array-destructuring.algo.ts", - "line": 27, - "end_line": 27, - "column": 9, - "end_column": 10 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "x" + "name": "x" + }, + "operator": "==", + "rhs": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/array-destructuring.algo.ts", + "line": 27, + "end_line": 27, + "column": 15, + "end_column": 16 }, - "operator": "==", - "rhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/array-destructuring.algo.ts", - "line": 27, - "end_line": 27, - "column": 15, - "end_column": 16 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "b" - } + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "name": "b" } - ], - "comment": null + }, + "error_message": null } }, { @@ -1814,7 +1810,7 @@ "end_column": 17 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/array-destructuring.algo.ts", "line": 28, @@ -1829,65 +1825,61 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/array-destructuring.algo.ts", + "line": 28, + "end_line": 28, + "column": 9, + "end_column": 16 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/array-destructuring.algo.ts", "line": 28, "end_line": 28, "column": 9, - "end_column": 16 + "end_column": 10 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/array-destructuring.algo.ts", - "line": 28, - "end_line": 28, - "column": 9, - "end_column": 10 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "y" + "name": "y" + }, + "operator": "==", + "rhs": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/array-destructuring.algo.ts", + "line": 28, + "end_line": 28, + "column": 15, + "end_column": 16 }, - "operator": "==", - "rhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/array-destructuring.algo.ts", - "line": 28, - "end_line": 28, - "column": 15, - "end_column": 16 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "a" - } + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "name": "a" } - ], - "comment": null + }, + "error_message": null } } ], diff --git a/tests/approvals/out/assert-match/assert-match.awst b/tests/approvals/out/assert-match/assert-match.awst index a981a9f7..8e66f0f2 100644 --- a/tests/approvals/out/assert-match/assert-match.awst +++ b/tests/approvals/out/assert-match/assert-match.awst @@ -1,10 +1,10 @@ subroutine testSelf(): void { - assert(txn() == global()) + assert(txn() == global(), comment=assert target is match for conditions) } subroutine test(x: group_transaction_pay): void { - assert(gtxns(x) <= 50000 and gtxns(x) >= 0 and gtxns(x) == txn() and gtxns(x) == global() and gtxns(x) == global() and gtxns(x) > 1 and gtxns(x) < 1099511627776) + assert(gtxns(x) <= 50000 and gtxns(x) >= 0 and gtxns(x) == txn() and gtxns(x) == global() and gtxns(x) == global() and gtxns(x) > 1 and gtxns(x) < 1099511627776, comment=assert target is match for conditions) } contract AssertMatchContract { diff --git a/tests/approvals/out/assert-match/assert-match.awst.json b/tests/approvals/out/assert-match/assert-match.awst.json index c3d4747b..bdc90631 100644 --- a/tests/approvals/out/assert-match/assert-match.awst.json +++ b/tests/approvals/out/assert-match/assert-match.awst.json @@ -36,7 +36,7 @@ "end_column": 4 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/assert-match.algo.ts", "line": 4, @@ -51,11 +51,24 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/assert-match.algo.ts", + "line": 4, + "end_line": 6, + "column": 2, + "end_column": 4 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/assert-match.algo.ts", "line": 4, @@ -65,61 +78,42 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "account", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/assert-match.algo.ts", - "line": 4, - "end_line": 6, - "column": 2, - "end_column": 4 - }, - "wtype": { - "_type": "WType", - "name": "account", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "op_code": "txn", - "immediates": [ - "Receiver" - ], - "stack_args": [], - "comment": null + "op_code": "txn", + "immediates": [ + "Receiver" + ], + "stack_args": [] + }, + "operator": "==", + "rhs": { + "_type": "IntrinsicCall", + "source_location": { + "file": "tests/approvals/assert-match.algo.ts", + "line": 5, + "end_line": 5, + "column": 14, + "end_column": 46 }, - "operator": "==", - "rhs": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/assert-match.algo.ts", - "line": 5, - "end_line": 5, - "column": 14, - "end_column": 46 - }, - "wtype": { - "_type": "WType", - "name": "account", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "op_code": "global", - "immediates": [ - "CurrentApplicationAddress" - ], - "stack_args": [], - "comment": null - } + "wtype": { + "_type": "WType", + "name": "account", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "op_code": "global", + "immediates": [ + "CurrentApplicationAddress" + ], + "stack_args": [] } - ], - "comment": "assert target is match for conditions" + }, + "error_message": "assert target is match for conditions" } } ], @@ -192,7 +186,7 @@ "end_column": 4 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/assert-match.algo.ts", "line": 10, @@ -207,10 +201,23 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { + "condition": { + "_type": "BooleanBinaryOperation", + "source_location": { + "file": "tests/approvals/assert-match.algo.ts", + "line": 10, + "end_line": 17, + "column": 2, + "end_column": 4 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "left": { "_type": "BooleanBinaryOperation", "source_location": { "file": "tests/approvals/assert-match.algo.ts", @@ -291,7 +298,7 @@ "scalar_type": 2 }, "left": { - "_type": "BooleanBinaryOperation", + "_type": "NumericComparisonExpression", "source_location": { "file": "tests/approvals/assert-match.algo.ts", "line": 10, @@ -306,8 +313,8 @@ "ephemeral": false, "scalar_type": 2 }, - "left": { - "_type": "NumericComparisonExpression", + "lhs": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/assert-match.algo.ts", "line": 10, @@ -317,160 +324,61 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/assert-match.algo.ts", - "line": 10, - "end_line": 17, - "column": 2, - "end_column": 4 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "op_code": "gtxns", - "immediates": [ - "Amount" - ], - "stack_args": [ - { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/assert-match.algo.ts", - "line": 10, - "end_line": 10, - "column": 14, - "end_column": 15 - }, - "wtype": { - "_type": "WGroupTransaction", - "name": "group_transaction_pay", - "immutable": true, - "ephemeral": false, - "scalar_type": 2, - "transaction_type": 1 - }, - "name": "x" - } - ], - "comment": null - }, - "operator": "<=", - "rhs": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/assert-match.algo.ts", - "line": 11, - "end_line": 11, - "column": 27, - "end_column": 32 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "50000", - "teal_alias": null - } + "op_code": "gtxns", + "immediates": [ + "Amount" + ], + "stack_args": [ + { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/assert-match.algo.ts", + "line": 10, + "end_line": 10, + "column": 14, + "end_column": 15 + }, + "wtype": { + "_type": "WGroupTransaction", + "name": "group_transaction_pay", + "immutable": true, + "ephemeral": false, + "scalar_type": 2, + "transaction_type": 1 + }, + "name": "x" + } + ] }, - "op": "and", - "right": { - "_type": "NumericComparisonExpression", + "operator": "<=", + "rhs": { + "_type": "IntegerConstant", "source_location": { "file": "tests/approvals/assert-match.algo.ts", - "line": 10, - "end_line": 17, - "column": 2, - "end_column": 4 + "line": 11, + "end_line": 11, + "column": 27, + "end_column": 32 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/assert-match.algo.ts", - "line": 10, - "end_line": 17, - "column": 2, - "end_column": 4 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "op_code": "gtxns", - "immediates": [ - "Amount" - ], - "stack_args": [ - { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/assert-match.algo.ts", - "line": 10, - "end_line": 10, - "column": 14, - "end_column": 15 - }, - "wtype": { - "_type": "WGroupTransaction", - "name": "group_transaction_pay", - "immutable": true, - "ephemeral": false, - "scalar_type": 2, - "transaction_type": 1 - }, - "name": "x" - } - ], - "comment": null - }, - "operator": ">=", - "rhs": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/assert-match.algo.ts", - "line": 11, - "end_line": 11, - "column": 24, - "end_column": 25 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "0", - "teal_alias": null - } + "value": "50000", + "teal_alias": null } }, "op": "and", "right": { - "_type": "BytesComparisonExpression", + "_type": "NumericComparisonExpression", "source_location": { "file": "tests/approvals/assert-match.algo.ts", "line": 10, @@ -496,14 +404,14 @@ }, "wtype": { "_type": "WType", - "name": "account", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1 + "scalar_type": 2 }, "op_code": "gtxns", "immediates": [ - "Sender" + "Amount" ], "stack_args": [ { @@ -525,32 +433,27 @@ }, "name": "x" } - ], - "comment": null + ] }, - "operator": "==", + "operator": ">=", "rhs": { - "_type": "IntrinsicCall", + "_type": "IntegerConstant", "source_location": { "file": "tests/approvals/assert-match.algo.ts", - "line": 12, - "end_line": 12, - "column": 12, - "end_column": 22 + "line": 11, + "end_line": 11, + "column": 24, + "end_column": 25 }, "wtype": { "_type": "WType", - "name": "account", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1 + "scalar_type": 2 }, - "op_code": "txn", - "immediates": [ - "Sender" - ], - "stack_args": [], - "comment": null + "value": "0", + "teal_alias": null } } }, @@ -589,7 +492,7 @@ }, "op_code": "gtxns", "immediates": [ - "Receiver" + "Sender" ], "stack_args": [ { @@ -611,18 +514,17 @@ }, "name": "x" } - ], - "comment": null + ] }, "operator": "==", "rhs": { "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/assert-match.algo.ts", - "line": 13, - "end_line": 13, - "column": 14, - "end_column": 46 + "line": 12, + "end_line": 12, + "column": 12, + "end_column": 22 }, "wtype": { "_type": "WType", @@ -631,12 +533,11 @@ "ephemeral": false, "scalar_type": 1 }, - "op_code": "global", + "op_code": "txn", "immediates": [ - "CurrentApplicationAddress" + "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, @@ -675,7 +576,7 @@ }, "op_code": "gtxns", "immediates": [ - "CloseRemainderTo" + "Receiver" ], "stack_args": [ { @@ -697,18 +598,17 @@ }, "name": "x" } - ], - "comment": null + ] }, "operator": "==", "rhs": { "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/assert-match.algo.ts", - "line": 14, - "end_line": 14, - "column": 22, - "end_column": 40 + "line": 13, + "end_line": 13, + "column": 14, + "end_column": 46 }, "wtype": { "_type": "WType", @@ -719,16 +619,15 @@ }, "op_code": "global", "immediates": [ - "ZeroAddress" + "CurrentApplicationAddress" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, "op": "and", "right": { - "_type": "NumericComparisonExpression", + "_type": "BytesComparisonExpression", "source_location": { "file": "tests/approvals/assert-match.algo.ts", "line": 10, @@ -754,14 +653,14 @@ }, "wtype": { "_type": "WType", - "name": "uint64", + "name": "account", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, "op_code": "gtxns", "immediates": [ - "FirstValid" + "CloseRemainderTo" ], "stack_args": [ { @@ -783,28 +682,30 @@ }, "name": "x" } - ], - "comment": null + ] }, - "operator": ">", + "operator": "==", "rhs": { - "_type": "IntegerConstant", + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/assert-match.algo.ts", - "line": 15, - "end_line": 15, - "column": 31, - "end_column": 32 + "line": 14, + "end_line": 14, + "column": 22, + "end_column": 40 }, "wtype": { "_type": "WType", - "name": "uint64", + "name": "account", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "value": "1", - "teal_alias": null + "op_code": "global", + "immediates": [ + "ZeroAddress" + ], + "stack_args": [] } } }, @@ -843,7 +744,7 @@ }, "op_code": "gtxns", "immediates": [ - "LastValid" + "FirstValid" ], "stack_args": [ { @@ -865,18 +766,17 @@ }, "name": "x" } - ], - "comment": null + ] }, - "operator": "<", + "operator": ">", "rhs": { "_type": "IntegerConstant", "source_location": { "file": "tests/approvals/assert-match.algo.ts", - "line": 16, - "end_line": 16, - "column": 27, - "end_column": 34 + "line": 15, + "end_line": 15, + "column": 31, + "end_column": 32 }, "wtype": { "_type": "WType", @@ -885,13 +785,93 @@ "ephemeral": false, "scalar_type": 2 }, - "value": "1099511627776", + "value": "1", "teal_alias": null } } + }, + "op": "and", + "right": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/assert-match.algo.ts", + "line": 10, + "end_line": 17, + "column": 2, + "end_column": 4 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "IntrinsicCall", + "source_location": { + "file": "tests/approvals/assert-match.algo.ts", + "line": 10, + "end_line": 17, + "column": 2, + "end_column": 4 + }, + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "op_code": "gtxns", + "immediates": [ + "LastValid" + ], + "stack_args": [ + { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/assert-match.algo.ts", + "line": 10, + "end_line": 10, + "column": 14, + "end_column": 15 + }, + "wtype": { + "_type": "WGroupTransaction", + "name": "group_transaction_pay", + "immutable": true, + "ephemeral": false, + "scalar_type": 2, + "transaction_type": 1 + }, + "name": "x" + } + ] + }, + "operator": "<", + "rhs": { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/assert-match.algo.ts", + "line": 16, + "end_line": 16, + "column": 27, + "end_column": 34 + }, + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "value": "1099511627776", + "teal_alias": null + } } - ], - "comment": "assert target is match for conditions" + }, + "error_message": "assert target is match for conditions" } } ], @@ -1015,8 +995,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, diff --git a/tests/approvals/out/biguint-expressions/biguint-expressions.awst b/tests/approvals/out/biguint-expressions/biguint-expressions.awst index 9f5d784f..203b0da4 100644 --- a/tests/approvals/out/biguint-expressions/biguint-expressions.awst +++ b/tests/approvals/out/biguint-expressions/biguint-expressions.awst @@ -21,7 +21,7 @@ subroutine testOps(smaller: biguint, larger: biguint): void assert(larger > smaller) assert(larger >= larger) assert(smaller == smaller) - assert(smaller == reinterpret_cast(concat(bzero(4), reinterpret_cast(smaller)))) + assert(smaller == reinterpret_cast(concat(bzero(4), reinterpret_cast(smaller))), comment=Leading zeros should be ignored in equality) } contract DemoContract { diff --git a/tests/approvals/out/biguint-expressions/biguint-expressions.awst.json b/tests/approvals/out/biguint-expressions/biguint-expressions.awst.json index 7e83c2bd..8056bac5 100644 --- a/tests/approvals/out/biguint-expressions/biguint-expressions.awst.json +++ b/tests/approvals/out/biguint-expressions/biguint-expressions.awst.json @@ -172,8 +172,7 @@ }, "value": true } - ], - "comment": null + ] } } }, @@ -239,8 +238,7 @@ }, "value": false } - ], - "comment": null + ] } } }, @@ -480,8 +478,7 @@ }, "name": "a" } - ], - "comment": null + ] } } }, @@ -583,8 +580,7 @@ "name": "a" } } - ], - "comment": null + ] } } }, @@ -650,8 +646,7 @@ }, "name": "b" } - ], - "comment": null + ] } } }, @@ -787,7 +782,7 @@ "end_column": 26 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/biguint-expressions.algo.ts", "line": 22, @@ -802,65 +797,61 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/biguint-expressions.algo.ts", + "line": 22, + "end_line": 22, + "column": 9, + "end_column": 25 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/biguint-expressions.algo.ts", "line": 22, "end_line": 22, "column": 9, - "end_column": 25 + "end_column": 16 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "biguint", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/biguint-expressions.algo.ts", - "line": 22, - "end_line": 22, - "column": 9, - "end_column": 16 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "smaller" + "name": "smaller" + }, + "operator": "<", + "rhs": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/biguint-expressions.algo.ts", + "line": 22, + "end_line": 22, + "column": 19, + "end_column": 25 }, - "operator": "<", - "rhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/biguint-expressions.algo.ts", - "line": 22, - "end_line": 22, - "column": 19, - "end_column": 25 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "larger" - } + "wtype": { + "_type": "WType", + "name": "biguint", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "name": "larger" } - ], - "comment": null + }, + "error_message": null } }, { @@ -873,7 +864,7 @@ "end_column": 28 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/biguint-expressions.algo.ts", "line": 23, @@ -888,65 +879,61 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/biguint-expressions.algo.ts", + "line": 23, + "end_line": 23, + "column": 9, + "end_column": 27 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/biguint-expressions.algo.ts", "line": 23, "end_line": 23, "column": 9, - "end_column": 27 + "end_column": 16 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "biguint", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/biguint-expressions.algo.ts", - "line": 23, - "end_line": 23, - "column": 9, - "end_column": 16 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "smaller" + "name": "smaller" + }, + "operator": "<=", + "rhs": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/biguint-expressions.algo.ts", + "line": 23, + "end_line": 23, + "column": 20, + "end_column": 27 }, - "operator": "<=", - "rhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/biguint-expressions.algo.ts", - "line": 23, - "end_line": 23, - "column": 20, - "end_column": 27 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "smaller" - } + "wtype": { + "_type": "WType", + "name": "biguint", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "name": "smaller" } - ], - "comment": null + }, + "error_message": null } }, { @@ -959,7 +946,7 @@ "end_column": 26 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/biguint-expressions.algo.ts", "line": 24, @@ -974,65 +961,61 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/biguint-expressions.algo.ts", + "line": 24, + "end_line": 24, + "column": 9, + "end_column": 25 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/biguint-expressions.algo.ts", "line": 24, "end_line": 24, "column": 9, - "end_column": 25 + "end_column": 15 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "biguint", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/biguint-expressions.algo.ts", - "line": 24, - "end_line": 24, - "column": 9, - "end_column": 15 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "larger" + "name": "larger" + }, + "operator": ">", + "rhs": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/biguint-expressions.algo.ts", + "line": 24, + "end_line": 24, + "column": 18, + "end_column": 25 }, - "operator": ">", - "rhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/biguint-expressions.algo.ts", - "line": 24, - "end_line": 24, - "column": 18, - "end_column": 25 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "smaller" - } + "wtype": { + "_type": "WType", + "name": "biguint", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "name": "smaller" } - ], - "comment": null + }, + "error_message": null } }, { @@ -1045,7 +1028,7 @@ "end_column": 26 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/biguint-expressions.algo.ts", "line": 25, @@ -1060,65 +1043,61 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/biguint-expressions.algo.ts", + "line": 25, + "end_line": 25, + "column": 9, + "end_column": 25 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/biguint-expressions.algo.ts", "line": 25, "end_line": 25, "column": 9, - "end_column": 25 + "end_column": 15 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "biguint", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/biguint-expressions.algo.ts", - "line": 25, - "end_line": 25, - "column": 9, - "end_column": 15 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "larger" + "name": "larger" + }, + "operator": ">=", + "rhs": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/biguint-expressions.algo.ts", + "line": 25, + "end_line": 25, + "column": 19, + "end_column": 25 }, - "operator": ">=", - "rhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/biguint-expressions.algo.ts", - "line": 25, - "end_line": 25, - "column": 19, - "end_column": 25 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "larger" - } + "wtype": { + "_type": "WType", + "name": "biguint", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "name": "larger" } - ], - "comment": null + }, + "error_message": null } }, { @@ -1131,7 +1110,7 @@ "end_column": 38 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/biguint-expressions.algo.ts", "line": 26, @@ -1146,65 +1125,61 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/biguint-expressions.algo.ts", + "line": 26, + "end_line": 26, + "column": 9, + "end_column": 37 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/biguint-expressions.algo.ts", "line": 26, "end_line": 26, "column": 9, - "end_column": 37 + "end_column": 16 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "biguint", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/biguint-expressions.algo.ts", - "line": 26, - "end_line": 26, - "column": 9, - "end_column": 16 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "smaller" + "name": "smaller" + }, + "operator": "==", + "rhs": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/biguint-expressions.algo.ts", + "line": 26, + "end_line": 26, + "column": 29, + "end_column": 36 }, - "operator": "==", - "rhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/biguint-expressions.algo.ts", - "line": 26, - "end_line": 26, - "column": 29, - "end_column": 36 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "smaller" - } + "wtype": { + "_type": "WType", + "name": "biguint", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "name": "smaller" } - ], - "comment": null + }, + "error_message": null } }, { @@ -1217,7 +1192,7 @@ "end_column": 112 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/biguint-expressions.algo.ts", "line": 27, @@ -1232,162 +1207,156 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/biguint-expressions.algo.ts", + "line": 27, + "end_line": 27, + "column": 9, + "end_column": 64 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/biguint-expressions.algo.ts", "line": 27, "end_line": 27, "column": 9, - "end_column": 64 + "end_column": 16 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "biguint", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/biguint-expressions.algo.ts", - "line": 27, - "end_line": 27, - "column": 9, - "end_column": 16 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "smaller" + "name": "smaller" + }, + "operator": "==", + "rhs": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/biguint-expressions.algo.ts", + "line": 27, + "end_line": 27, + "column": 21, + "end_column": 64 + }, + "wtype": { + "_type": "WType", + "name": "biguint", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 }, - "operator": "==", - "rhs": { - "_type": "ReinterpretCast", + "expr": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/biguint-expressions.algo.ts", "line": 27, "end_line": 27, - "column": 21, - "end_column": 64 + "column": 29, + "end_column": 63 }, "wtype": { "_type": "WType", - "name": "biguint", + "name": "bytes", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "expr": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/biguint-expressions.algo.ts", - "line": 27, - "end_line": 27, - "column": 29, - "end_column": 63 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 + "op_code": "concat", + "immediates": [], + "stack_args": [ + { + "_type": "IntrinsicCall", + "source_location": { + "file": "tests/approvals/biguint-expressions.algo.ts", + "line": 27, + "end_line": 27, + "column": 29, + "end_column": 40 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "op_code": "bzero", + "immediates": [], + "stack_args": [ + { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/biguint-expressions.algo.ts", + "line": 27, + "end_line": 27, + "column": 38, + "end_column": 39 + }, + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "value": "4", + "teal_alias": null + } + ] }, - "op_code": "concat", - "immediates": [], - "stack_args": [ - { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/biguint-expressions.algo.ts", - "line": 27, - "end_line": 27, - "column": 29, - "end_column": 40 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "op_code": "bzero", - "immediates": [], - "stack_args": [ - { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/biguint-expressions.algo.ts", - "line": 27, - "end_line": 27, - "column": 38, - "end_column": 39 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "4", - "teal_alias": null - } - ], - "comment": null + { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/biguint-expressions.algo.ts", + "line": 27, + "end_line": 27, + "column": 48, + "end_column": 62 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 }, - { - "_type": "ReinterpretCast", + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/biguint-expressions.algo.ts", "line": 27, "end_line": 27, - "column": 48, - "end_column": 62 + "column": 54, + "end_column": 61 }, "wtype": { "_type": "WType", - "name": "bytes", + "name": "biguint", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/biguint-expressions.algo.ts", - "line": 27, - "end_line": 27, - "column": 54, - "end_column": 61 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "smaller" - } + "name": "smaller" } - ], - "comment": null - } + } + ] } } - ], - "comment": "Leading zeros should be ignored in equality" + }, + "error_message": "Leading zeros should be ignored in equality" } } ], @@ -1511,8 +1480,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, @@ -1693,8 +1661,7 @@ "value": "4", "teal_alias": null } - ], - "comment": null + ] } } ] diff --git a/tests/approvals/out/boolean-conversions/boolean-conversions.awst b/tests/approvals/out/boolean-conversions/boolean-conversions.awst index ec33a1bd..2a930b1e 100644 --- a/tests/approvals/out/boolean-conversions/boolean-conversions.awst +++ b/tests/approvals/out/boolean-conversions/boolean-conversions.awst @@ -1,18 +1,18 @@ subroutine test_truthyness(a: uint64, b: uint64, c: string, d: bytes, e: uint64): void { - assert(True) - assert(True) - assert(!Boolean(0)) - assert(Boolean(1)) - assert(!Boolean(bitlen(0))) - assert(Boolean(bitlen(1))) - assert(!Boolean(len(0x))) - assert(Boolean(len("abc"))) + assert(True, comment=Zero is falsy) + assert(True, comment=Non zero is truthy) + assert(!Boolean(0), comment=Zero is falsy) + assert(Boolean(1), comment=Non zero is truthy) + assert(!Boolean(bitlen(0)), comment=Zero is falsy) + assert(Boolean(bitlen(1)), comment=Non zero is truthy) + assert(!Boolean(len(0x)), comment=Empty is falsy) + assert(Boolean(len("abc")), comment=Non empty is truthy) empty: string = "" - assert(!Boolean(len(empty))) - assert(Boolean(len("abc"))) - assert(!False) - assert(True) + assert(!Boolean(len(empty)), comment=Empty is falsy) + assert(Boolean(len("abc")), comment=Non empty is truthy) + assert(!False, comment=False is falsy) + assert(True, comment=True is truthy) } subroutine test_booleans_are_equal(): void { diff --git a/tests/approvals/out/boolean-conversions/boolean-conversions.awst.json b/tests/approvals/out/boolean-conversions/boolean-conversions.awst.json index a1a11dcb..32b1b2d3 100644 --- a/tests/approvals/out/boolean-conversions/boolean-conversions.awst.json +++ b/tests/approvals/out/boolean-conversions/boolean-conversions.awst.json @@ -127,7 +127,7 @@ "end_column": 29 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 5, @@ -142,29 +142,25 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BoolConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 5, - "end_line": 5, - "column": 9, - "end_column": 11 - }, - "wtype": { - "_type": "WType", - "name": "bool", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": true - } - ], - "comment": "Zero is falsy" + "condition": { + "_type": "BoolConstant", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 5, + "end_line": 5, + "column": 9, + "end_column": 11 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "value": true + }, + "error_message": "Zero is falsy" } }, { @@ -177,7 +173,7 @@ "end_column": 33 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 6, @@ -192,29 +188,25 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BoolConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 6, - "end_line": 6, - "column": 2, - "end_column": 33 - }, - "wtype": { - "_type": "WType", - "name": "bool", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": true - } - ], - "comment": "Non zero is truthy" + "condition": { + "_type": "BoolConstant", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 6, + "end_line": 6, + "column": 2, + "end_column": 33 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "value": true + }, + "error_message": "Non zero is truthy" } }, { @@ -227,7 +219,7 @@ "end_column": 37 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 7, @@ -242,11 +234,24 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "Not", + "condition": { + "_type": "Not", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 7, + "end_line": 7, + "column": 9, + "end_column": 19 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 7, @@ -262,44 +267,27 @@ "scalar_type": 2 }, "expr": { - "_type": "ReinterpretCast", + "_type": "IntegerConstant", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 7, "end_line": 7, - "column": 9, - "end_column": 19 + "column": 17, + "end_column": 18 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 7, - "end_line": 7, - "column": 17, - "end_column": 18 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "0", - "teal_alias": null - } + "value": "0", + "teal_alias": null } } - ], - "comment": "Zero is falsy" + }, + "error_message": "Zero is falsy" } }, { @@ -312,7 +300,7 @@ "end_column": 41 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 8, @@ -327,47 +315,43 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "ReinterpretCast", + "condition": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 8, + "end_line": 8, + "column": 2, + "end_column": 41 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { + "_type": "IntegerConstant", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 8, "end_line": 8, - "column": 2, - "end_column": 41 + "column": 16, + "end_column": 17 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 8, - "end_line": 8, - "column": 16, - "end_column": 17 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "1", - "teal_alias": null - } + "value": "1", + "teal_alias": null } - ], - "comment": "Non zero is truthy" + }, + "error_message": "Non zero is truthy" } }, { @@ -380,7 +364,7 @@ "end_column": 38 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 9, @@ -395,11 +379,24 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "Not", + "condition": { + "_type": "Not", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 9, + "end_line": 9, + "column": 9, + "end_column": 20 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 9, @@ -415,7 +412,7 @@ "scalar_type": 2 }, "expr": { - "_type": "ReinterpretCast", + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 9, @@ -425,56 +422,38 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 9, - "end_line": 9, - "column": 9, - "end_column": 20 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "op_code": "bitlen", - "immediates": [], - "stack_args": [ - { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 9, - "end_line": 9, - "column": 18, - "end_column": 19 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "0", - "teal_alias": null - } - ], - "comment": null - } + "op_code": "bitlen", + "immediates": [], + "stack_args": [ + { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 9, + "end_line": 9, + "column": 18, + "end_column": 19 + }, + "wtype": { + "_type": "WType", + "name": "biguint", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "0", + "teal_alias": null + } + ] } } - ], - "comment": "Zero is falsy" + }, + "error_message": "Zero is falsy" } }, { @@ -487,7 +466,7 @@ "end_column": 42 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 10, @@ -502,11 +481,24 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "ReinterpretCast", + "condition": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 10, + "end_line": 10, + "column": 2, + "end_column": 42 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 10, @@ -516,55 +508,37 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 10, - "end_line": 10, - "column": 2, - "end_column": 42 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "op_code": "bitlen", - "immediates": [], - "stack_args": [ - { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 10, - "end_line": 10, - "column": 17, - "end_column": 18 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "1", - "teal_alias": null - } - ], - "comment": null - } + "op_code": "bitlen", + "immediates": [], + "stack_args": [ + { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 10, + "end_line": 10, + "column": 17, + "end_column": 18 + }, + "wtype": { + "_type": "WType", + "name": "biguint", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "1", + "teal_alias": null + } + ] } - ], - "comment": "Non zero is truthy" + }, + "error_message": "Non zero is truthy" } }, { @@ -577,7 +551,7 @@ "end_column": 36 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 11, @@ -592,11 +566,24 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "Not", + "condition": { + "_type": "Not", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 11, + "end_line": 11, + "column": 9, + "end_column": 17 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 11, @@ -612,7 +599,7 @@ "scalar_type": 2 }, "expr": { - "_type": "ReinterpretCast", + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 11, @@ -622,56 +609,38 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 11, - "end_line": 11, - "column": 9, - "end_column": 17 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "op_code": "len", - "immediates": [], - "stack_args": [ - { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 11, - "end_line": 11, - "column": 10, - "end_column": 17 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "", - "encoding": "unknown" - } - ], - "comment": null - } + "op_code": "len", + "immediates": [], + "stack_args": [ + { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 11, + "end_line": 11, + "column": 10, + "end_column": 17 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "", + "encoding": "unknown" + } + ] } } - ], - "comment": "Empty is falsy" + }, + "error_message": "Empty is falsy" } }, { @@ -684,7 +653,7 @@ "end_column": 45 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 12, @@ -699,11 +668,24 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "ReinterpretCast", + "condition": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 12, + "end_line": 12, + "column": 2, + "end_column": 45 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 12, @@ -713,55 +695,37 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 12, - "end_line": 12, - "column": 2, - "end_column": 45 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "op_code": "len", - "immediates": [], - "stack_args": [ - { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 12, - "end_line": 12, - "column": 15, - "end_column": 20 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "VPaz", - "encoding": "utf8" - } - ], - "comment": null - } + "op_code": "len", + "immediates": [], + "stack_args": [ + { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 12, + "end_line": 12, + "column": 15, + "end_column": 20 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "VPaz", + "encoding": "utf8" + } + ] } - ], - "comment": "Non empty is truthy" + }, + "error_message": "Non empty is truthy" } }, { @@ -820,7 +784,7 @@ "end_column": 34 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 14, @@ -835,11 +799,24 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "Not", + "condition": { + "_type": "Not", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 14, + "end_line": 14, + "column": 9, + "end_column": 15 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 14, @@ -855,7 +832,7 @@ "scalar_type": 2 }, "expr": { - "_type": "ReinterpretCast", + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 14, @@ -865,55 +842,37 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 14, - "end_line": 14, - "column": 9, - "end_column": 15 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "op_code": "len", - "immediates": [], - "stack_args": [ - { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 14, - "end_line": 14, - "column": 10, - "end_column": 15 - }, - "wtype": { - "_type": "WType", - "name": "string", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "empty" - } - ], - "comment": null - } + "op_code": "len", + "immediates": [], + "stack_args": [ + { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 14, + "end_line": 14, + "column": 10, + "end_column": 15 + }, + "wtype": { + "_type": "WType", + "name": "string", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "name": "empty" + } + ] } } - ], - "comment": "Empty is falsy" + }, + "error_message": "Empty is falsy" } }, { @@ -926,7 +885,7 @@ "end_column": 38 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 15, @@ -941,11 +900,24 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "ReinterpretCast", + "condition": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 15, + "end_line": 15, + "column": 2, + "end_column": 38 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 15, @@ -955,54 +927,36 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 15, - "end_line": 15, - "column": 2, - "end_column": 38 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "op_code": "len", - "immediates": [], - "stack_args": [ - { - "_type": "StringConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 15, - "end_line": 15, - "column": 9, - "end_column": 14 - }, - "wtype": { - "_type": "WType", - "name": "string", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "abc" - } - ], - "comment": null - } + "op_code": "len", + "immediates": [], + "stack_args": [ + { + "_type": "StringConstant", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 15, + "end_line": 15, + "column": 9, + "end_column": 14 + }, + "wtype": { + "_type": "WType", + "name": "string", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "abc" + } + ] } - ], - "comment": "Non empty is truthy" + }, + "error_message": "Non empty is truthy" } }, { @@ -1015,7 +969,7 @@ "end_column": 34 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 16, @@ -1030,16 +984,29 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "Not", + "condition": { + "_type": "Not", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 16, + "end_line": 16, + "column": 9, + "end_column": 15 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { + "_type": "BoolConstant", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 16, "end_line": 16, - "column": 9, + "column": 10, "end_column": 15 }, "wtype": { @@ -1049,27 +1016,10 @@ "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "BoolConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 16, - "end_line": 16, - "column": 10, - "end_column": 15 - }, - "wtype": { - "_type": "WType", - "name": "bool", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": false - } + "value": false } - ], - "comment": "False is falsy" + }, + "error_message": "False is falsy" } }, { @@ -1082,7 +1032,7 @@ "end_column": 32 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 17, @@ -1097,29 +1047,25 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BoolConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 17, - "end_line": 17, - "column": 9, - "end_column": 13 - }, - "wtype": { - "_type": "WType", - "name": "bool", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": true - } - ], - "comment": "True is truthy" + "condition": { + "_type": "BoolConstant", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 17, + "end_line": 17, + "column": 9, + "end_column": 13 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "value": true + }, + "error_message": "True is truthy" } } ], @@ -1172,7 +1118,7 @@ "end_column": 35 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 22, @@ -1187,17 +1133,30 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 22, + "end_line": 22, + "column": 9, + "end_column": 34 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "Not", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 22, "end_line": 22, "column": 9, - "end_column": 34 + "end_column": 19 }, "wtype": { "_type": "WType", @@ -1206,7 +1165,7 @@ "ephemeral": false, "scalar_type": 2 }, - "lhs": { + "expr": { "_type": "Not", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", @@ -1223,7 +1182,7 @@ "scalar_type": 2 }, "expr": { - "_type": "Not", + "_type": "BoolConstant", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 22, @@ -1238,28 +1197,28 @@ "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "BoolConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 22, - "end_line": 22, - "column": 9, - "end_column": 19 - }, - "wtype": { - "_type": "WType", - "name": "bool", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": true - } + "value": true } + } + }, + "operator": "==", + "rhs": { + "_type": "Not", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 22, + "end_line": 22, + "column": 24, + "end_column": 34 }, - "operator": "==", - "rhs": { + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { "_type": "Not", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", @@ -1276,7 +1235,7 @@ "scalar_type": 2 }, "expr": { - "_type": "Not", + "_type": "BoolConstant", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 22, @@ -1290,30 +1249,13 @@ "immutable": true, "ephemeral": false, "scalar_type": 2 - }, - "expr": { - "_type": "BoolConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 22, - "end_line": 22, - "column": 24, - "end_column": 34 - }, - "wtype": { - "_type": "WType", - "name": "bool", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": true - } + }, + "value": true } } } - ], - "comment": null + }, + "error_message": null } }, { @@ -1326,7 +1268,7 @@ "end_column": 51 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 23, @@ -1341,17 +1283,30 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 23, + "end_line": 23, + "column": 9, + "end_column": 50 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "Not", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 23, "end_line": 23, "column": 9, - "end_column": 50 + "end_column": 27 }, "wtype": { "_type": "WType", @@ -1360,7 +1315,7 @@ "ephemeral": false, "scalar_type": 2 }, - "lhs": { + "expr": { "_type": "Not", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", @@ -1377,7 +1332,7 @@ "scalar_type": 2 }, "expr": { - "_type": "Not", + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 23, @@ -1393,45 +1348,45 @@ "scalar_type": 2 }, "expr": { - "_type": "ReinterpretCast", + "_type": "IntegerConstant", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 23, "end_line": 23, - "column": 9, - "end_column": 27 + "column": 24, + "end_column": 25 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 23, - "end_line": 23, - "column": 24, - "end_column": 25 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "1", - "teal_alias": null - } + "value": "1", + "teal_alias": null } } + } + }, + "operator": "==", + "rhs": { + "_type": "Not", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 23, + "end_line": 23, + "column": 32, + "end_column": 50 }, - "operator": "==", - "rhs": { + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { "_type": "Not", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", @@ -1448,7 +1403,7 @@ "scalar_type": 2 }, "expr": { - "_type": "Not", + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 23, @@ -1464,46 +1419,29 @@ "scalar_type": 2 }, "expr": { - "_type": "ReinterpretCast", + "_type": "IntegerConstant", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 23, "end_line": 23, - "column": 32, - "end_column": 50 + "column": 47, + "end_column": 48 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 23, - "end_line": 23, - "column": 47, - "end_column": 48 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "5", - "teal_alias": null - } + "value": "5", + "teal_alias": null } } } } - ], - "comment": null + }, + "error_message": null } }, { @@ -1516,7 +1454,7 @@ "end_column": 53 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 24, @@ -1531,17 +1469,30 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 24, + "end_line": 24, + "column": 9, + "end_column": 52 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "Not", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 24, "end_line": 24, "column": 9, - "end_column": 52 + "end_column": 28 }, "wtype": { "_type": "WType", @@ -1550,7 +1501,7 @@ "ephemeral": false, "scalar_type": 2 }, - "lhs": { + "expr": { "_type": "Not", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", @@ -1567,7 +1518,7 @@ "scalar_type": 2 }, "expr": { - "_type": "Not", + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 24, @@ -1583,7 +1534,7 @@ "scalar_type": 2 }, "expr": { - "_type": "ReinterpretCast", + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 24, @@ -1593,57 +1544,56 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 24, - "end_line": 24, - "column": 9, - "end_column": 28 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "op_code": "bitlen", - "immediates": [], - "stack_args": [ - { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 24, - "end_line": 24, - "column": 25, - "end_column": 26 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "1", - "teal_alias": null - } - ], - "comment": null - } + "op_code": "bitlen", + "immediates": [], + "stack_args": [ + { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 24, + "end_line": 24, + "column": 25, + "end_column": 26 + }, + "wtype": { + "_type": "WType", + "name": "biguint", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "1", + "teal_alias": null + } + ] } } + } + }, + "operator": "==", + "rhs": { + "_type": "Not", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 24, + "end_line": 24, + "column": 33, + "end_column": 52 }, - "operator": "==", - "rhs": { + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { "_type": "Not", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", @@ -1660,7 +1610,7 @@ "scalar_type": 2 }, "expr": { - "_type": "Not", + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 24, @@ -1676,7 +1626,7 @@ "scalar_type": 2 }, "expr": { - "_type": "ReinterpretCast", + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 24, @@ -1686,58 +1636,40 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 24, - "end_line": 24, - "column": 33, - "end_column": 52 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "op_code": "bitlen", - "immediates": [], - "stack_args": [ - { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 24, - "end_line": 24, - "column": 49, - "end_column": 50 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "5", - "teal_alias": null - } - ], - "comment": null - } + "op_code": "bitlen", + "immediates": [], + "stack_args": [ + { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 24, + "end_line": 24, + "column": 49, + "end_column": 50 + }, + "wtype": { + "_type": "WType", + "name": "biguint", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "5", + "teal_alias": null + } + ] } } } } - ], - "comment": null + }, + "error_message": null } }, { @@ -1750,7 +1682,7 @@ "end_column": 60 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 25, @@ -1765,17 +1697,30 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 25, + "end_line": 25, + "column": 9, + "end_column": 59 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "BytesComparisonExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 25, "end_line": 25, "column": 9, - "end_column": 59 + "end_column": 30 }, "wtype": { "_type": "WType", @@ -1785,7 +1730,27 @@ "scalar_type": 2 }, "lhs": { - "_type": "BytesComparisonExpression", + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 25, + "end_line": 25, + "column": 23, + "end_column": 28 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "VPaz", + "encoding": "utf8" + }, + "operator": "!=", + "rhs": { + "_type": "BytesConstant", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 25, @@ -1795,54 +1760,54 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 25, - "end_line": 25, - "column": 23, - "end_column": 28 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "VPaz", - "encoding": "utf8" + "value": "", + "encoding": "unknown" + } + }, + "operator": "==", + "rhs": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 25, + "end_line": 25, + "column": 35, + "end_column": 59 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 25, + "end_line": 25, + "column": 49, + "end_column": 57 }, - "operator": "!=", - "rhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 25, - "end_line": 25, - "column": 9, - "end_column": 30 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "", - "encoding": "unknown" - } + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "VPa!sWo7", + "encoding": "utf8" }, - "operator": "==", + "operator": "!=", "rhs": { - "_type": "BytesComparisonExpression", + "_type": "BytesConstant", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 25, @@ -1852,54 +1817,17 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 - }, - "lhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 25, - "end_line": 25, - "column": 49, - "end_column": 57 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "VPa!sWo7", - "encoding": "utf8" + "scalar_type": 1 }, - "operator": "!=", - "rhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 25, - "end_line": 25, - "column": 35, - "end_column": 59 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "", - "encoding": "unknown" - } + "value": "", + "encoding": "unknown" } } - ], - "comment": null + }, + "error_message": null } }, { @@ -1912,7 +1840,7 @@ "end_column": 46 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 27, @@ -1927,17 +1855,30 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 27, + "end_line": 27, + "column": 9, + "end_column": 45 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "BytesComparisonExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 27, "end_line": 27, "column": 9, - "end_column": 45 + "end_column": 23 }, "wtype": { "_type": "WType", @@ -1947,7 +1888,27 @@ "scalar_type": 2 }, "lhs": { - "_type": "BytesComparisonExpression", + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 27, + "end_line": 27, + "column": 17, + "end_column": 22 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "VPaz", + "encoding": "utf8" + }, + "operator": "!=", + "rhs": { + "_type": "BytesConstant", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 27, @@ -1957,54 +1918,54 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 27, - "end_line": 27, - "column": 17, - "end_column": 22 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "VPaz", - "encoding": "utf8" + "value": "", + "encoding": "unknown" + } + }, + "operator": "==", + "rhs": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 27, + "end_line": 27, + "column": 28, + "end_column": 45 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 27, + "end_line": 27, + "column": 36, + "end_column": 44 }, - "operator": "!=", - "rhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 27, - "end_line": 27, - "column": 9, - "end_column": 23 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "", - "encoding": "unknown" - } + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "VPa!sWo7", + "encoding": "utf8" }, - "operator": "==", + "operator": "!=", "rhs": { - "_type": "BytesComparisonExpression", + "_type": "BytesConstant", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 27, @@ -2014,54 +1975,17 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 - }, - "lhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 27, - "end_line": 27, - "column": 36, - "end_column": 44 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "VPa!sWo7", - "encoding": "utf8" + "scalar_type": 1 }, - "operator": "!=", - "rhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 27, - "end_line": 27, - "column": 28, - "end_column": 45 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "", - "encoding": "unknown" - } + "value": "", + "encoding": "unknown" } } - ], - "comment": null + }, + "error_message": null } }, { @@ -2120,7 +2044,7 @@ "end_column": 21 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 30, @@ -2135,16 +2059,29 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "Not", + "condition": { + "_type": "Not", + "source_location": { + "file": "tests/approvals/boolean-conversions.algo.ts", + "line": 30, + "end_line": 30, + "column": 9, + "end_column": 20 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/boolean-conversions.algo.ts", "line": 30, "end_line": 30, - "column": 9, + "column": 10, "end_column": 20 }, "wtype": { @@ -2154,27 +2091,10 @@ "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/boolean-conversions.algo.ts", - "line": 30, - "end_line": 30, - "column": 10, - "end_column": 20 - }, - "wtype": { - "_type": "WType", - "name": "bool", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "boolNoArgs" - } + "name": "boolNoArgs" } - ], - "comment": null + }, + "error_message": null } } ], diff --git a/tests/approvals/out/boolean-expressions/boolean-expressions.awst b/tests/approvals/out/boolean-expressions/boolean-expressions.awst index 2a6bdf6b..98c99c5d 100644 --- a/tests/approvals/out/boolean-expressions/boolean-expressions.awst +++ b/tests/approvals/out/boolean-expressions/boolean-expressions.awst @@ -1,7 +1,7 @@ subroutine test(a: uint64, b: uint64, c: string, d: bytes, e: uint64): bool { x: uint64 = (Boolean((#0 = (Boolean(a) ? a : b))) ? #0 : e) - assert(Boolean((Boolean((#1 = (Boolean(a) ? b : a))) ? e : #1))) + assert(Boolean((Boolean((#1 = (Boolean(a) ? b : a))) ? e : #1)), comment=a or b) y: uint64 = (Boolean(a) ? b : a) z: uint64 = (Boolean(a) and Boolean(len(d)) or Boolean(y) ? (Boolean(x) ? x : y) : (Boolean(x) ? y : x)) if (Boolean(a) or Boolean(len(c)) and Boolean(len(d))) { diff --git a/tests/approvals/out/boolean-expressions/boolean-expressions.awst.json b/tests/approvals/out/boolean-expressions/boolean-expressions.awst.json index 9e477e73..e8163d00 100644 --- a/tests/approvals/out/boolean-expressions/boolean-expressions.awst.json +++ b/tests/approvals/out/boolean-expressions/boolean-expressions.awst.json @@ -419,7 +419,7 @@ "end_column": 31 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/boolean-expressions.algo.ts", "line": 6, @@ -434,183 +434,55 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "ReinterpretCast", + "condition": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/boolean-expressions.algo.ts", + "line": 6, + "end_line": 6, + "column": 2, + "end_column": 31 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { + "_type": "ConditionalExpression", "source_location": { "file": "tests/approvals/boolean-expressions.algo.ts", "line": 6, "end_line": 6, - "column": 2, - "end_column": 31 + "column": 9, + "end_column": 20 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "ConditionalExpression", + "condition": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/boolean-expressions.algo.ts", "line": 6, "end_line": 6, "column": 9, - "end_column": 20 + "end_column": 15 }, "wtype": { "_type": "WType", - "name": "uint64", + "name": "bool", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "condition": { - "_type": "ReinterpretCast", - "source_location": { - "file": "tests/approvals/boolean-expressions.algo.ts", - "line": 6, - "end_line": 6, - "column": 9, - "end_column": 15 - }, - "wtype": { - "_type": "WType", - "name": "bool", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "expr": { - "_type": "SingleEvaluation", - "source_location": { - "file": "tests/approvals/boolean-expressions.algo.ts", - "line": 6, - "end_line": 6, - "column": 9, - "end_column": 15 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "source": { - "_type": "ConditionalExpression", - "source_location": { - "file": "tests/approvals/boolean-expressions.algo.ts", - "line": 6, - "end_line": 6, - "column": 9, - "end_column": 15 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "condition": { - "_type": "ReinterpretCast", - "source_location": { - "file": "tests/approvals/boolean-expressions.algo.ts", - "line": 6, - "end_line": 6, - "column": 9, - "end_column": 10 - }, - "wtype": { - "_type": "WType", - "name": "bool", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/boolean-expressions.algo.ts", - "line": 6, - "end_line": 6, - "column": 9, - "end_column": 10 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "a" - } - }, - "true_expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/boolean-expressions.algo.ts", - "line": 6, - "end_line": 6, - "column": 14, - "end_column": 15 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "b" - }, - "false_expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/boolean-expressions.algo.ts", - "line": 6, - "end_line": 6, - "column": 9, - "end_column": 10 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "a" - } - }, - "id": "1" - } - }, - "true_expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/boolean-expressions.algo.ts", - "line": 6, - "end_line": 6, - "column": 19, - "end_column": 20 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "e" - }, - "false_expr": { + "expr": { "_type": "SingleEvaluation", "source_location": { "file": "tests/approvals/boolean-expressions.algo.ts", @@ -716,10 +588,134 @@ }, "id": "1" } + }, + "true_expr": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/boolean-expressions.algo.ts", + "line": 6, + "end_line": 6, + "column": 19, + "end_column": 20 + }, + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "name": "e" + }, + "false_expr": { + "_type": "SingleEvaluation", + "source_location": { + "file": "tests/approvals/boolean-expressions.algo.ts", + "line": 6, + "end_line": 6, + "column": 9, + "end_column": 15 + }, + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "source": { + "_type": "ConditionalExpression", + "source_location": { + "file": "tests/approvals/boolean-expressions.algo.ts", + "line": 6, + "end_line": 6, + "column": 9, + "end_column": 15 + }, + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "condition": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/boolean-expressions.algo.ts", + "line": 6, + "end_line": 6, + "column": 9, + "end_column": 10 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/boolean-expressions.algo.ts", + "line": 6, + "end_line": 6, + "column": 9, + "end_column": 10 + }, + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "name": "a" + } + }, + "true_expr": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/boolean-expressions.algo.ts", + "line": 6, + "end_line": 6, + "column": 14, + "end_column": 15 + }, + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "name": "b" + }, + "false_expr": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/boolean-expressions.algo.ts", + "line": 6, + "end_line": 6, + "column": 9, + "end_column": 10 + }, + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "name": "a" + } + }, + "id": "1" } } - ], - "comment": "a or b" + }, + "error_message": "a or b" } }, { @@ -1002,8 +998,7 @@ }, "name": "d" } - ], - "comment": null + ] } } }, @@ -1352,8 +1347,7 @@ }, "name": "c" } - ], - "comment": null + ] } }, "op": "and", @@ -1410,8 +1404,7 @@ }, "name": "d" } - ], - "comment": null + ] } } } diff --git a/tests/approvals/out/box-proxies/box-proxies.awst.json b/tests/approvals/out/box-proxies/box-proxies.awst.json index 4b456160..103c104a 100644 --- a/tests/approvals/out/box-proxies/box-proxies.awst.json +++ b/tests/approvals/out/box-proxies/box-proxies.awst.json @@ -202,7 +202,7 @@ "end_column": 34 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 9, @@ -217,102 +217,98 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 9, + "end_line": 9, + "column": 9, + "end_column": 33 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "BoxValueExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 9, "end_line": 9, "column": 9, - "end_column": 33 + "end_column": 18 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "string", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "BoxValueExpression", + "key": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 9, "end_line": 9, "column": 9, - "end_column": 18 + "end_column": 12 }, "wtype": { "_type": "WType", - "name": "string", + "name": "box_key", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "key": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 9, - "end_line": 9, - "column": 9, - "end_column": 12 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "box" - }, - "exists_assertion_message": "Box must have value" + "name": "box" }, - "operator": "==", - "rhs": { - "_type": "BoxValueExpression", + "exists_assertion_message": "Box must have value" + }, + "operator": "==", + "rhs": { + "_type": "BoxValueExpression", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 9, + "end_line": 9, + "column": 23, + "end_column": 33 + }, + "wtype": { + "_type": "WType", + "name": "string", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "key": { + "_type": "BytesConstant", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", - "line": 9, - "end_line": 9, - "column": 23, - "end_column": 33 + "line": 4, + "end_line": 4, + "column": 38, + "end_column": 41 }, "wtype": { "_type": "WType", - "name": "string", + "name": "box_key", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "key": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 4, - "end_line": 4, - "column": 38, - "end_column": 41 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "K>", - "encoding": "utf8" - }, - "exists_assertion_message": "Box must have value" - } + "value": "K>", + "encoding": "utf8" + }, + "exists_assertion_message": "Box must have value" } - ], - "comment": null + }, + "error_message": null } }, { @@ -325,7 +321,7 @@ "end_column": 35 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 11, @@ -340,17 +336,30 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BooleanBinaryOperation", + "condition": { + "_type": "BooleanBinaryOperation", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 11, + "end_line": 11, + "column": 9, + "end_column": 34 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "left": { + "_type": "StateExists", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 11, "end_line": 11, "column": 9, - "end_column": 34 + "end_column": 19 }, "wtype": { "_type": "WType", @@ -359,8 +368,8 @@ "ephemeral": false, "scalar_type": 2 }, - "left": { - "_type": "StateExists", + "field": { + "_type": "BoxValueExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 11, @@ -370,51 +379,51 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "string", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "field": { - "_type": "BoxValueExpression", + "key": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 11, "end_line": 11, "column": 9, - "end_column": 19 + "end_column": 12 }, "wtype": { "_type": "WType", - "name": "string", + "name": "box_key", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "key": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 11, - "end_line": 11, - "column": 9, - "end_column": 12 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "box" - }, - "exists_assertion_message": "Box must have value" - } + "name": "box" + }, + "exists_assertion_message": "Box must have value" + } + }, + "op": "and", + "right": { + "_type": "StateExists", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 11, + "end_line": 11, + "column": 23, + "end_column": 34 }, - "op": "and", - "right": { - "_type": "StateExists", + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "field": { + "_type": "BoxValueExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 11, @@ -424,52 +433,35 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "string", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "field": { - "_type": "BoxValueExpression", + "key": { + "_type": "BytesConstant", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", - "line": 11, - "end_line": 11, - "column": 23, - "end_column": 34 + "line": 4, + "end_line": 4, + "column": 38, + "end_column": 41 }, "wtype": { "_type": "WType", - "name": "string", + "name": "box_key", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "key": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 4, - "end_line": 4, - "column": 38, - "end_column": 41 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "K>", - "encoding": "utf8" - }, - "exists_assertion_message": "Box must have value" - } + "value": "K>", + "encoding": "utf8" + }, + "exists_assertion_message": "Box must have value" } } - ], - "comment": null + }, + "error_message": null } }, { @@ -482,7 +474,7 @@ "end_column": 20 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 13, @@ -497,27 +489,40 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "ReinterpretCast", + "condition": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 13, + "end_line": 13, + "column": 2, + "end_column": 20 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { + "_type": "CheckedMaybe", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 13, "end_line": 13, - "column": 2, - "end_column": 20 + "column": 9, + "end_column": 19 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, "expr": { - "_type": "CheckedMaybe", + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 13, @@ -526,91 +531,73 @@ "end_column": 19 }, "wtype": { - "_type": "WType", - "name": "uint64", + "_type": "WTuple", + "name": "tuple", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": null, + "types": [ + { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + } + ] }, - "expr": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 13, - "end_line": 13, - "column": 9, - "end_column": 19 - }, - "wtype": { - "_type": "WTuple", - "name": "tuple", - "immutable": true, - "ephemeral": false, - "scalar_type": null, - "types": [ - { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - { - "_type": "WType", - "name": "bool", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - } - ] - }, - "op_code": "box_len", - "immediates": [], - "stack_args": [ - { - "_type": "BoxValueExpression", + "op_code": "box_len", + "immediates": [], + "stack_args": [ + { + "_type": "BoxValueExpression", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 13, + "end_line": 13, + "column": 9, + "end_column": 19 + }, + "wtype": { + "_type": "WType", + "name": "string", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "key": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 13, "end_line": 13, "column": 9, - "end_column": 19 + "end_column": 12 }, "wtype": { "_type": "WType", - "name": "string", + "name": "box_key", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "key": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 13, - "end_line": 13, - "column": 9, - "end_column": 12 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "box" - }, - "exists_assertion_message": "Box must have value" - } - ], - "comment": null - }, - "comment": "Box must exist" - } + "name": "box" + }, + "exists_assertion_message": "Box must have value" + } + ] + }, + "comment": "Box must exist" } - ], - "comment": null + }, + "error_message": null } }, { @@ -750,7 +737,7 @@ "end_column": 37 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 17, @@ -765,17 +752,30 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BooleanBinaryOperation", + "condition": { + "_type": "BooleanBinaryOperation", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 17, + "end_line": 17, + "column": 9, + "end_column": 36 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "left": { + "_type": "Not", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 17, "end_line": 17, "column": 9, - "end_column": 36 + "end_column": 20 }, "wtype": { "_type": "WType", @@ -784,13 +784,13 @@ "ephemeral": false, "scalar_type": 2 }, - "left": { - "_type": "Not", + "expr": { + "_type": "StateExists", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 17, "end_line": 17, - "column": 9, + "column": 10, "end_column": 20 }, "wtype": { @@ -800,8 +800,8 @@ "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "StateExists", + "field": { + "_type": "BoxValueExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 17, @@ -811,57 +811,57 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "string", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "field": { - "_type": "BoxValueExpression", + "key": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 17, "end_line": 17, "column": 10, - "end_column": 20 + "end_column": 13 }, "wtype": { "_type": "WType", - "name": "string", + "name": "box_key", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "key": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 17, - "end_line": 17, - "column": 10, - "end_column": 13 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "box" - }, - "exists_assertion_message": "Box must have value" - } + "name": "box" + }, + "exists_assertion_message": "Box must have value" } + } + }, + "op": "and", + "right": { + "_type": "Not", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 17, + "end_line": 17, + "column": 24, + "end_column": 36 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 }, - "op": "and", - "right": { - "_type": "Not", + "expr": { + "_type": "StateExists", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 17, "end_line": 17, - "column": 24, + "column": 25, "end_column": 36 }, "wtype": { @@ -871,8 +871,8 @@ "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "StateExists", + "field": { + "_type": "BoxValueExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 17, @@ -882,53 +882,36 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "string", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "field": { - "_type": "BoxValueExpression", + "key": { + "_type": "BytesConstant", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", - "line": 17, - "end_line": 17, - "column": 25, - "end_column": 36 + "line": 4, + "end_line": 4, + "column": 38, + "end_column": 41 }, "wtype": { "_type": "WType", - "name": "string", + "name": "box_key", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "key": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 4, - "end_line": 4, - "column": 38, - "end_column": 41 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "K>", - "encoding": "utf8" - }, - "exists_assertion_message": "Box must have value" - } + "value": "K>", + "encoding": "utf8" + }, + "exists_assertion_message": "Box must have value" } } } - ], - "comment": null + }, + "error_message": null } }, { @@ -987,7 +970,7 @@ "end_column": 80 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 20, @@ -1002,33 +985,46 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 20, + "end_line": 20, + "column": 9, + "end_column": 79 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "StateGet", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 20, "end_line": 20, "column": 9, - "end_column": 79 + "end_column": 42 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "string", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "StateGet", + "field": { + "_type": "BoxValueExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 20, "end_line": 20, "column": 9, - "end_column": 42 + "end_column": 17 }, "wtype": { "_type": "WType", @@ -1037,71 +1033,35 @@ "ephemeral": false, "scalar_type": 1 }, - "field": { - "_type": "BoxValueExpression", + "key": { + "_type": "BytesConstant", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", - "line": 20, - "end_line": 20, - "column": 9, - "end_column": 17 + "line": 4, + "end_line": 4, + "column": 38, + "end_column": 41 }, "wtype": { "_type": "WType", - "name": "string", + "name": "box_key", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "key": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 4, - "end_line": 4, - "column": 38, - "end_column": 41 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "K>", - "encoding": "utf8" - }, - "exists_assertion_message": "Box must have value" + "value": "K>", + "encoding": "utf8" }, - "default": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 20, - "end_line": 20, - "column": 29, - "end_column": 39 - }, - "wtype": { - "_type": "WType", - "name": "string", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "defaultVal" - } + "exists_assertion_message": "Box must have value" }, - "operator": "==", - "rhs": { - "_type": "StateGet", + "default": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 20, "end_line": 20, - "column": 47, - "end_column": 79 + "column": 29, + "end_column": 39 }, "wtype": { "_type": "WType", @@ -1110,64 +1070,83 @@ "ephemeral": false, "scalar_type": 1 }, - "field": { - "_type": "BoxValueExpression", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 20, - "end_line": 20, - "column": 47, - "end_column": 54 - }, - "wtype": { - "_type": "WType", - "name": "string", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "key": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 20, - "end_line": 20, - "column": 47, - "end_column": 50 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "box" - }, - "exists_assertion_message": "Box must have value" + "name": "defaultVal" + } + }, + "operator": "==", + "rhs": { + "_type": "StateGet", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 20, + "end_line": 20, + "column": 47, + "end_column": 79 + }, + "wtype": { + "_type": "WType", + "name": "string", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "field": { + "_type": "BoxValueExpression", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 20, + "end_line": 20, + "column": 47, + "end_column": 54 + }, + "wtype": { + "_type": "WType", + "name": "string", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 }, - "default": { + "key": { "_type": "VarExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 20, "end_line": 20, - "column": 66, - "end_column": 76 + "column": 47, + "end_column": 50 }, "wtype": { "_type": "WType", - "name": "string", + "name": "box_key", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "name": "defaultVal" - } + "name": "box" + }, + "exists_assertion_message": "Box must have value" + }, + "default": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 20, + "end_line": 20, + "column": 66, + "end_column": 76 + }, + "wtype": { + "_type": "WType", + "name": "string", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "name": "defaultVal" } } - ], - "comment": null + }, + "error_message": null } }, { @@ -1330,7 +1309,7 @@ "end_column": 12 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 23, @@ -1345,16 +1324,29 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "Not", + "condition": { + "_type": "Not", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 23, + "end_line": 23, + "column": 9, + "end_column": 11 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 23, "end_line": 23, - "column": 9, + "column": 10, "end_column": 11 }, "wtype": { @@ -1364,27 +1356,10 @@ "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 23, - "end_line": 23, - "column": 10, - "end_column": 11 - }, - "wtype": { - "_type": "WType", - "name": "bool", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "e" - } + "name": "e" } - ], - "comment": null + }, + "error_message": null } }, { @@ -1611,7 +1586,7 @@ "end_column": 11 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 26, @@ -1626,29 +1601,25 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 26, - "end_line": 26, - "column": 9, - "end_column": 10 - }, - "wtype": { - "_type": "WType", - "name": "bool", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "e" - } - ], - "comment": null + "condition": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 26, + "end_line": 26, + "column": 9, + "end_column": 10 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "name": "e" + }, + "error_message": null } } ], @@ -1843,8 +1814,7 @@ "name": "key" } } - ], - "comment": null + ] }, "exists_assertion_message": "Box must have value" }, @@ -1965,8 +1935,7 @@ "name": "key" } } - ], - "comment": null + ] }, "exists_assertion_message": "Box must have value" }, @@ -1999,7 +1968,7 @@ "end_column": 25 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 35, @@ -2014,27 +1983,40 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "ReinterpretCast", + "condition": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 35, + "end_line": 35, + "column": 2, + "end_column": 25 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { + "_type": "CheckedMaybe", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 35, "end_line": 35, - "column": 2, - "end_column": 25 + "column": 9, + "end_column": 24 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, "expr": { - "_type": "CheckedMaybe", + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 35, @@ -2043,49 +2025,49 @@ "end_column": 24 }, "wtype": { - "_type": "WType", - "name": "uint64", + "_type": "WTuple", + "name": "tuple", "immutable": true, "ephemeral": false, - "scalar_type": 2 - }, - "expr": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 35, - "end_line": 35, - "column": 9, - "end_column": 24 - }, - "wtype": { - "_type": "WTuple", - "name": "tuple", - "immutable": true, - "ephemeral": false, - "scalar_type": null, - "types": [ - { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - { - "_type": "WType", - "name": "bool", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - } - ] - }, - "op_code": "box_len", - "immediates": [], - "stack_args": [ + "scalar_type": null, + "types": [ + { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, { - "_type": "BoxValueExpression", + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + } + ] + }, + "op_code": "box_len", + "immediates": [], + "stack_args": [ + { + "_type": "BoxValueExpression", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 35, + "end_line": 35, + "column": 9, + "end_column": 19 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "key": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 35, @@ -2095,96 +2077,77 @@ }, "wtype": { "_type": "WType", - "name": "bytes", + "name": "box_key", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "key": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 35, - "end_line": 35, - "column": 9, - "end_column": 19 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 + "op_code": "concat", + "immediates": [], + "stack_args": [ + { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 35, + "end_line": 35, + "column": 9, + "end_column": 12 + }, + "wtype": { + "_type": "WType", + "name": "box_key", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "name": "box" }, - "op_code": "concat", - "immediates": [], - "stack_args": [ - { + { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 35, + "end_line": 35, + "column": 9, + "end_column": 19 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "expr": { "_type": "VarExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 35, "end_line": 35, - "column": 9, - "end_column": 12 + "column": 20, + "end_column": 23 }, "wtype": { "_type": "WType", - "name": "box_key", + "name": "string", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "name": "box" - }, - { - "_type": "ReinterpretCast", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 35, - "end_line": 35, - "column": 9, - "end_column": 19 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 35, - "end_line": 35, - "column": 20, - "end_column": 23 - }, - "wtype": { - "_type": "WType", - "name": "string", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "key" - } + "name": "key" } - ], - "comment": null - }, - "exists_assertion_message": "Box must have value" - } - ], - "comment": null - }, - "comment": "Box must exist" - } + } + ] + }, + "exists_assertion_message": "Box must have value" + } + ] + }, + "comment": "Box must exist" } - ], - "comment": null + }, + "error_message": null } }, { @@ -2197,7 +2160,7 @@ "end_column": 27 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 37, @@ -2212,59 +2175,72 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "TupleItemExpression", + "condition": { + "_type": "TupleItemExpression", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 37, + "end_line": 37, + "column": 9, + "end_column": 26 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "base": { + "_type": "StateGetEx", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 37, "end_line": 37, "column": 9, - "end_column": 26 + "end_column": 23 }, "wtype": { - "_type": "WType", - "name": "bool", + "_type": "WTuple", + "name": "tuple", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": null, + "types": [ + { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + } + ] }, - "base": { - "_type": "StateGetEx", + "field": { + "_type": "BoxValueExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 37, "end_line": 37, "column": 9, - "end_column": 23 + "end_column": 18 }, "wtype": { - "_type": "WTuple", - "name": "tuple", + "_type": "WType", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": null, - "types": [ - { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - { - "_type": "WType", - "name": "bool", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - } - ] + "scalar_type": 1 }, - "field": { - "_type": "BoxValueExpression", + "key": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 37, @@ -2274,93 +2250,75 @@ }, "wtype": { "_type": "WType", - "name": "bytes", + "name": "box_key", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "key": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 37, - "end_line": 37, - "column": 9, - "end_column": 18 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 + "op_code": "concat", + "immediates": [], + "stack_args": [ + { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 37, + "end_line": 37, + "column": 9, + "end_column": 12 + }, + "wtype": { + "_type": "WType", + "name": "box_key", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "name": "box" }, - "op_code": "concat", - "immediates": [], - "stack_args": [ - { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 37, - "end_line": 37, - "column": 9, - "end_column": 12 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "box" + { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 37, + "end_line": 37, + "column": 9, + "end_column": 18 }, - { - "_type": "ReinterpretCast", + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 37, "end_line": 37, - "column": 9, - "end_column": 18 + "column": 19, + "end_column": 22 }, "wtype": { "_type": "WType", - "name": "bytes", + "name": "string", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 37, - "end_line": 37, - "column": 19, - "end_column": 22 - }, - "wtype": { - "_type": "WType", - "name": "string", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "key" - } + "name": "key" } - ], - "comment": null - }, - "exists_assertion_message": "Box must have value" - } - }, - "index": "1" - } - ], - "comment": null + } + ] + }, + "exists_assertion_message": "Box must have value" + } + }, + "index": "1" + }, + "error_message": null } }, { @@ -2373,7 +2331,7 @@ "end_column": 42 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 39, @@ -2388,27 +2346,40 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 39, + "end_line": 39, + "column": 9, + "end_column": 41 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "BoxValueExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 39, "end_line": 39, "column": 9, - "end_column": 41 + "end_column": 16 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "BoxValueExpression", + "key": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 39, @@ -2418,91 +2389,90 @@ }, "wtype": { "_type": "WType", - "name": "bytes", + "name": "box_key", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "key": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 39, - "end_line": 39, - "column": 9, - "end_column": 16 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 + "op_code": "concat", + "immediates": [], + "stack_args": [ + { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 39, + "end_line": 39, + "column": 9, + "end_column": 12 + }, + "wtype": { + "_type": "WType", + "name": "box_key", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "name": "box" }, - "op_code": "concat", - "immediates": [], - "stack_args": [ - { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 39, - "end_line": 39, - "column": 9, - "end_column": 12 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "box" + { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 39, + "end_line": 39, + "column": 9, + "end_column": 16 }, - { - "_type": "ReinterpretCast", + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 39, "end_line": 39, - "column": 9, - "end_column": 16 + "column": 17, + "end_column": 20 }, "wtype": { "_type": "WType", - "name": "bytes", + "name": "string", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 39, - "end_line": 39, - "column": 17, - "end_column": 20 - }, - "wtype": { - "_type": "WType", - "name": "string", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "key" - } + "name": "key" } - ], - "comment": null - }, - "exists_assertion_message": "Box must have value" + } + ] }, - "operator": "==", - "rhs": { - "_type": "BoxValueExpression", + "exists_assertion_message": "Box must have value" + }, + "operator": "==", + "rhs": { + "_type": "BoxValueExpression", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 39, + "end_line": 39, + "column": 26, + "end_column": 36 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "key": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 39, @@ -2512,92 +2482,74 @@ }, "wtype": { "_type": "WType", - "name": "bytes", + "name": "box_key", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "key": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 39, - "end_line": 39, - "column": 26, - "end_column": 36 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 + "op_code": "concat", + "immediates": [], + "stack_args": [ + { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 29, + "end_line": 29, + "column": 50, + "end_column": 52 + }, + "wtype": { + "_type": "WType", + "name": "box_key", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "", + "encoding": "utf8" }, - "op_code": "concat", - "immediates": [], - "stack_args": [ - { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 29, - "end_line": 29, - "column": 50, - "end_column": 52 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "", - "encoding": "utf8" + { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 39, + "end_line": 39, + "column": 26, + "end_column": 36 }, - { - "_type": "ReinterpretCast", + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 39, "end_line": 39, - "column": 26, - "end_column": 36 + "column": 37, + "end_column": 40 }, "wtype": { "_type": "WType", - "name": "bytes", + "name": "string", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 39, - "end_line": 39, - "column": 37, - "end_column": 40 - }, - "wtype": { - "_type": "WType", - "name": "string", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "key" - } + "name": "key" } - ], - "comment": null - }, - "exists_assertion_message": "Box must have value" - } + } + ] + }, + "exists_assertion_message": "Box must have value" } - ], - "comment": null + }, + "error_message": null } }, { @@ -2713,8 +2665,7 @@ "name": "key" } } - ], - "comment": null + ] }, "exists_assertion_message": "Box must have value" } @@ -2730,7 +2681,7 @@ "end_column": 104 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 43, @@ -2745,33 +2696,46 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 43, + "end_line": 43, + "column": 9, + "end_column": 103 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "StateGet", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 43, "end_line": 43, "column": 9, - "end_column": 103 + "end_column": 52 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "StateGet", + "field": { + "_type": "BoxValueExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 43, "end_line": 43, "column": 9, - "end_column": 52 + "end_column": 16 }, "wtype": { "_type": "WType", @@ -2780,8 +2744,8 @@ "ephemeral": false, "scalar_type": 1 }, - "field": { - "_type": "BoxValueExpression", + "key": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 43, @@ -2791,65 +2755,65 @@ }, "wtype": { "_type": "WType", - "name": "bytes", + "name": "box_key", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "key": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 43, - "end_line": 43, - "column": 9, - "end_column": 16 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 + "op_code": "concat", + "immediates": [], + "stack_args": [ + { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 43, + "end_line": 43, + "column": 9, + "end_column": 12 + }, + "wtype": { + "_type": "WType", + "name": "box_key", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "name": "box" }, - "op_code": "concat", - "immediates": [], - "stack_args": [ - { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 43, - "end_line": 43, - "column": 9, - "end_column": 12 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "box" + { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 43, + "end_line": 43, + "column": 9, + "end_column": 16 }, - { - "_type": "ReinterpretCast", + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "expr": { + "_type": "BytesBinaryOperation", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 43, "end_line": 43, - "column": 9, - "end_column": 16 + "column": 17, + "end_column": 26 }, "wtype": { "_type": "WType", - "name": "bytes", + "name": "string", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "expr": { + "left": { "_type": "BytesBinaryOperation", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", @@ -2866,7 +2830,7 @@ "scalar_type": 1 }, "left": { - "_type": "BytesBinaryOperation", + "_type": "StringConstant", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 43, @@ -2881,53 +2845,17 @@ "ephemeral": false, "scalar_type": 1 }, - "left": { - "_type": "StringConstant", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 43, - "end_line": 43, - "column": 17, - "end_column": 26 - }, - "wtype": { - "_type": "WType", - "name": "string", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "" - }, - "op": "+", - "right": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 43, - "end_line": 43, - "column": 20, - "end_column": 23 - }, - "wtype": { - "_type": "WType", - "name": "string", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "key" - } + "value": "" }, "op": "+", "right": { - "_type": "StringConstant", + "_type": "VarExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 43, "end_line": 43, - "column": 17, - "end_column": 26 + "column": 20, + "end_column": 23 }, "wtype": { "_type": "WType", @@ -2936,44 +2864,79 @@ "ephemeral": false, "scalar_type": 1 }, - "value": "x" + "name": "key" } + }, + "op": "+", + "right": { + "_type": "StringConstant", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 43, + "end_line": 43, + "column": 17, + "end_column": 26 + }, + "wtype": { + "_type": "WType", + "name": "string", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "x" } } - ], - "comment": null - }, - "exists_assertion_message": "Box must have value" + } + ] }, - "default": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 43, - "end_line": 43, - "column": 45, - "end_column": 48 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "Vg", - "encoding": "utf8" - } + "exists_assertion_message": "Box must have value" + }, + "default": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 43, + "end_line": 43, + "column": 45, + "end_column": 48 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "Vg", + "encoding": "utf8" + } + }, + "operator": "==", + "rhs": { + "_type": "StateGet", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 43, + "end_line": 43, + "column": 57, + "end_column": 103 }, - "operator": "==", - "rhs": { - "_type": "StateGet", + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "field": { + "_type": "BoxValueExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 43, "end_line": 43, "column": 57, - "end_column": 103 + "end_column": 67 }, "wtype": { "_type": "WType", @@ -2982,8 +2945,8 @@ "ephemeral": false, "scalar_type": 1 }, - "field": { - "_type": "BoxValueExpression", + "key": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 43, @@ -2993,66 +2956,66 @@ }, "wtype": { "_type": "WType", - "name": "bytes", + "name": "box_key", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "key": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 43, - "end_line": 43, - "column": 57, - "end_column": 67 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 + "op_code": "concat", + "immediates": [], + "stack_args": [ + { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 29, + "end_line": 29, + "column": 50, + "end_column": 52 + }, + "wtype": { + "_type": "WType", + "name": "box_key", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "", + "encoding": "utf8" }, - "op_code": "concat", - "immediates": [], - "stack_args": [ - { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 29, - "end_line": 29, - "column": 50, - "end_column": 52 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "", - "encoding": "utf8" + { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 43, + "end_line": 43, + "column": 57, + "end_column": 67 }, - { - "_type": "ReinterpretCast", + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "expr": { + "_type": "BytesBinaryOperation", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 43, "end_line": 43, - "column": 57, - "end_column": 67 + "column": 68, + "end_column": 77 }, "wtype": { "_type": "WType", - "name": "bytes", + "name": "string", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "expr": { + "left": { "_type": "BytesBinaryOperation", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", @@ -3069,7 +3032,7 @@ "scalar_type": 1 }, "left": { - "_type": "BytesBinaryOperation", + "_type": "StringConstant", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 43, @@ -3084,53 +3047,17 @@ "ephemeral": false, "scalar_type": 1 }, - "left": { - "_type": "StringConstant", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 43, - "end_line": 43, - "column": 68, - "end_column": 77 - }, - "wtype": { - "_type": "WType", - "name": "string", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "" - }, - "op": "+", - "right": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 43, - "end_line": 43, - "column": 71, - "end_column": 74 - }, - "wtype": { - "_type": "WType", - "name": "string", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "key" - } + "value": "" }, "op": "+", "right": { - "_type": "StringConstant", + "_type": "VarExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 43, "end_line": 43, - "column": 68, - "end_column": 77 + "column": 71, + "end_column": 74 }, "wtype": { "_type": "WType", @@ -3139,38 +3066,56 @@ "ephemeral": false, "scalar_type": 1 }, - "value": "x" + "name": "key" } + }, + "op": "+", + "right": { + "_type": "StringConstant", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 43, + "end_line": 43, + "column": 68, + "end_column": 77 + }, + "wtype": { + "_type": "WType", + "name": "string", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "x" } } - ], - "comment": null - }, - "exists_assertion_message": "Box must have value" + } + ] }, - "default": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 43, - "end_line": 43, - "column": 96, - "end_column": 99 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "Vg", - "encoding": "utf8" - } + "exists_assertion_message": "Box must have value" + }, + "default": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 43, + "end_line": 43, + "column": 96, + "end_column": 99 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "Vg", + "encoding": "utf8" } } - ], - "comment": null + }, + "error_message": null } } ], @@ -3363,8 +3308,7 @@ }, "exists_assertion_message": "Box must have value" } - ], - "comment": null + ] }, "index": "1" } @@ -3473,8 +3417,7 @@ "value": "1000", "teal_alias": null } - ], - "comment": null + ] } } ], @@ -3608,8 +3551,7 @@ }, "exists_assertion_message": "Box must have value" } - ], - "comment": null + ] }, "comment": "Box must exist" }, @@ -3736,8 +3678,7 @@ }, "name": "length" } - ], - "comment": null + ] } } ], @@ -3884,8 +3825,7 @@ }, "name": "someBytes" } - ], - "comment": null + ] } }, { @@ -3971,8 +3911,7 @@ }, "name": "someBytes" } - ], - "comment": null + ] } }, { @@ -4096,8 +4035,7 @@ "value": "00", "encoding": "base16" } - ], - "comment": null + ] } }, { @@ -4222,8 +4160,7 @@ "value": "00", "encoding": "base16" } - ], - "comment": null + ] } }, { @@ -4236,7 +4173,7 @@ "end_column": 49 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 59, @@ -4251,84 +4188,80 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 59, + "end_line": 59, + "column": 9, + "end_column": 48 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "BoxValueExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 59, "end_line": 59, "column": 9, - "end_column": 48 + "end_column": 18 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "BoxValueExpression", + "key": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/box-proxies.algo.ts", "line": 59, "end_line": 59, "column": 9, - "end_column": 18 + "end_column": 12 }, "wtype": { "_type": "WType", - "name": "bytes", + "name": "box_key", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "key": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 59, - "end_line": 59, - "column": 9, - "end_column": 12 - }, - "wtype": { - "_type": "WType", - "name": "box_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "box" - }, - "exists_assertion_message": "Box must have value" + "name": "box" }, - "operator": "==", - "rhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/box-proxies.algo.ts", - "line": 59, - "end_line": 59, - "column": 23, - "end_column": 48 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "{{a90", - "encoding": "base16" - } + "exists_assertion_message": "Box must have value" + }, + "operator": "==", + "rhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/box-proxies.algo.ts", + "line": 59, + "end_line": 59, + "column": 23, + "end_column": 48 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "{{a90", + "encoding": "base16" } - ], - "comment": null + }, + "error_message": null } } ], diff --git a/tests/approvals/out/byte-expressions/byte-expressions.awst b/tests/approvals/out/byte-expressions/byte-expressions.awst index 516de475..57411677 100644 --- a/tests/approvals/out/byte-expressions/byte-expressions.awst +++ b/tests/approvals/out/byte-expressions/byte-expressions.awst @@ -1,10 +1,10 @@ subroutine test(a: uint64, b: biguint, c: string): void { - assert(len(0x) == 0) - assert(itob(a) == itob(a)) - assert(0x0000000000000001 == 0x0000000000000001) + assert(len(0x) == 0, comment=Empty bytes has length of 0) + assert(itob(a) == itob(a), comment=Bytes(uint64) is equivalent to itob) + assert(0x0000000000000001 == 0x0000000000000001, comment=Bytes(uint64) returns an 8 byte encoding) assert(reinterpret_cast(256) == 0x0100) - assert(reinterpret_cast(reinterpret_cast(b)) == b) + assert(reinterpret_cast(reinterpret_cast(b)) == b, comment=Round trip of biguint to bytes and back results in the same value) assert(reinterpret_cast(reinterpret_cast(c)) == c) assert("123" == "123") assert(0x01020304 == 0x01020304) diff --git a/tests/approvals/out/byte-expressions/byte-expressions.awst.json b/tests/approvals/out/byte-expressions/byte-expressions.awst.json index 8221ffd9..c3751544 100644 --- a/tests/approvals/out/byte-expressions/byte-expressions.awst.json +++ b/tests/approvals/out/byte-expressions/byte-expressions.awst.json @@ -91,7 +91,7 @@ "end_column": 61 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 5, @@ -106,89 +106,84 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 5, + "end_line": 5, + "column": 9, + "end_column": 29 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 5, "end_line": 5, "column": 9, - "end_column": 29 + "end_column": 23 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/byte-expressions.algo.ts", - "line": 5, - "end_line": 5, - "column": 9, - "end_column": 23 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "op_code": "len", - "immediates": [], - "stack_args": [ - { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/byte-expressions.algo.ts", - "line": 5, - "end_line": 5, - "column": 9, - "end_column": 16 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "", - "encoding": "unknown" - } - ], - "comment": null + "op_code": "len", + "immediates": [], + "stack_args": [ + { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 5, + "end_line": 5, + "column": 9, + "end_column": 16 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "", + "encoding": "unknown" + } + ] + }, + "operator": "==", + "rhs": { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 5, + "end_line": 5, + "column": 28, + "end_column": 29 }, - "operator": "==", - "rhs": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/byte-expressions.algo.ts", - "line": 5, - "end_line": 5, - "column": 28, - "end_column": 29 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "0", - "teal_alias": null - } + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "value": "0", + "teal_alias": null } - ], - "comment": "Empty bytes has length of 0" + }, + "error_message": "Empty bytes has length of 0" } }, { @@ -201,7 +196,7 @@ "end_column": 72 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 6, @@ -216,109 +211,103 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 6, + "end_line": 6, + "column": 9, + "end_column": 32 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 6, "end_line": 6, "column": 9, - "end_column": 32 + "end_column": 17 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/byte-expressions.algo.ts", - "line": 6, - "end_line": 6, - "column": 9, - "end_column": 17 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "op_code": "itob", - "immediates": [], - "stack_args": [ - { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/byte-expressions.algo.ts", - "line": 6, - "end_line": 6, - "column": 15, - "end_column": 16 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "a" - } - ], - "comment": null + "op_code": "itob", + "immediates": [], + "stack_args": [ + { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 6, + "end_line": 6, + "column": 15, + "end_column": 16 + }, + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "name": "a" + } + ] + }, + "operator": "==", + "rhs": { + "_type": "IntrinsicCall", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 6, + "end_line": 6, + "column": 22, + "end_column": 32 }, - "operator": "==", - "rhs": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/byte-expressions.algo.ts", - "line": 6, - "end_line": 6, - "column": 22, - "end_column": 32 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "op_code": "itob", - "immediates": [], - "stack_args": [ - { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/byte-expressions.algo.ts", - "line": 6, - "end_line": 6, - "column": 30, - "end_column": 31 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "a" - } - ], - "comment": null - } + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "op_code": "itob", + "immediates": [], + "stack_args": [ + { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 6, + "end_line": 6, + "column": 30, + "end_column": 31 + }, + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "name": "a" + } + ] } - ], - "comment": "Bytes(uint64) is equivalent to itob" + }, + "error_message": "Bytes(uint64) is equivalent to itob" } }, { @@ -331,7 +320,7 @@ "end_column": 108 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 7, @@ -346,67 +335,63 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 7, + "end_line": 7, + "column": 9, + "end_column": 63 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "BytesConstant", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 7, "end_line": 7, "column": 9, - "end_column": 63 + "end_column": 25 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/byte-expressions.algo.ts", - "line": 7, - "end_line": 7, - "column": 9, - "end_column": 25 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "0000000001", - "encoding": "base16" + "value": "0000000001", + "encoding": "base16" + }, + "operator": "==", + "rhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 7, + "end_line": 7, + "column": 30, + "end_column": 63 }, - "operator": "==", - "rhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/byte-expressions.algo.ts", - "line": 7, - "end_line": 7, - "column": 30, - "end_column": 63 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "0000000001", - "encoding": "base16" - } + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "0000000001", + "encoding": "base16" } - ], - "comment": "Bytes(uint64) returns an 8 byte encoding" + }, + "error_message": "Bytes(uint64) returns an 8 byte encoding" } }, { @@ -419,7 +404,7 @@ "end_column": 55 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 8, @@ -434,84 +419,80 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 8, + "end_line": 8, + "column": 9, + "end_column": 54 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 8, "end_line": 8, "column": 9, - "end_column": 54 + "end_column": 28 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 - }, - "lhs": { - "_type": "ReinterpretCast", - "source_location": { - "file": "tests/approvals/byte-expressions.algo.ts", - "line": 8, - "end_line": 8, - "column": 9, - "end_column": 28 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/byte-expressions.algo.ts", - "line": 8, - "end_line": 8, - "column": 23, - "end_column": 26 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "256", - "teal_alias": null - } + "scalar_type": 1 }, - "operator": "==", - "rhs": { - "_type": "BytesConstant", + "expr": { + "_type": "IntegerConstant", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 8, "end_line": 8, - "column": 33, - "end_column": 54 + "column": 23, + "end_column": 26 }, "wtype": { "_type": "WType", - "name": "bytes", + "name": "biguint", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "value": "0RR", - "encoding": "base16" + "value": "256", + "teal_alias": null } + }, + "operator": "==", + "rhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 8, + "end_line": 8, + "column": 33, + "end_column": 54 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "0RR", + "encoding": "base16" } - ], - "comment": null + }, + "error_message": null } }, { @@ -524,7 +505,7 @@ "end_column": 102 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 9, @@ -539,99 +520,95 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 9, + "end_line": 9, + "column": 9, + "end_column": 32 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 9, "end_line": 9, "column": 9, - "end_column": 32 + "end_column": 26 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "biguint", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { + "expr": { "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 9, "end_line": 9, - "column": 9, - "end_column": 26 + "column": 17, + "end_column": 25 }, "wtype": { "_type": "WType", - "name": "biguint", + "name": "bytes", "immutable": true, "ephemeral": false, "scalar_type": 1 }, "expr": { - "_type": "ReinterpretCast", + "_type": "VarExpression", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 9, "end_line": 9, - "column": 17, - "end_column": 25 + "column": 23, + "end_column": 24 }, "wtype": { "_type": "WType", - "name": "bytes", + "name": "biguint", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/byte-expressions.algo.ts", - "line": 9, - "end_line": 9, - "column": 23, - "end_column": 24 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "b" - } + "name": "b" } - }, - "operator": "==", - "rhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/byte-expressions.algo.ts", - "line": 9, - "end_line": 9, - "column": 31, - "end_column": 32 - }, - "wtype": { - "_type": "WType", - "name": "biguint", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "b" } + }, + "operator": "==", + "rhs": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 9, + "end_line": 9, + "column": 31, + "end_column": 32 + }, + "wtype": { + "_type": "WType", + "name": "biguint", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "name": "b" } - ], - "comment": "Round trip of biguint to bytes and back results in the same value" + }, + "error_message": "Round trip of biguint to bytes and back results in the same value" } }, { @@ -644,7 +621,7 @@ "end_column": 32 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 10, @@ -659,99 +636,95 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 10, + "end_line": 10, + "column": 9, + "end_column": 31 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 10, "end_line": 10, "column": 9, - "end_column": 31 + "end_column": 25 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "string", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { + "expr": { "_type": "ReinterpretCast", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 10, "end_line": 10, - "column": 9, - "end_column": 25 + "column": 16, + "end_column": 24 }, "wtype": { "_type": "WType", - "name": "string", + "name": "bytes", "immutable": true, "ephemeral": false, "scalar_type": 1 }, "expr": { - "_type": "ReinterpretCast", + "_type": "VarExpression", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 10, "end_line": 10, - "column": 16, - "end_column": 24 + "column": 22, + "end_column": 23 }, "wtype": { "_type": "WType", - "name": "bytes", + "name": "string", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/byte-expressions.algo.ts", - "line": 10, - "end_line": 10, - "column": 22, - "end_column": 23 - }, - "wtype": { - "_type": "WType", - "name": "string", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "c" - } + "name": "c" } - }, - "operator": "==", - "rhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/byte-expressions.algo.ts", - "line": 10, - "end_line": 10, - "column": 30, - "end_column": 31 - }, - "wtype": { - "_type": "WType", - "name": "string", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "c" } + }, + "operator": "==", + "rhs": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 10, + "end_line": 10, + "column": 30, + "end_column": 31 + }, + "wtype": { + "_type": "WType", + "name": "string", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "name": "c" } - ], - "comment": null + }, + "error_message": null } }, { @@ -764,7 +737,7 @@ "end_column": 46 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 11, @@ -779,67 +752,63 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 11, + "end_line": 11, + "column": 9, + "end_column": 45 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "BytesConstant", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 11, "end_line": 11, - "column": 9, - "end_column": 45 + "column": 21, + "end_column": 26 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/byte-expressions.algo.ts", - "line": 11, - "end_line": 11, - "column": 21, - "end_column": 26 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "F)}j", - "encoding": "utf8" + "value": "F)}j", + "encoding": "utf8" + }, + "operator": "==", + "rhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 11, + "end_line": 11, + "column": 39, + "end_column": 44 }, - "operator": "==", - "rhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/byte-expressions.algo.ts", - "line": 11, - "end_line": 11, - "column": 39, - "end_column": 44 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "F)}j", - "encoding": "utf8" - } + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "F)}j", + "encoding": "utf8" } - ], - "comment": null + }, + "error_message": null } }, { @@ -852,7 +821,7 @@ "end_column": 59 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 12, @@ -867,67 +836,63 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 12, + "end_line": 12, + "column": 9, + "end_column": 58 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "BytesConstant", "source_location": { "file": "tests/approvals/byte-expressions.algo.ts", "line": 12, "end_line": 12, - "column": 9, - "end_column": 58 + "column": 15, + "end_column": 27 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/byte-expressions.algo.ts", - "line": 12, - "end_line": 12, - "column": 15, - "end_column": 27 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "0RjUA", - "encoding": "unknown" + "value": "0RjUA", + "encoding": "unknown" + }, + "operator": "==", + "rhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/byte-expressions.algo.ts", + "line": 12, + "end_line": 12, + "column": 33, + "end_column": 58 }, - "operator": "==", - "rhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/byte-expressions.algo.ts", - "line": 12, - "end_line": 12, - "column": 33, - "end_column": 58 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "0RjUA", - "encoding": "base16" - } + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "0RjUA", + "encoding": "base16" } - ], - "comment": null + }, + "error_message": null } } ], @@ -1051,8 +1016,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, diff --git a/tests/approvals/out/call-expressions/call-expressions.awst.json b/tests/approvals/out/call-expressions/call-expressions.awst.json index a58a00f7..204ef14b 100644 --- a/tests/approvals/out/call-expressions/call-expressions.awst.json +++ b/tests/approvals/out/call-expressions/call-expressions.awst.json @@ -108,8 +108,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, diff --git a/tests/approvals/out/destructured-params/destructured-params.awst.json b/tests/approvals/out/destructured-params/destructured-params.awst.json index 38b53c40..172f69f1 100644 --- a/tests/approvals/out/destructured-params/destructured-params.awst.json +++ b/tests/approvals/out/destructured-params/destructured-params.awst.json @@ -357,8 +357,7 @@ }, "name": "a" } - ], - "comment": null + ] }, { "_type": "VarExpression", @@ -378,8 +377,7 @@ }, "name": "b" } - ], - "comment": null + ] }, { "_type": "IntrinsicCall", @@ -418,14 +416,11 @@ }, "name": "c" } - ], - "comment": null + ] } - ], - "comment": null + ] } - ], - "comment": null + ] } } ], diff --git a/tests/approvals/out/destructuring-iterators/destructuring-iterators.awst.json b/tests/approvals/out/destructuring-iterators/destructuring-iterators.awst.json index f00ad79f..ed50d6b6 100644 --- a/tests/approvals/out/destructuring-iterators/destructuring-iterators.awst.json +++ b/tests/approvals/out/destructuring-iterators/destructuring-iterators.awst.json @@ -863,7 +863,7 @@ "end_column": 21 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/destructuring-iterators.algo.ts", "line": 14, @@ -878,66 +878,62 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/destructuring-iterators.algo.ts", + "line": 14, + "end_line": 14, + "column": 9, + "end_column": 20 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/destructuring-iterators.algo.ts", "line": 14, "end_line": 14, "column": 9, - "end_column": 20 + "end_column": 14 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/destructuring-iterators.algo.ts", - "line": 14, - "end_line": 14, - "column": 9, - "end_column": 14 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "total" + "name": "total" + }, + "operator": "==", + "rhs": { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/destructuring-iterators.algo.ts", + "line": 14, + "end_line": 14, + "column": 19, + "end_column": 20 }, - "operator": "==", - "rhs": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/destructuring-iterators.algo.ts", - "line": 14, - "end_line": 14, - "column": 19, - "end_column": 20 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "6", - "teal_alias": null - } + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "value": "6", + "teal_alias": null } - ], - "comment": null + }, + "error_message": null } } ], diff --git a/tests/approvals/out/ensure-budget/ensure-budget.awst.json b/tests/approvals/out/ensure-budget/ensure-budget.awst.json index 1a1b64b0..451baee0 100644 --- a/tests/approvals/out/ensure-budget/ensure-budget.awst.json +++ b/tests/approvals/out/ensure-budget/ensure-budget.awst.json @@ -107,8 +107,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, diff --git a/tests/approvals/out/global-state/global-state.awst b/tests/approvals/out/global-state/global-state.awst index 3f3a2038..95b77a57 100644 --- a/tests/approvals/out/global-state/global-state.awst +++ b/tests/approvals/out/global-state/global-state.awst @@ -12,8 +12,8 @@ contract TestContract if (!Boolean(txn())) { this.constructor() } - assert(STATE_EXISTS(GlobalState["testState"])) - assert(GlobalState["testState"] == 2) + assert(STATE_EXISTS(GlobalState["testState"]), comment=State should have value) + assert(GlobalState["testState"] == 2, comment=Value should equal 2) GlobalState["testState"]: uint64 = btoi(txnas(0)) return True } @@ -29,7 +29,7 @@ contract TestContract super.constructor() GlobalState["testState"]: uint64 = 2 GlobalState["TESTSTATE"]: uint64 = 5 - assert(GlobalState["baseTestState"] == "testing 123") + assert(GlobalState["baseTestState"] == "testing 123", comment=Base class state should be initialized after super call) GlobalState["noInitialInt"]: uint64 = someValue * GlobalState["testState"] } diff --git a/tests/approvals/out/global-state/global-state.awst.json b/tests/approvals/out/global-state/global-state.awst.json index f36d35bc..8848037c 100644 --- a/tests/approvals/out/global-state/global-state.awst.json +++ b/tests/approvals/out/global-state/global-state.awst.json @@ -108,8 +108,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, @@ -184,7 +183,7 @@ "end_column": 62 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/global-state.algo.ts", "line": 22, @@ -199,11 +198,24 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "StateExists", + "condition": { + "_type": "StateExists", + "source_location": { + "file": "tests/approvals/global-state.algo.ts", + "line": 22, + "end_line": 22, + "column": 11, + "end_column": 34 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "field": { + "_type": "AppStateExpression", "source_location": { "file": "tests/approvals/global-state.algo.ts", "line": 22, @@ -213,51 +225,34 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "field": { - "_type": "AppStateExpression", + "key": { + "_type": "BytesConstant", "source_location": { "file": "tests/approvals/global-state.algo.ts", - "line": 22, - "end_line": 22, - "column": 11, - "end_column": 34 + "line": 11, + "end_line": 11, + "column": 2, + "end_column": 11 }, "wtype": { "_type": "WType", - "name": "uint64", + "name": "state_key", "immutable": true, "ephemeral": false, - "scalar_type": 2 - }, - "key": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/global-state.algo.ts", - "line": 11, - "end_line": 11, - "column": 2, - "end_column": 11 - }, - "wtype": { - "_type": "WType", - "name": "state_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "bY*jNQ*>c;Wd", - "encoding": "utf8" + "scalar_type": 1 }, - "exists_assertion_message": "check GlobalState exists" - } + "value": "bY*jNQ*>c;Wd", + "encoding": "utf8" + }, + "exists_assertion_message": "check GlobalState exists" } - ], - "comment": "State should have value" + }, + "error_message": "State should have value" } }, { @@ -270,7 +265,7 @@ "end_column": 62 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/global-state.algo.ts", "line": 23, @@ -285,85 +280,81 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/global-state.algo.ts", + "line": 23, + "end_line": 23, + "column": 11, + "end_column": 37 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "AppStateExpression", "source_location": { "file": "tests/approvals/global-state.algo.ts", "line": 23, "end_line": 23, "column": 11, - "end_column": 37 + "end_column": 31 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "AppStateExpression", + "key": { + "_type": "BytesConstant", "source_location": { "file": "tests/approvals/global-state.algo.ts", - "line": 23, - "end_line": 23, - "column": 11, - "end_column": 31 + "line": 11, + "end_line": 11, + "column": 2, + "end_column": 11 }, "wtype": { "_type": "WType", - "name": "uint64", + "name": "state_key", "immutable": true, "ephemeral": false, - "scalar_type": 2 - }, - "key": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/global-state.algo.ts", - "line": 11, - "end_line": 11, - "column": 2, - "end_column": 11 - }, - "wtype": { - "_type": "WType", - "name": "state_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "bY*jNQ*>c;Wd", - "encoding": "utf8" + "scalar_type": 1 }, - "exists_assertion_message": "check GlobalState exists" + "value": "bY*jNQ*>c;Wd", + "encoding": "utf8" }, - "operator": "==", - "rhs": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/global-state.algo.ts", - "line": 23, - "end_line": 23, - "column": 36, - "end_column": 37 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "2", - "teal_alias": null - } + "exists_assertion_message": "check GlobalState exists" + }, + "operator": "==", + "rhs": { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/global-state.algo.ts", + "line": 23, + "end_line": 23, + "column": 36, + "end_column": 37 + }, + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "value": "2", + "teal_alias": null } - ], - "comment": "Value should equal 2" + }, + "error_message": "Value should equal 2" } }, { @@ -471,11 +462,9 @@ "value": "0", "teal_alias": null } - ], - "comment": null + ] } - ], - "comment": null + ] } }, { @@ -860,7 +849,7 @@ "end_column": 113 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/global-state.algo.ts", "line": 17, @@ -875,84 +864,80 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/global-state.algo.ts", + "line": 17, + "end_line": 17, + "column": 11, + "end_column": 53 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "AppStateExpression", "source_location": { "file": "tests/approvals/global-state.algo.ts", "line": 17, "end_line": 17, "column": 11, - "end_column": 53 + "end_column": 35 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "string", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "AppStateExpression", + "key": { + "_type": "BytesConstant", "source_location": { "file": "tests/approvals/global-state.algo.ts", - "line": 17, - "end_line": 17, - "column": 11, - "end_column": 35 + "line": 5, + "end_line": 5, + "column": 2, + "end_column": 15 }, "wtype": { "_type": "WType", - "name": "string", + "name": "state_key", "immutable": true, "ephemeral": false, "scalar_type": 1 }, - "key": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/global-state.algo.ts", - "line": 5, - "end_line": 5, - "column": 2, - "end_column": 15 - }, - "wtype": { - "_type": "WType", - "name": "state_key", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "VqtS-RAqB?Q*>c;Wd", - "encoding": "utf8" - }, - "exists_assertion_message": "check GlobalState exists" + "value": "VqtS-RAqB?Q*>c;Wd", + "encoding": "utf8" }, - "operator": "==", - "rhs": { - "_type": "StringConstant", - "source_location": { - "file": "tests/approvals/global-state.algo.ts", - "line": 17, - "end_line": 17, - "column": 40, - "end_column": 53 - }, - "wtype": { - "_type": "WType", - "name": "string", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "testing 123" - } + "exists_assertion_message": "check GlobalState exists" + }, + "operator": "==", + "rhs": { + "_type": "StringConstant", + "source_location": { + "file": "tests/approvals/global-state.algo.ts", + "line": 17, + "end_line": 17, + "column": 40, + "end_column": 53 + }, + "wtype": { + "_type": "WType", + "name": "string", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "testing 123" } - ], - "comment": "Base class state should be initialized after super call" + }, + "error_message": "Base class state should be initialized after super call" } }, { diff --git a/tests/approvals/out/implicit-create/implicit-create.awst.json b/tests/approvals/out/implicit-create/implicit-create.awst.json index 828a0c74..1c873d21 100644 --- a/tests/approvals/out/implicit-create/implicit-create.awst.json +++ b/tests/approvals/out/implicit-create/implicit-create.awst.json @@ -109,8 +109,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, @@ -717,8 +716,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, @@ -1321,8 +1319,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, @@ -1871,8 +1868,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, @@ -2426,8 +2422,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, @@ -3050,8 +3045,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, diff --git a/tests/approvals/out/inheritance-b/inheritance-b.awst.json b/tests/approvals/out/inheritance-b/inheritance-b.awst.json index 9cbfadba..c0a7a591 100644 --- a/tests/approvals/out/inheritance-b/inheritance-b.awst.json +++ b/tests/approvals/out/inheritance-b/inheritance-b.awst.json @@ -108,8 +108,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, @@ -260,11 +259,9 @@ "value": "0", "teal_alias": null } - ], - "comment": null + ] } - ], - "comment": null + ] } }, { @@ -353,11 +350,9 @@ "value": "1", "teal_alias": null } - ], - "comment": null + ] } - ], - "comment": null + ] } }, { @@ -474,11 +469,9 @@ } ] } - ], - "comment": null + ] } - ], - "comment": null + ] } }, { @@ -1125,8 +1118,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, diff --git a/tests/approvals/out/intrinsic-calls/intrinsic-calls.awst.json b/tests/approvals/out/intrinsic-calls/intrinsic-calls.awst.json index a436886f..bfb59afb 100644 --- a/tests/approvals/out/intrinsic-calls/intrinsic-calls.awst.json +++ b/tests/approvals/out/intrinsic-calls/intrinsic-calls.awst.json @@ -165,8 +165,7 @@ "value": "1", "teal_alias": null } - ], - "comment": null + ] } }, { @@ -271,8 +270,7 @@ "value": "9", "teal_alias": null } - ], - "comment": null + ] } }, { @@ -339,8 +337,7 @@ }, "name": "x" } - ], - "comment": null + ] } }, { @@ -407,8 +404,7 @@ }, "name": "z" } - ], - "comment": null + ] } } ], diff --git a/tests/approvals/out/itxn/itxn.awst b/tests/approvals/out/itxn/itxn.awst index ee7459d8..d9bc8455 100644 --- a/tests/approvals/out/itxn/itxn.awst +++ b/tests/approvals/out/itxn/itxn.awst @@ -43,15 +43,15 @@ contract ItxnDemoContract asset1_txn: inner_transaction_acfg = submit_txn(assetParams) update_inner_transaction(assetParams, ConfigAssetName=GlobalState["name"]) asset2_txn: inner_transaction_acfg = submit_txn(assetParams) - assert(asset1_txn.ConfigAssetName == "AST1") - assert(asset2_txn.ConfigAssetName == "AST2") - assert(checked_maybe(asset_params_get(asset1_txn.CreatedAssetID), comment=asset exists) == "AST1") - assert(checked_maybe(asset_params_get(asset2_txn.CreatedAssetID), comment=asset exists) == "AST2") + assert(asset1_txn.ConfigAssetName == "AST1", comment=asset1_txn is correct) + assert(asset2_txn.ConfigAssetName == "AST2", comment=asset2_txn is correct) + assert(checked_maybe(asset_params_get(asset1_txn.CreatedAssetID), comment=asset exists) == "AST1", comment=created asset 1 is correct) + assert(checked_maybe(asset_params_get(asset2_txn.CreatedAssetID), comment=asset exists) == "AST2", comment=created asset 2 is correct) appCreateParams: inner_transaction_fields_appl = create_inner_transaction(Fee=0, ApprovalProgram=0x098101, ClearStateProgram=0x098101) update_inner_transaction(assetParams, ConfigAssetName="AST3") [appCreateTxn, asset3_txn]: readonlytuple[inner_transaction_appl, inner_transaction_acfg] = submit_txn(appCreateParams, assetParams) - assert(Boolean(appCreateTxn.ApplicationID)) - assert(asset3_txn.ConfigAssetName == "AST3") + assert(Boolean(appCreateTxn.ApplicationID), comment=app is created) + assert(asset3_txn.ConfigAssetName == "AST3", comment=asset3_txn is correct) update_inner_transaction(appCreateParams, Note="3rd") update_inner_transaction(assetParams, Note="3rd") submit_txn(appCreateParams, assetParams) @@ -66,8 +66,8 @@ contract ItxnDemoContract createAppParams: inner_transaction_fields_appl = create_inner_transaction(Fee=0, ApprovalProgram=" ", ClearStateProgram=" ", ApplicationArgs=["3", "4", "5"], Note="no args param set") } createAppTxn: inner_transaction_appl = submit_txn(createAppParams) - assert(createAppTxn.ApplicationArgs[0] == "1") - assert(createAppTxn.ApplicationArgs[1] == "2") + assert(createAppTxn.ApplicationArgs[0] == "1", comment=correct args used 1) + assert(createAppTxn.ApplicationArgs[1] == "2", comment=correct args used 2) assert(createAppTxn.Note == "with args param set") } diff --git a/tests/approvals/out/itxn/itxn.awst.json b/tests/approvals/out/itxn/itxn.awst.json index cbae6f4f..b497f14e 100644 --- a/tests/approvals/out/itxn/itxn.awst.json +++ b/tests/approvals/out/itxn/itxn.awst.json @@ -107,8 +107,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, @@ -218,8 +217,7 @@ "immediates": [ "NumAppArgs" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, "if_branch": { @@ -301,8 +299,7 @@ "value": "0", "teal_alias": null } - ], - "comment": null + ] }, "cases": [ [ @@ -1027,8 +1024,7 @@ "immediates": [ "CurrentApplicationAddress" ], - "stack_args": [], - "comment": null + "stack_args": [] }, "ConfigAssetReserve": { "_type": "IntrinsicCall", @@ -1050,8 +1046,7 @@ "immediates": [ "CurrentApplicationAddress" ], - "stack_args": [], - "comment": null + "stack_args": [] } } } @@ -1354,7 +1349,7 @@ "end_column": 75 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 46, @@ -1369,86 +1364,82 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/itxn.algo.ts", + "line": 46, + "end_line": 46, + "column": 11, + "end_column": 49 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "InnerTransactionField", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 46, "end_line": 46, "column": 11, - "end_column": 49 + "end_column": 31 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "InnerTransactionField", + "itxn": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 46, "end_line": 46, "column": 11, - "end_column": 31 + "end_column": 21 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "WInnerTransaction", + "name": "inner_transaction_acfg", "immutable": true, "ephemeral": false, - "scalar_type": 1 + "scalar_type": null, + "transaction_type": 3 }, - "itxn": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/itxn.algo.ts", - "line": 46, - "end_line": 46, - "column": 11, - "end_column": 21 - }, - "wtype": { - "_type": "WInnerTransaction", - "name": "inner_transaction_acfg", - "immutable": true, - "ephemeral": false, - "scalar_type": null, - "transaction_type": 3 - }, - "name": "asset1_txn" - }, - "field": "ConfigAssetName", - "array_index": null + "name": "asset1_txn" }, - "operator": "==", - "rhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/itxn.algo.ts", - "line": 46, - "end_line": 46, - "column": 42, - "end_column": 48 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "K~q#Q", - "encoding": "utf8" - } + "field": "ConfigAssetName", + "array_index": null + }, + "operator": "==", + "rhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/itxn.algo.ts", + "line": 46, + "end_line": 46, + "column": 42, + "end_column": 48 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "K~q#Q", + "encoding": "utf8" } - ], - "comment": "asset1_txn is correct" + }, + "error_message": "asset1_txn is correct" } }, { @@ -1461,7 +1452,7 @@ "end_column": 75 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 47, @@ -1476,86 +1467,82 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/itxn.algo.ts", + "line": 47, + "end_line": 47, + "column": 11, + "end_column": 49 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "InnerTransactionField", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 47, "end_line": 47, "column": 11, - "end_column": 49 + "end_column": 31 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "InnerTransactionField", + "itxn": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 47, "end_line": 47, "column": 11, - "end_column": 31 + "end_column": 21 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "WInnerTransaction", + "name": "inner_transaction_acfg", "immutable": true, "ephemeral": false, - "scalar_type": 1 + "scalar_type": null, + "transaction_type": 3 }, - "itxn": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/itxn.algo.ts", - "line": 47, - "end_line": 47, - "column": 11, - "end_column": 21 - }, - "wtype": { - "_type": "WInnerTransaction", - "name": "inner_transaction_acfg", - "immutable": true, - "ephemeral": false, - "scalar_type": null, - "transaction_type": 3 - }, - "name": "asset2_txn" - }, - "field": "ConfigAssetName", - "array_index": null + "name": "asset2_txn" }, - "operator": "==", - "rhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/itxn.algo.ts", - "line": 47, - "end_line": 47, - "column": 42, - "end_column": 48 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "K~q#R", - "encoding": "utf8" - } + "field": "ConfigAssetName", + "array_index": null + }, + "operator": "==", + "rhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/itxn.algo.ts", + "line": 47, + "end_line": 47, + "column": 42, + "end_column": 48 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "K~q#R", + "encoding": "utf8" } - ], - "comment": "asset2_txn is correct" + }, + "error_message": "asset2_txn is correct" } }, { @@ -1568,7 +1555,7 @@ "end_column": 88 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 48, @@ -1583,27 +1570,40 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/itxn.algo.ts", + "line": 48, + "end_line": 48, + "column": 11, + "end_column": 57 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "CheckedMaybe", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 48, "end_line": 48, "column": 11, - "end_column": 57 + "end_column": 39 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "CheckedMaybe", + "expr": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 48, @@ -1612,115 +1612,97 @@ "end_column": 39 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "WTuple", + "name": "tuple", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/itxn.algo.ts", - "line": 48, - "end_line": 48, - "column": 11, - "end_column": 39 - }, - "wtype": { - "_type": "WTuple", - "name": "tuple", - "immutable": true, - "ephemeral": false, - "scalar_type": null, - "types": [ - { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - { - "_type": "WType", - "name": "bool", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - } - ] - }, - "op_code": "asset_params_get", - "immediates": [ - "AssetName" - ], - "stack_args": [ + "scalar_type": null, + "types": [ + { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, { - "_type": "InnerTransactionField", + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + } + ] + }, + "op_code": "asset_params_get", + "immediates": [ + "AssetName" + ], + "stack_args": [ + { + "_type": "InnerTransactionField", + "source_location": { + "file": "tests/approvals/itxn.algo.ts", + "line": 48, + "end_line": 48, + "column": 11, + "end_column": 34 + }, + "wtype": { + "_type": "WType", + "name": "asset", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "itxn": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 48, "end_line": 48, "column": 11, - "end_column": 34 + "end_column": 21 }, "wtype": { - "_type": "WType", - "name": "asset", + "_type": "WInnerTransaction", + "name": "inner_transaction_acfg", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": null, + "transaction_type": 3 }, - "itxn": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/itxn.algo.ts", - "line": 48, - "end_line": 48, - "column": 11, - "end_column": 21 - }, - "wtype": { - "_type": "WInnerTransaction", - "name": "inner_transaction_acfg", - "immutable": true, - "ephemeral": false, - "scalar_type": null, - "transaction_type": 3 - }, - "name": "asset1_txn" - }, - "field": "CreatedAssetID", - "array_index": null - } - ], - "comment": null - }, - "comment": "asset exists" + "name": "asset1_txn" + }, + "field": "CreatedAssetID", + "array_index": null + } + ] }, - "operator": "==", - "rhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/itxn.algo.ts", - "line": 48, - "end_line": 48, - "column": 50, - "end_column": 56 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "K~q#Q", - "encoding": "utf8" - } + "comment": "asset exists" + }, + "operator": "==", + "rhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/itxn.algo.ts", + "line": 48, + "end_line": 48, + "column": 50, + "end_column": 56 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "K~q#Q", + "encoding": "utf8" } - ], - "comment": "created asset 1 is correct" + }, + "error_message": "created asset 1 is correct" } }, { @@ -1733,7 +1715,7 @@ "end_column": 88 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 49, @@ -1748,27 +1730,40 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/itxn.algo.ts", + "line": 49, + "end_line": 49, + "column": 11, + "end_column": 57 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "CheckedMaybe", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 49, "end_line": 49, "column": 11, - "end_column": 57 + "end_column": 39 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "CheckedMaybe", + "expr": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 49, @@ -1777,115 +1772,97 @@ "end_column": 39 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "WTuple", + "name": "tuple", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "expr": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/itxn.algo.ts", - "line": 49, - "end_line": 49, - "column": 11, - "end_column": 39 - }, - "wtype": { - "_type": "WTuple", - "name": "tuple", - "immutable": true, - "ephemeral": false, - "scalar_type": null, - "types": [ - { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - { - "_type": "WType", - "name": "bool", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - } - ] - }, - "op_code": "asset_params_get", - "immediates": [ - "AssetName" - ], - "stack_args": [ + "scalar_type": null, + "types": [ { - "_type": "InnerTransactionField", + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + } + ] + }, + "op_code": "asset_params_get", + "immediates": [ + "AssetName" + ], + "stack_args": [ + { + "_type": "InnerTransactionField", + "source_location": { + "file": "tests/approvals/itxn.algo.ts", + "line": 49, + "end_line": 49, + "column": 11, + "end_column": 34 + }, + "wtype": { + "_type": "WType", + "name": "asset", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "itxn": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 49, "end_line": 49, "column": 11, - "end_column": 34 + "end_column": 21 }, "wtype": { - "_type": "WType", - "name": "asset", + "_type": "WInnerTransaction", + "name": "inner_transaction_acfg", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": null, + "transaction_type": 3 }, - "itxn": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/itxn.algo.ts", - "line": 49, - "end_line": 49, - "column": 11, - "end_column": 21 - }, - "wtype": { - "_type": "WInnerTransaction", - "name": "inner_transaction_acfg", - "immutable": true, - "ephemeral": false, - "scalar_type": null, - "transaction_type": 3 - }, - "name": "asset2_txn" - }, - "field": "CreatedAssetID", - "array_index": null - } - ], - "comment": null - }, - "comment": "asset exists" + "name": "asset2_txn" + }, + "field": "CreatedAssetID", + "array_index": null + } + ] }, - "operator": "==", - "rhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/itxn.algo.ts", - "line": 49, - "end_line": 49, - "column": 50, - "end_column": 56 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "K~q#R", - "encoding": "utf8" - } + "comment": "asset exists" + }, + "operator": "==", + "rhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/itxn.algo.ts", + "line": 49, + "end_line": 49, + "column": 50, + "end_column": 56 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "K~q#R", + "encoding": "utf8" } - ], - "comment": "created asset 2 is correct" + }, + "error_message": "created asset 2 is correct" } }, { @@ -2232,7 +2209,7 @@ "end_column": 48 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 63, @@ -2247,66 +2224,62 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "ReinterpretCast", + "condition": { + "_type": "ReinterpretCast", + "source_location": { + "file": "tests/approvals/itxn.algo.ts", + "line": 63, + "end_line": 63, + "column": 4, + "end_column": 48 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { + "_type": "InnerTransactionField", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 63, "end_line": 63, - "column": 4, - "end_column": 48 + "column": 11, + "end_column": 29 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "application", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "InnerTransactionField", + "itxn": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 63, "end_line": 63, "column": 11, - "end_column": 29 + "end_column": 23 }, "wtype": { - "_type": "WType", - "name": "application", + "_type": "WInnerTransaction", + "name": "inner_transaction_appl", "immutable": true, "ephemeral": false, - "scalar_type": 2 - }, - "itxn": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/itxn.algo.ts", - "line": 63, - "end_line": 63, - "column": 11, - "end_column": 23 - }, - "wtype": { - "_type": "WInnerTransaction", - "name": "inner_transaction_appl", - "immutable": true, - "ephemeral": false, - "scalar_type": null, - "transaction_type": 6 - }, - "name": "appCreateTxn" + "scalar_type": null, + "transaction_type": 6 }, - "field": "ApplicationID", - "array_index": null - } + "name": "appCreateTxn" + }, + "field": "ApplicationID", + "array_index": null } - ], - "comment": "app is created" + }, + "error_message": "app is created" } }, { @@ -2319,7 +2292,7 @@ "end_column": 75 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 64, @@ -2334,86 +2307,82 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/itxn.algo.ts", + "line": 64, + "end_line": 64, + "column": 11, + "end_column": 49 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "InnerTransactionField", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 64, "end_line": 64, "column": 11, - "end_column": 49 + "end_column": 31 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "InnerTransactionField", + "itxn": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 64, "end_line": 64, "column": 11, - "end_column": 31 + "end_column": 21 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "WInnerTransaction", + "name": "inner_transaction_acfg", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "itxn": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/itxn.algo.ts", - "line": 64, - "end_line": 64, - "column": 11, - "end_column": 21 - }, - "wtype": { - "_type": "WInnerTransaction", - "name": "inner_transaction_acfg", - "immutable": true, - "ephemeral": false, - "scalar_type": null, - "transaction_type": 3 - }, - "name": "asset3_txn" + "scalar_type": null, + "transaction_type": 3 }, - "field": "ConfigAssetName", - "array_index": null + "name": "asset3_txn" }, - "operator": "==", - "rhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/itxn.algo.ts", - "line": 64, - "end_line": 64, - "column": 42, - "end_column": 48 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "K~q#S", - "encoding": "utf8" - } + "field": "ConfigAssetName", + "array_index": null + }, + "operator": "==", + "rhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/itxn.algo.ts", + "line": 64, + "end_line": 64, + "column": 42, + "end_column": 48 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "K~q#S", + "encoding": "utf8" } - ], - "comment": "asset3_txn is correct" + }, + "error_message": "asset3_txn is correct" } }, { @@ -2723,8 +2692,7 @@ "immediates": [ "NumAppArgs" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, "if_branch": { @@ -3486,7 +3454,7 @@ "end_column": 73 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 95, @@ -3501,104 +3469,100 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/itxn.algo.ts", + "line": 95, + "end_line": 95, + "column": 11, + "end_column": 49 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "InnerTransactionField", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 95, "end_line": 95, "column": 11, - "end_column": 49 + "end_column": 34 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "InnerTransactionField", + "itxn": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 95, "end_line": 95, "column": 11, - "end_column": 34 + "end_column": 23 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "WInnerTransaction", + "name": "inner_transaction_appl", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "itxn": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/itxn.algo.ts", - "line": 95, - "end_line": 95, - "column": 11, - "end_column": 23 - }, - "wtype": { - "_type": "WInnerTransaction", - "name": "inner_transaction_appl", - "immutable": true, - "ephemeral": false, - "scalar_type": null, - "transaction_type": 6 - }, - "name": "createAppTxn" + "scalar_type": null, + "transaction_type": 6 }, - "field": "ApplicationArgs", - "array_index": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/itxn.algo.ts", - "line": 95, - "end_line": 95, - "column": 32, - "end_column": 33 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "0", - "teal_alias": null - } + "name": "createAppTxn" }, - "operator": "==", - "rhs": { - "_type": "BytesConstant", + "field": "ApplicationArgs", + "array_index": { + "_type": "IntegerConstant", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 95, "end_line": 95, - "column": 45, - "end_column": 48 + "column": 32, + "end_column": 33 }, "wtype": { "_type": "WType", - "name": "bytes", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1 + "scalar_type": 2 }, - "value": "F#", - "encoding": "utf8" + "value": "0", + "teal_alias": null } + }, + "operator": "==", + "rhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/itxn.algo.ts", + "line": 95, + "end_line": 95, + "column": 45, + "end_column": 48 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "F#", + "encoding": "utf8" } - ], - "comment": "correct args used 1" + }, + "error_message": "correct args used 1" } }, { @@ -3611,7 +3575,7 @@ "end_column": 73 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 96, @@ -3626,104 +3590,100 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/itxn.algo.ts", + "line": 96, + "end_line": 96, + "column": 11, + "end_column": 49 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "InnerTransactionField", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 96, "end_line": 96, "column": 11, - "end_column": 49 + "end_column": 34 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "InnerTransactionField", + "itxn": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 96, "end_line": 96, "column": 11, - "end_column": 34 + "end_column": 23 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "WInnerTransaction", + "name": "inner_transaction_appl", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "itxn": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/itxn.algo.ts", - "line": 96, - "end_line": 96, - "column": 11, - "end_column": 23 - }, - "wtype": { - "_type": "WInnerTransaction", - "name": "inner_transaction_appl", - "immutable": true, - "ephemeral": false, - "scalar_type": null, - "transaction_type": 6 - }, - "name": "createAppTxn" + "scalar_type": null, + "transaction_type": 6 }, - "field": "ApplicationArgs", - "array_index": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/itxn.algo.ts", - "line": 96, - "end_line": 96, - "column": 32, - "end_column": 33 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "1", - "teal_alias": null - } + "name": "createAppTxn" }, - "operator": "==", - "rhs": { - "_type": "BytesConstant", + "field": "ApplicationArgs", + "array_index": { + "_type": "IntegerConstant", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 96, "end_line": 96, - "column": 45, - "end_column": 48 + "column": 32, + "end_column": 33 }, "wtype": { "_type": "WType", - "name": "bytes", + "name": "uint64", "immutable": true, "ephemeral": false, - "scalar_type": 1 + "scalar_type": 2 }, - "value": "G5", - "encoding": "utf8" + "value": "1", + "teal_alias": null } + }, + "operator": "==", + "rhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/itxn.algo.ts", + "line": 96, + "end_line": 96, + "column": 45, + "end_column": 48 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "G5", + "encoding": "utf8" } - ], - "comment": "correct args used 2" + }, + "error_message": "correct args used 2" } }, { @@ -3736,7 +3696,7 @@ "end_column": 62 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 97, @@ -3751,86 +3711,82 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/itxn.algo.ts", + "line": 97, + "end_line": 97, + "column": 11, + "end_column": 61 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "InnerTransactionField", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 97, "end_line": 97, "column": 11, - "end_column": 61 + "end_column": 28 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "InnerTransactionField", + "itxn": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/itxn.algo.ts", "line": 97, "end_line": 97, "column": 11, - "end_column": 28 + "end_column": 23 }, "wtype": { - "_type": "WType", - "name": "bytes", + "_type": "WInnerTransaction", + "name": "inner_transaction_appl", "immutable": true, "ephemeral": false, - "scalar_type": 1 - }, - "itxn": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/itxn.algo.ts", - "line": 97, - "end_line": 97, - "column": 11, - "end_column": 23 - }, - "wtype": { - "_type": "WInnerTransaction", - "name": "inner_transaction_appl", - "immutable": true, - "ephemeral": false, - "scalar_type": null, - "transaction_type": 6 - }, - "name": "createAppTxn" + "scalar_type": null, + "transaction_type": 6 }, - "field": "Note", - "array_index": null + "name": "createAppTxn" }, - "operator": "==", - "rhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/itxn.algo.ts", - "line": 97, - "end_line": 97, - "column": 39, - "end_column": 60 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "cWHEJAYpQ6b0BbGa$#*Cb7gb", - "encoding": "utf8" - } + "field": "Note", + "array_index": null + }, + "operator": "==", + "rhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/itxn.algo.ts", + "line": 97, + "end_line": 97, + "column": 39, + "end_column": 60 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "cWHEJAYpQ6b0BbGa$#*Cb7gb", + "encoding": "utf8" } - ], - "comment": null + }, + "error_message": null } } ], diff --git a/tests/approvals/out/local-state/local-state.awst.json b/tests/approvals/out/local-state/local-state.awst.json index 57cfd471..39668674 100644 --- a/tests/approvals/out/local-state/local-state.awst.json +++ b/tests/approvals/out/local-state/local-state.awst.json @@ -109,8 +109,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, @@ -613,8 +612,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, "value": { @@ -701,8 +699,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, "value": { @@ -789,8 +786,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, "value": { @@ -877,8 +873,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, "value": { @@ -985,8 +980,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, "value": { @@ -1529,8 +1523,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -1589,8 +1582,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -1649,8 +1641,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -1709,8 +1700,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -1825,8 +1815,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } } } @@ -2069,8 +2058,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -2129,8 +2117,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -2189,8 +2176,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -2249,8 +2235,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -2365,8 +2350,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } } } @@ -2609,8 +2593,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -2669,8 +2652,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -2729,8 +2711,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -2789,8 +2770,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -2905,8 +2885,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } } } @@ -3149,8 +3128,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -3209,8 +3187,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -3269,8 +3246,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -3329,8 +3305,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -3445,8 +3420,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } } } @@ -3709,8 +3683,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -3769,8 +3742,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -3829,8 +3801,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -3889,8 +3860,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } }, { @@ -4005,8 +3975,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } } } @@ -4185,8 +4154,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } } } @@ -4272,8 +4240,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } } } @@ -4359,8 +4326,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } } } @@ -4446,8 +4412,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } } } @@ -4553,8 +4518,7 @@ "immediates": [ "Sender" ], - "stack_args": [], - "comment": null + "stack_args": [] } } } diff --git a/tests/approvals/out/logic-sig/logic-sig.awst b/tests/approvals/out/logic-sig/logic-sig.awst index fa77ae41..04a36865 100644 --- a/tests/approvals/out/logic-sig/logic-sig.awst +++ b/tests/approvals/out/logic-sig/logic-sig.awst @@ -4,7 +4,7 @@ logicsig tests/approvals/logic-sig.algo.ts::AlwaysAllow { } subroutine feeIsZero(): void { - assert(txn() == 0) + assert(txn() == 0, comment=Fee must be zero) } logicsig tests/approvals/logic-sig.algo.ts::AllowNoFee { diff --git a/tests/approvals/out/logic-sig/logic-sig.awst.json b/tests/approvals/out/logic-sig/logic-sig.awst.json index 4923adb3..4c61163b 100644 --- a/tests/approvals/out/logic-sig/logic-sig.awst.json +++ b/tests/approvals/out/logic-sig/logic-sig.awst.json @@ -118,7 +118,7 @@ "end_column": 43 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/logic-sig.algo.ts", "line": 10, @@ -133,71 +133,66 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/logic-sig.algo.ts", + "line": 10, + "end_line": 10, + "column": 9, + "end_column": 22 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/logic-sig.algo.ts", "line": 10, "end_line": 10, "column": 9, - "end_column": 22 + "end_column": 16 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/logic-sig.algo.ts", - "line": 10, - "end_line": 10, - "column": 9, - "end_column": 16 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "op_code": "txn", - "immediates": [ - "Fee" - ], - "stack_args": [], - "comment": null + "op_code": "txn", + "immediates": [ + "Fee" + ], + "stack_args": [] + }, + "operator": "==", + "rhs": { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/logic-sig.algo.ts", + "line": 10, + "end_line": 10, + "column": 21, + "end_column": 22 + }, + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 }, - "operator": "==", - "rhs": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/logic-sig.algo.ts", - "line": 10, - "end_line": 10, - "column": 21, - "end_column": 22 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "0", - "teal_alias": null - } + "value": "0", + "teal_alias": null } - ], - "comment": "Fee must be zero" + }, + "error_message": "Fee must be zero" } } ], diff --git a/tests/approvals/out/named-types/named-types.awst b/tests/approvals/out/named-types/named-types.awst index 2725cb19..9fb688a4 100644 --- a/tests/approvals/out/named-types/named-types.awst +++ b/tests/approvals/out/named-types/named-types.awst @@ -30,7 +30,7 @@ contract MyContract test(): void { - assert(x.y == y.y and x.x == y.x) + assert(x.y == y.y and x.x == y.x, comment=assert target is match for conditions) } testing(): readonlytuple[XY{ x: uint64, y: uint64 }, YX{ y: uint64, x: uint64 }, { x: uint64, y: uint64 }] diff --git a/tests/approvals/out/named-types/named-types.awst.json b/tests/approvals/out/named-types/named-types.awst.json index 858b5da9..d96d1552 100644 --- a/tests/approvals/out/named-types/named-types.awst.json +++ b/tests/approvals/out/named-types/named-types.awst.json @@ -109,8 +109,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, @@ -1635,7 +1634,7 @@ "end_column": 28 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/named-types.algo.ts", "line": 37, @@ -1650,11 +1649,24 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BooleanBinaryOperation", + "condition": { + "_type": "BooleanBinaryOperation", + "source_location": { + "file": "tests/approvals/named-types.algo.ts", + "line": 37, + "end_line": 37, + "column": 4, + "end_column": 28 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "left": { + "_type": "NumericComparisonExpression", "source_location": { "file": "tests/approvals/named-types.algo.ts", "line": 37, @@ -1669,8 +1681,8 @@ "ephemeral": false, "scalar_type": 2 }, - "left": { - "_type": "NumericComparisonExpression", + "lhs": { + "_type": "FieldExpression", "source_location": { "file": "tests/approvals/named-types.algo.ts", "line": 37, @@ -1680,128 +1692,128 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "FieldExpression", + "base": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/named-types.algo.ts", "line": 37, "end_line": 37, - "column": 4, - "end_column": 28 + "column": 16, + "end_column": 17 }, "wtype": { - "_type": "WType", - "name": "uint64", + "_type": "WTuple", + "name": "tests/approvals/named-types.algo.ts::XY", "immutable": true, "ephemeral": false, - "scalar_type": 2 - }, - "base": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/named-types.algo.ts", - "line": 37, - "end_line": 37, - "column": 16, - "end_column": 17 - }, - "wtype": { - "_type": "WTuple", - "name": "tests/approvals/named-types.algo.ts::XY", - "immutable": true, - "ephemeral": false, - "scalar_type": null, - "types": [ - { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - } - ], - "names": [ - "x", - "y" - ] - }, - "name": "x" + "scalar_type": null, + "types": [ + { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + } + ], + "names": [ + "x", + "y" + ] }, - "name": "y" + "name": "x" }, - "operator": "==", - "rhs": { - "_type": "FieldExpression", + "name": "y" + }, + "operator": "==", + "rhs": { + "_type": "FieldExpression", + "source_location": { + "file": "tests/approvals/named-types.algo.ts", + "line": 37, + "end_line": 37, + "column": 4, + "end_column": 28 + }, + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "base": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/named-types.algo.ts", "line": 37, "end_line": 37, - "column": 4, - "end_column": 28 + "column": 24, + "end_column": 25 }, "wtype": { - "_type": "WType", - "name": "uint64", + "_type": "WTuple", + "name": "tests/approvals/named-types.algo.ts::YX", "immutable": true, "ephemeral": false, - "scalar_type": 2 - }, - "base": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/named-types.algo.ts", - "line": 37, - "end_line": 37, - "column": 24, - "end_column": 25 - }, - "wtype": { - "_type": "WTuple", - "name": "tests/approvals/named-types.algo.ts::YX", - "immutable": true, - "ephemeral": false, - "scalar_type": null, - "types": [ - { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - } - ], - "names": [ - "y", - "x" - ] - }, - "name": "y" + "scalar_type": null, + "types": [ + { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + } + ], + "names": [ + "y", + "x" + ] }, "name": "y" - } + }, + "name": "y" + } + }, + "op": "and", + "right": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/named-types.algo.ts", + "line": 37, + "end_line": 37, + "column": 4, + "end_column": 28 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 }, - "op": "and", - "right": { - "_type": "NumericComparisonExpression", + "lhs": { + "_type": "FieldExpression", "source_location": { "file": "tests/approvals/named-types.algo.ts", "line": 37, @@ -1811,128 +1823,111 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "FieldExpression", + "base": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/named-types.algo.ts", "line": 37, "end_line": 37, - "column": 4, - "end_column": 28 + "column": 16, + "end_column": 17 }, "wtype": { - "_type": "WType", - "name": "uint64", + "_type": "WTuple", + "name": "tests/approvals/named-types.algo.ts::XY", "immutable": true, "ephemeral": false, - "scalar_type": 2 - }, - "base": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/named-types.algo.ts", - "line": 37, - "end_line": 37, - "column": 16, - "end_column": 17 - }, - "wtype": { - "_type": "WTuple", - "name": "tests/approvals/named-types.algo.ts::XY", - "immutable": true, - "ephemeral": false, - "scalar_type": null, - "types": [ - { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - } - ], - "names": [ - "x", - "y" - ] - }, - "name": "x" + "scalar_type": null, + "types": [ + { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + } + ], + "names": [ + "x", + "y" + ] }, "name": "x" }, - "operator": "==", - "rhs": { - "_type": "FieldExpression", + "name": "x" + }, + "operator": "==", + "rhs": { + "_type": "FieldExpression", + "source_location": { + "file": "tests/approvals/named-types.algo.ts", + "line": 37, + "end_line": 37, + "column": 4, + "end_column": 28 + }, + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "base": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/named-types.algo.ts", "line": 37, "end_line": 37, - "column": 4, - "end_column": 28 + "column": 24, + "end_column": 25 }, "wtype": { - "_type": "WType", - "name": "uint64", + "_type": "WTuple", + "name": "tests/approvals/named-types.algo.ts::YX", "immutable": true, "ephemeral": false, - "scalar_type": 2 - }, - "base": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/named-types.algo.ts", - "line": 37, - "end_line": 37, - "column": 24, - "end_column": 25 - }, - "wtype": { - "_type": "WTuple", - "name": "tests/approvals/named-types.algo.ts::YX", - "immutable": true, - "ephemeral": false, - "scalar_type": null, - "types": [ - { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - } - ], - "names": [ - "y", - "x" - ] - }, - "name": "y" + "scalar_type": null, + "types": [ + { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + } + ], + "names": [ + "y", + "x" + ] }, - "name": "x" - } + "name": "y" + }, + "name": "x" } } - ], - "comment": "assert target is match for conditions" + }, + "error_message": "assert target is match for conditions" } } ], diff --git a/tests/approvals/out/non-arc4/non-arc4.awst.json b/tests/approvals/out/non-arc4/non-arc4.awst.json index 60af645c..e30e0726 100644 --- a/tests/approvals/out/non-arc4/non-arc4.awst.json +++ b/tests/approvals/out/non-arc4/non-arc4.awst.json @@ -107,8 +107,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, @@ -256,8 +255,7 @@ "value": "0", "teal_alias": null } - ], - "comment": null + ] } } }, @@ -360,8 +358,7 @@ } } } - ], - "comment": null + ] } }, { diff --git a/tests/approvals/out/pre-approved-sale/pre-approved-sale.awst b/tests/approvals/out/pre-approved-sale/pre-approved-sale.awst index 66731d8a..ef81ebce 100644 --- a/tests/approvals/out/pre-approved-sale/pre-approved-sale.awst +++ b/tests/approvals/out/pre-approved-sale/pre-approved-sale.awst @@ -5,7 +5,7 @@ logicsig tests/approvals/pre-approved-sale.algo.ts::PreApprovedSale { asset: asset = TemplateVar[asset](TMPL_ASSET) payTxn: group_transaction_pay = reinterpret_cast(0) assetTxn: group_transaction_axfer = reinterpret_cast(1) - assert(gtxns(payTxn) == seller and gtxns(payTxn) == price) - assert(gtxns(assetTxn) == 1 and gtxns(assetTxn) == seller and gtxns(assetTxn) == asset and gtxns(assetTxn) == global() and gtxns(assetTxn) == global()) + assert(gtxns(payTxn) == seller and gtxns(payTxn) == price, comment=assert target is match for conditions) + assert(gtxns(assetTxn) == 1 and gtxns(assetTxn) == seller and gtxns(assetTxn) == asset and gtxns(assetTxn) == global() and gtxns(assetTxn) == global(), comment=assert target is match for conditions) return True } \ No newline at end of file diff --git a/tests/approvals/out/pre-approved-sale/pre-approved-sale.awst.json b/tests/approvals/out/pre-approved-sale/pre-approved-sale.awst.json index 60b1324d..1254d48d 100644 --- a/tests/approvals/out/pre-approved-sale/pre-approved-sale.awst.json +++ b/tests/approvals/out/pre-approved-sale/pre-approved-sale.awst.json @@ -317,7 +317,7 @@ "end_column": 6 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/pre-approved-sale.algo.ts", "line": 18, @@ -332,11 +332,24 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BooleanBinaryOperation", + "condition": { + "_type": "BooleanBinaryOperation", + "source_location": { + "file": "tests/approvals/pre-approved-sale.algo.ts", + "line": 18, + "end_line": 21, + "column": 4, + "end_column": 6 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "left": { + "_type": "BytesComparisonExpression", "source_location": { "file": "tests/approvals/pre-approved-sale.algo.ts", "line": 18, @@ -351,8 +364,8 @@ "ephemeral": false, "scalar_type": 2 }, - "left": { - "_type": "BytesComparisonExpression", + "lhs": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/pre-approved-sale.algo.ts", "line": 18, @@ -362,77 +375,76 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "account", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "lhs": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/pre-approved-sale.algo.ts", - "line": 18, - "end_line": 21, - "column": 4, - "end_column": 6 - }, - "wtype": { - "_type": "WType", - "name": "account", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "op_code": "gtxns", - "immediates": [ - "Receiver" - ], - "stack_args": [ - { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/pre-approved-sale.algo.ts", - "line": 18, - "end_line": 18, - "column": 16, - "end_column": 22 - }, - "wtype": { - "_type": "WGroupTransaction", - "name": "group_transaction_pay", - "immutable": true, - "ephemeral": false, - "scalar_type": 2, - "transaction_type": 1 - }, - "name": "payTxn" - } - ], - "comment": null + "op_code": "gtxns", + "immediates": [ + "Receiver" + ], + "stack_args": [ + { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/pre-approved-sale.algo.ts", + "line": 18, + "end_line": 18, + "column": 16, + "end_column": 22 + }, + "wtype": { + "_type": "WGroupTransaction", + "name": "group_transaction_pay", + "immutable": true, + "ephemeral": false, + "scalar_type": 2, + "transaction_type": 1 + }, + "name": "payTxn" + } + ] + }, + "operator": "==", + "rhs": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/pre-approved-sale.algo.ts", + "line": 19, + "end_line": 19, + "column": 16, + "end_column": 22 }, - "operator": "==", - "rhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/pre-approved-sale.algo.ts", - "line": 19, - "end_line": 19, - "column": 16, - "end_column": 22 - }, - "wtype": { - "_type": "WType", - "name": "account", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "seller" - } + "wtype": { + "_type": "WType", + "name": "account", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "name": "seller" + } + }, + "op": "and", + "right": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/pre-approved-sale.algo.ts", + "line": 18, + "end_line": 21, + "column": 4, + "end_column": 6 }, - "op": "and", - "right": { - "_type": "NumericComparisonExpression", + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/pre-approved-sale.algo.ts", "line": 18, @@ -442,77 +454,59 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/pre-approved-sale.algo.ts", - "line": 18, - "end_line": 21, - "column": 4, - "end_column": 6 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "op_code": "gtxns", - "immediates": [ - "Amount" - ], - "stack_args": [ - { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/pre-approved-sale.algo.ts", - "line": 18, - "end_line": 18, - "column": 16, - "end_column": 22 - }, - "wtype": { - "_type": "WGroupTransaction", - "name": "group_transaction_pay", - "immutable": true, - "ephemeral": false, - "scalar_type": 2, - "transaction_type": 1 - }, - "name": "payTxn" - } - ], - "comment": null + "op_code": "gtxns", + "immediates": [ + "Amount" + ], + "stack_args": [ + { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/pre-approved-sale.algo.ts", + "line": 18, + "end_line": 18, + "column": 16, + "end_column": 22 + }, + "wtype": { + "_type": "WGroupTransaction", + "name": "group_transaction_pay", + "immutable": true, + "ephemeral": false, + "scalar_type": 2, + "transaction_type": 1 + }, + "name": "payTxn" + } + ] + }, + "operator": "==", + "rhs": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/pre-approved-sale.algo.ts", + "line": 20, + "end_line": 20, + "column": 14, + "end_column": 19 }, - "operator": "==", - "rhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/pre-approved-sale.algo.ts", - "line": 20, - "end_line": 20, - "column": 14, - "end_column": 19 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "price" - } + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "name": "price" } } - ], - "comment": "assert target is match for conditions" + }, + "error_message": "assert target is match for conditions" } }, { @@ -525,7 +519,7 @@ "end_column": 6 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/pre-approved-sale.algo.ts", "line": 23, @@ -540,10 +534,23 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { + "condition": { + "_type": "BooleanBinaryOperation", + "source_location": { + "file": "tests/approvals/pre-approved-sale.algo.ts", + "line": 23, + "end_line": 29, + "column": 4, + "end_column": 6 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "left": { "_type": "BooleanBinaryOperation", "source_location": { "file": "tests/approvals/pre-approved-sale.algo.ts", @@ -592,7 +599,7 @@ "scalar_type": 2 }, "left": { - "_type": "BooleanBinaryOperation", + "_type": "NumericComparisonExpression", "source_location": { "file": "tests/approvals/pre-approved-sale.algo.ts", "line": 23, @@ -607,8 +614,8 @@ "ephemeral": false, "scalar_type": 2 }, - "left": { - "_type": "NumericComparisonExpression", + "lhs": { + "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/pre-approved-sale.algo.ts", "line": 23, @@ -618,159 +625,61 @@ }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/pre-approved-sale.algo.ts", - "line": 23, - "end_line": 29, - "column": 4, - "end_column": 6 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "op_code": "gtxns", - "immediates": [ - "AssetAmount" - ], - "stack_args": [ - { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/pre-approved-sale.algo.ts", - "line": 23, - "end_line": 23, - "column": 16, - "end_column": 24 - }, - "wtype": { - "_type": "WGroupTransaction", - "name": "group_transaction_axfer", - "immutable": true, - "ephemeral": false, - "scalar_type": 2, - "transaction_type": 4 - }, - "name": "assetTxn" - } - ], - "comment": null - }, - "operator": "==", - "rhs": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/pre-approved-sale.algo.ts", - "line": 24, - "end_line": 24, - "column": 26, - "end_column": 27 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "1", - "teal_alias": null - } + "op_code": "gtxns", + "immediates": [ + "AssetAmount" + ], + "stack_args": [ + { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/pre-approved-sale.algo.ts", + "line": 23, + "end_line": 23, + "column": 16, + "end_column": 24 + }, + "wtype": { + "_type": "WGroupTransaction", + "name": "group_transaction_axfer", + "immutable": true, + "ephemeral": false, + "scalar_type": 2, + "transaction_type": 4 + }, + "name": "assetTxn" + } + ] }, - "op": "and", - "right": { - "_type": "BytesComparisonExpression", + "operator": "==", + "rhs": { + "_type": "IntegerConstant", "source_location": { "file": "tests/approvals/pre-approved-sale.algo.ts", - "line": 23, - "end_line": 29, - "column": 4, - "end_column": 6 + "line": 24, + "end_line": 24, + "column": 26, + "end_column": 27 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "IntrinsicCall", - "source_location": { - "file": "tests/approvals/pre-approved-sale.algo.ts", - "line": 23, - "end_line": 29, - "column": 4, - "end_column": 6 - }, - "wtype": { - "_type": "WType", - "name": "account", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "op_code": "gtxns", - "immediates": [ - "Sender" - ], - "stack_args": [ - { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/pre-approved-sale.algo.ts", - "line": 23, - "end_line": 23, - "column": 16, - "end_column": 24 - }, - "wtype": { - "_type": "WGroupTransaction", - "name": "group_transaction_axfer", - "immutable": true, - "ephemeral": false, - "scalar_type": 2, - "transaction_type": 4 - }, - "name": "assetTxn" - } - ], - "comment": null - }, - "operator": "==", - "rhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/pre-approved-sale.algo.ts", - "line": 25, - "end_line": 25, - "column": 14, - "end_column": 20 - }, - "wtype": { - "_type": "WType", - "name": "account", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "seller" - } + "value": "1", + "teal_alias": null } }, "op": "and", "right": { - "_type": "NumericComparisonExpression", + "_type": "BytesComparisonExpression", "source_location": { "file": "tests/approvals/pre-approved-sale.algo.ts", "line": 23, @@ -796,14 +705,14 @@ }, "wtype": { "_type": "WType", - "name": "asset", + "name": "account", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, "op_code": "gtxns", "immediates": [ - "XferAsset" + "Sender" ], "stack_args": [ { @@ -825,33 +734,32 @@ }, "name": "assetTxn" } - ], - "comment": null + ] }, "operator": "==", "rhs": { "_type": "VarExpression", "source_location": { "file": "tests/approvals/pre-approved-sale.algo.ts", - "line": 26, - "end_line": 26, - "column": 17, - "end_column": 22 + "line": 25, + "end_line": 25, + "column": 14, + "end_column": 20 }, "wtype": { "_type": "WType", - "name": "asset", + "name": "account", "immutable": true, "ephemeral": false, - "scalar_type": 2 + "scalar_type": 1 }, - "name": "asset" + "name": "seller" } } }, "op": "and", "right": { - "_type": "BytesComparisonExpression", + "_type": "NumericComparisonExpression", "source_location": { "file": "tests/approvals/pre-approved-sale.algo.ts", "line": 23, @@ -877,14 +785,14 @@ }, "wtype": { "_type": "WType", - "name": "account", + "name": "asset", "immutable": true, "ephemeral": false, - "scalar_type": 1 + "scalar_type": 2 }, "op_code": "gtxns", "immediates": [ - "AssetCloseTo" + "XferAsset" ], "stack_args": [ { @@ -906,32 +814,26 @@ }, "name": "assetTxn" } - ], - "comment": null + ] }, "operator": "==", "rhs": { - "_type": "IntrinsicCall", + "_type": "VarExpression", "source_location": { "file": "tests/approvals/pre-approved-sale.algo.ts", - "line": 27, - "end_line": 27, - "column": 20, - "end_column": 38 + "line": 26, + "end_line": 26, + "column": 17, + "end_column": 22 }, "wtype": { "_type": "WType", - "name": "account", + "name": "asset", "immutable": true, "ephemeral": false, - "scalar_type": 1 + "scalar_type": 2 }, - "op_code": "global", - "immediates": [ - "ZeroAddress" - ], - "stack_args": [], - "comment": null + "name": "asset" } } }, @@ -970,7 +872,7 @@ }, "op_code": "gtxns", "immediates": [ - "RekeyTo" + "AssetCloseTo" ], "stack_args": [ { @@ -992,18 +894,17 @@ }, "name": "assetTxn" } - ], - "comment": null + ] }, "operator": "==", "rhs": { "_type": "IntrinsicCall", "source_location": { "file": "tests/approvals/pre-approved-sale.algo.ts", - "line": 28, - "end_line": 28, - "column": 15, - "end_column": 33 + "line": 27, + "end_line": 27, + "column": 20, + "end_column": 38 }, "wtype": { "_type": "WType", @@ -1016,13 +917,95 @@ "immediates": [ "ZeroAddress" ], - "stack_args": [], - "comment": null + "stack_args": [] } } + }, + "op": "and", + "right": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/pre-approved-sale.algo.ts", + "line": 23, + "end_line": 29, + "column": 4, + "end_column": 6 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "IntrinsicCall", + "source_location": { + "file": "tests/approvals/pre-approved-sale.algo.ts", + "line": 23, + "end_line": 29, + "column": 4, + "end_column": 6 + }, + "wtype": { + "_type": "WType", + "name": "account", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "op_code": "gtxns", + "immediates": [ + "RekeyTo" + ], + "stack_args": [ + { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/pre-approved-sale.algo.ts", + "line": 23, + "end_line": 23, + "column": 16, + "end_column": 24 + }, + "wtype": { + "_type": "WGroupTransaction", + "name": "group_transaction_axfer", + "immutable": true, + "ephemeral": false, + "scalar_type": 2, + "transaction_type": 4 + }, + "name": "assetTxn" + } + ] + }, + "operator": "==", + "rhs": { + "_type": "IntrinsicCall", + "source_location": { + "file": "tests/approvals/pre-approved-sale.algo.ts", + "line": 28, + "end_line": 28, + "column": 15, + "end_column": 33 + }, + "wtype": { + "_type": "WType", + "name": "account", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "op_code": "global", + "immediates": [ + "ZeroAddress" + ], + "stack_args": [] + } } - ], - "comment": "assert target is match for conditions" + }, + "error_message": "assert target is match for conditions" } }, { diff --git a/tests/approvals/out/prefix-postfix-operators/prefix-postfix-operators.awst.json b/tests/approvals/out/prefix-postfix-operators/prefix-postfix-operators.awst.json index 6e1808dc..6728ba7a 100644 --- a/tests/approvals/out/prefix-postfix-operators/prefix-postfix-operators.awst.json +++ b/tests/approvals/out/prefix-postfix-operators/prefix-postfix-operators.awst.json @@ -1000,8 +1000,7 @@ }, "name": "y" } - ], - "comment": null + ] } } } diff --git a/tests/approvals/out/property-ordering/property-ordering.awst.json b/tests/approvals/out/property-ordering/property-ordering.awst.json index 572da091..2346d0d1 100644 --- a/tests/approvals/out/property-ordering/property-ordering.awst.json +++ b/tests/approvals/out/property-ordering/property-ordering.awst.json @@ -937,8 +937,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, diff --git a/tests/approvals/out/shadowed-variables/shadowed-variables.awst b/tests/approvals/out/shadowed-variables/shadowed-variables.awst index 31daf2f6..e9d9f4e4 100644 --- a/tests/approvals/out/shadowed-variables/shadowed-variables.awst +++ b/tests/approvals/out/shadowed-variables/shadowed-variables.awst @@ -6,16 +6,16 @@ contract ShadowedVariablesAlgo this.constructor() } [b, u, f]: readonlytuple[bytes, uint64, bool] = this.getValues() - assert("123" == b) + assert("123" == b, comment=a should be module const (bytes)) a: uint64 = u - assert(a == 123) + assert(a == 123, comment=a should be local const (uint)) a₁: bool = f - assert(!a₁) + assert(!a₁, comment=a should be local let (bool)) a₁: bool = !a₁ - assert(a₁) - assert(a₁) - assert(a == 123) - assert("123" == "123") + assert(a₁, comment=a should be modified local let (bool)) + assert(a₁, comment=a should still be modified local let (bool)) + assert(a == 123, comment=a should be local const (uint)) + assert("123" == "123", comment=a should be module const (bytes)) return True } diff --git a/tests/approvals/out/shadowed-variables/shadowed-variables.awst.json b/tests/approvals/out/shadowed-variables/shadowed-variables.awst.json index 0dc77dd2..c3b4e421 100644 --- a/tests/approvals/out/shadowed-variables/shadowed-variables.awst.json +++ b/tests/approvals/out/shadowed-variables/shadowed-variables.awst.json @@ -107,8 +107,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, @@ -334,7 +333,7 @@ "end_column": 55 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/shadowed-variables.algo.ts", "line": 9, @@ -349,66 +348,62 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/shadowed-variables.algo.ts", + "line": 9, + "end_line": 9, + "column": 11, + "end_column": 18 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/shadowed-variables.algo.ts", + "line": 4, + "end_line": 4, + "column": 16, + "end_column": 21 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "F)}j", + "encoding": "utf8" + }, + "operator": "==", + "rhs": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/shadowed-variables.algo.ts", "line": 9, "end_line": 9, - "column": 11, + "column": 17, "end_column": 18 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 - }, - "lhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/shadowed-variables.algo.ts", - "line": 4, - "end_line": 4, - "column": 16, - "end_column": 21 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "F)}j", - "encoding": "utf8" + "scalar_type": 1 }, - "operator": "==", - "rhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/shadowed-variables.algo.ts", - "line": 9, - "end_line": 9, - "column": 17, - "end_column": 18 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "name": "b" - } + "name": "b" } - ], - "comment": "a should be module const (bytes)" + }, + "error_message": "a should be module const (bytes)" } }, { @@ -477,7 +472,7 @@ "end_column": 57 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/shadowed-variables.algo.ts", "line": 12, @@ -492,66 +487,62 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/shadowed-variables.algo.ts", + "line": 12, + "end_line": 12, + "column": 13, + "end_column": 22 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/shadowed-variables.algo.ts", "line": 12, "end_line": 12, "column": 13, - "end_column": 22 + "end_column": 14 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/shadowed-variables.algo.ts", - "line": 12, - "end_line": 12, - "column": 13, - "end_column": 14 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "a" + "name": "a" + }, + "operator": "==", + "rhs": { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/shadowed-variables.algo.ts", + "line": 12, + "end_line": 12, + "column": 19, + "end_column": 22 }, - "operator": "==", - "rhs": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/shadowed-variables.algo.ts", - "line": 12, - "end_line": 12, - "column": 19, - "end_column": 22 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "123", - "teal_alias": null - } + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "value": "123", + "teal_alias": null } - ], - "comment": "a should be local const (uint)" + }, + "error_message": "a should be local const (uint)" } }, { @@ -620,7 +611,7 @@ "end_column": 50 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/shadowed-variables.algo.ts", "line": 15, @@ -635,16 +626,29 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "Not", + "condition": { + "_type": "Not", + "source_location": { + "file": "tests/approvals/shadowed-variables.algo.ts", + "line": 15, + "end_line": 15, + "column": 15, + "end_column": 17 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "expr": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/shadowed-variables.algo.ts", "line": 15, "end_line": 15, - "column": 15, + "column": 16, "end_column": 17 }, "wtype": { @@ -654,27 +658,10 @@ "ephemeral": false, "scalar_type": 2 }, - "expr": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/shadowed-variables.algo.ts", - "line": 15, - "end_line": 15, - "column": 16, - "end_column": 17 - }, - "wtype": { - "_type": "WType", - "name": "bool", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "a₁" - } + "name": "a₁" } - ], - "comment": "a should be local let (bool)" + }, + "error_message": "a should be local let (bool)" } }, { @@ -760,7 +747,7 @@ "end_column": 60 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/shadowed-variables.algo.ts", "line": 18, @@ -775,29 +762,25 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/shadowed-variables.algo.ts", - "line": 18, - "end_line": 18, - "column": 17, - "end_column": 18 - }, - "wtype": { - "_type": "WType", - "name": "bool", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "a₁" - } - ], - "comment": "a should be modified local let (bool)" + "condition": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/shadowed-variables.algo.ts", + "line": 18, + "end_line": 18, + "column": 17, + "end_column": 18 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "name": "a₁" + }, + "error_message": "a should be modified local let (bool)" } } ], @@ -814,7 +797,7 @@ "end_column": 64 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/shadowed-variables.algo.ts", "line": 20, @@ -829,29 +812,25 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/shadowed-variables.algo.ts", - "line": 20, - "end_line": 20, - "column": 15, - "end_column": 16 - }, - "wtype": { - "_type": "WType", - "name": "bool", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "a₁" - } - ], - "comment": "a should still be modified local let (bool)" + "condition": { + "_type": "VarExpression", + "source_location": { + "file": "tests/approvals/shadowed-variables.algo.ts", + "line": 20, + "end_line": 20, + "column": 15, + "end_column": 16 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "name": "a₁" + }, + "error_message": "a should still be modified local let (bool)" } } ], @@ -868,7 +847,7 @@ "end_column": 57 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/shadowed-variables.algo.ts", "line": 22, @@ -883,66 +862,62 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "NumericComparisonExpression", + "condition": { + "_type": "NumericComparisonExpression", + "source_location": { + "file": "tests/approvals/shadowed-variables.algo.ts", + "line": 22, + "end_line": 22, + "column": 13, + "end_column": 22 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "VarExpression", "source_location": { "file": "tests/approvals/shadowed-variables.algo.ts", "line": 22, "end_line": 22, "column": 13, - "end_column": 22 + "end_column": 14 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "uint64", "immutable": true, "ephemeral": false, "scalar_type": 2 }, - "lhs": { - "_type": "VarExpression", - "source_location": { - "file": "tests/approvals/shadowed-variables.algo.ts", - "line": 22, - "end_line": 22, - "column": 13, - "end_column": 14 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "name": "a" + "name": "a" + }, + "operator": "==", + "rhs": { + "_type": "IntegerConstant", + "source_location": { + "file": "tests/approvals/shadowed-variables.algo.ts", + "line": 22, + "end_line": 22, + "column": 19, + "end_column": 22 }, - "operator": "==", - "rhs": { - "_type": "IntegerConstant", - "source_location": { - "file": "tests/approvals/shadowed-variables.algo.ts", - "line": 22, - "end_line": 22, - "column": 19, - "end_column": 22 - }, - "wtype": { - "_type": "WType", - "name": "uint64", - "immutable": true, - "ephemeral": false, - "scalar_type": 2 - }, - "value": "123", - "teal_alias": null - } + "wtype": { + "_type": "WType", + "name": "uint64", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "value": "123", + "teal_alias": null } - ], - "comment": "a should be local const (uint)" + }, + "error_message": "a should be local const (uint)" } } ], @@ -959,7 +934,7 @@ "end_column": 66 }, "expr": { - "_type": "IntrinsicCall", + "_type": "AssertExpression", "source_location": { "file": "tests/approvals/shadowed-variables.algo.ts", "line": 24, @@ -974,67 +949,63 @@ "ephemeral": false, "scalar_type": null }, - "op_code": "assert", - "immediates": [], - "stack_args": [ - { - "_type": "BytesComparisonExpression", + "condition": { + "_type": "BytesComparisonExpression", + "source_location": { + "file": "tests/approvals/shadowed-variables.algo.ts", + "line": 24, + "end_line": 24, + "column": 11, + "end_column": 29 + }, + "wtype": { + "_type": "WType", + "name": "bool", + "immutable": true, + "ephemeral": false, + "scalar_type": 2 + }, + "lhs": { + "_type": "BytesConstant", + "source_location": { + "file": "tests/approvals/shadowed-variables.algo.ts", + "line": 4, + "end_line": 4, + "column": 16, + "end_column": 21 + }, + "wtype": { + "_type": "WType", + "name": "bytes", + "immutable": true, + "ephemeral": false, + "scalar_type": 1 + }, + "value": "F)}j", + "encoding": "utf8" + }, + "operator": "==", + "rhs": { + "_type": "BytesConstant", "source_location": { "file": "tests/approvals/shadowed-variables.algo.ts", "line": 24, "end_line": 24, - "column": 11, - "end_column": 29 + "column": 23, + "end_column": 28 }, "wtype": { "_type": "WType", - "name": "bool", + "name": "bytes", "immutable": true, "ephemeral": false, - "scalar_type": 2 - }, - "lhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/shadowed-variables.algo.ts", - "line": 4, - "end_line": 4, - "column": 16, - "end_column": 21 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "F)}j", - "encoding": "utf8" + "scalar_type": 1 }, - "operator": "==", - "rhs": { - "_type": "BytesConstant", - "source_location": { - "file": "tests/approvals/shadowed-variables.algo.ts", - "line": 24, - "end_line": 24, - "column": 23, - "end_column": 28 - }, - "wtype": { - "_type": "WType", - "name": "bytes", - "immutable": true, - "ephemeral": false, - "scalar_type": 1 - }, - "value": "F)}j", - "encoding": "utf8" - } + "value": "F)}j", + "encoding": "utf8" } - ], - "comment": "a should be module const (bytes)" + }, + "error_message": "a should be module const (bytes)" } }, { diff --git a/tests/approvals/out/strings/strings.awst.json b/tests/approvals/out/strings/strings.awst.json index ed2f873f..3839f298 100644 --- a/tests/approvals/out/strings/strings.awst.json +++ b/tests/approvals/out/strings/strings.awst.json @@ -109,8 +109,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } }, @@ -425,8 +424,7 @@ }, "name": "b" } - ], - "comment": null + ] } } ], diff --git a/tests/approvals/out/uint64-expressions/uint64-expressions.awst.json b/tests/approvals/out/uint64-expressions/uint64-expressions.awst.json index a4a7c6b1..f0afc366 100644 --- a/tests/approvals/out/uint64-expressions/uint64-expressions.awst.json +++ b/tests/approvals/out/uint64-expressions/uint64-expressions.awst.json @@ -345,8 +345,7 @@ "immediates": [ "ApplicationID" ], - "stack_args": [], - "comment": null + "stack_args": [] } } },