From 0d46dba30b8bded0c0567e51a0d968effddb3122 Mon Sep 17 00:00:00 2001 From: Joe Polny Date: Fri, 19 May 2023 21:25:51 -0400 Subject: [PATCH] 0.12.1: fix default create bare_call_config --- examples/calculator/artifacts/Calculator.json | 4 +++- examples/tuple_in_box/tealscript_artifacts/ContactsApp.json | 4 +++- package.json | 2 +- src/lib/compiler.ts | 2 +- tests/contracts/AccountTest.json | 4 +++- tests/contracts/BinaryTest.json | 4 +++- tests/contracts/IfTest.json | 4 +++- tests/contracts/ItxnsTest.json | 4 +++- tests/contracts/LoopsTest.json | 4 +++- tests/contracts/MathTest.json | 4 +++- tests/contracts/StorageTest.json | 4 +++- 11 files changed, 29 insertions(+), 11 deletions(-) diff --git a/examples/calculator/artifacts/Calculator.json b/examples/calculator/artifacts/Calculator.json index 9cffd4e1e..5247c0be8 100644 --- a/examples/calculator/artifacts/Calculator.json +++ b/examples/calculator/artifacts/Calculator.json @@ -6,7 +6,9 @@ } } }, - "bare_call_config": {}, + "bare_call_config": { + "no_op": "CREATE" + }, "schema": { "local": { "declared": {}, diff --git a/examples/tuple_in_box/tealscript_artifacts/ContactsApp.json b/examples/tuple_in_box/tealscript_artifacts/ContactsApp.json index e94be07bc..8fa978de7 100644 --- a/examples/tuple_in_box/tealscript_artifacts/ContactsApp.json +++ b/examples/tuple_in_box/tealscript_artifacts/ContactsApp.json @@ -21,7 +21,9 @@ } } }, - "bare_call_config": {}, + "bare_call_config": { + "no_op": "CREATE" + }, "schema": { "local": { "declared": {}, diff --git a/package.json b/package.json index 8fac519ec..06d68f4ed 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@algorandfoundation/tealscript", - "version": "0.12.0", + "version": "0.12.1", "description": "Enables Algorand smart contract development with native TypeScript syntax, tooling, and IDE support", "homepage": "https://github.com/algorand-devrel/TEALScript", "bugs": { diff --git a/src/lib/compiler.ts b/src/lib/compiler.ts index 8badf1f91..94d070787 100644 --- a/src/lib/compiler.ts +++ b/src/lib/compiler.ts @@ -2902,7 +2902,7 @@ export default class Compiler { if (oc === 'OptIn') bareCallConfig.opt_in = 'CALL'; }); - if (this.bareCreate) bareCallConfig.no_op = 'CREATE'; + if (this.bareCreate || !Object.values(this.handledActions).flat().includes('createApplication')) bareCallConfig.no_op = 'CREATE'; return appSpec; } diff --git a/tests/contracts/AccountTest.json b/tests/contracts/AccountTest.json index 2211ffe39..7ab860d81 100644 --- a/tests/contracts/AccountTest.json +++ b/tests/contracts/AccountTest.json @@ -81,7 +81,9 @@ } } }, - "bare_call_config": {}, + "bare_call_config": { + "no_op": "CREATE" + }, "schema": { "local": { "declared": {}, diff --git a/tests/contracts/BinaryTest.json b/tests/contracts/BinaryTest.json index 821626f78..2af5b366e 100644 --- a/tests/contracts/BinaryTest.json +++ b/tests/contracts/BinaryTest.json @@ -41,7 +41,9 @@ } } }, - "bare_call_config": {}, + "bare_call_config": { + "no_op": "CREATE" + }, "schema": { "local": { "declared": {}, diff --git a/tests/contracts/IfTest.json b/tests/contracts/IfTest.json index 57c9b3486..6b8252e2c 100644 --- a/tests/contracts/IfTest.json +++ b/tests/contracts/IfTest.json @@ -31,7 +31,9 @@ } } }, - "bare_call_config": {}, + "bare_call_config": { + "no_op": "CREATE" + }, "schema": { "local": { "declared": {}, diff --git a/tests/contracts/ItxnsTest.json b/tests/contracts/ItxnsTest.json index 89184d4d8..fcb63c5dc 100644 --- a/tests/contracts/ItxnsTest.json +++ b/tests/contracts/ItxnsTest.json @@ -46,7 +46,9 @@ } } }, - "bare_call_config": {}, + "bare_call_config": { + "no_op": "CREATE" + }, "schema": { "local": { "declared": {}, diff --git a/tests/contracts/LoopsTest.json b/tests/contracts/LoopsTest.json index 81b8ef703..868386683 100644 --- a/tests/contracts/LoopsTest.json +++ b/tests/contracts/LoopsTest.json @@ -11,7 +11,9 @@ } } }, - "bare_call_config": {}, + "bare_call_config": { + "no_op": "CREATE" + }, "schema": { "local": { "declared": {}, diff --git a/tests/contracts/MathTest.json b/tests/contracts/MathTest.json index ab87fcca9..5740df443 100644 --- a/tests/contracts/MathTest.json +++ b/tests/contracts/MathTest.json @@ -51,7 +51,9 @@ } } }, - "bare_call_config": {}, + "bare_call_config": { + "no_op": "CREATE" + }, "schema": { "local": { "declared": {}, diff --git a/tests/contracts/StorageTest.json b/tests/contracts/StorageTest.json index 1d248b4c3..ef696cc1a 100644 --- a/tests/contracts/StorageTest.json +++ b/tests/contracts/StorageTest.json @@ -121,7 +121,9 @@ } } }, - "bare_call_config": {}, + "bare_call_config": { + "no_op": "CREATE" + }, "schema": { "local": { "declared": {