From 615c8df525a57f97488bc8c9c14dd113569c270f Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 10:38:16 +0200 Subject: [PATCH 01/50] add pre-commit check for dissalowed words --- .husky/_/dissalowed_words.sh | 12 ++++++++++++ .husky/pre-commit | 1 + 2 files changed, 13 insertions(+) create mode 100644 .husky/_/dissalowed_words.sh diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh new file mode 100644 index 000000000..46f0238f2 --- /dev/null +++ b/.husky/_/dissalowed_words.sh @@ -0,0 +1,12 @@ +disallowed=".only(s" + +git diff --cached --name-status | while read x file; do + if [ "$x" == 'D' ]; then continue; fi + for word in $disallowed + do + if egrep $word $file ; then + echo "ERROR: Disallowed expression \"${word}\" in file: ${file}" + exit 1 + fi + done +done || exit $? \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit index f23377e95..b15fa986d 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,4 +1,5 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" +. "$(dirname "$0")/_/dissalowed_words.sh" yarn run lint-staged From 64992183df7c4cc45f96f9e97d725c666ea97737 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 10:41:11 +0200 Subject: [PATCH 02/50] change regular exp --- .husky/_/dissalowed_words.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 46f0238f2..df076e112 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -1,4 +1,4 @@ -disallowed=".only(s" +disallowed=".only/(" git diff --cached --name-status | while read x file; do if [ "$x" == 'D' ]; then continue; fi From ad32449ddd7d8f17ed80192bce74d08fcb6c1c44 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 10:41:31 +0200 Subject: [PATCH 03/50] change regular exp --- .husky/_/dissalowed_words.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index df076e112..777603385 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -1,4 +1,4 @@ -disallowed=".only/(" +disallowed="/.only/(" git diff --cached --name-status | while read x file; do if [ "$x" == 'D' ]; then continue; fi From 0732107aa923af0396b857f081c743922d4c085e Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 10:49:29 +0200 Subject: [PATCH 04/50] change regular exp --- .husky/_/dissalowed_words.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 777603385..802531d51 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -1,4 +1,4 @@ -disallowed="/.only/(" +disallowed="\.only\(" git diff --cached --name-status | while read x file; do if [ "$x" == 'D' ]; then continue; fi From 0a9838fd0b2ea3a5cef4e148ee296e4601db6be5 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 10:52:26 +0200 Subject: [PATCH 05/50] test --- .husky/_/dissalowed_words.sh | 4 +--- .../test/src/interpreter/inner-transaction.ts | 15 ++++++--------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 802531d51..e75528d9e 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -1,12 +1,10 @@ disallowed="\.only\(" + git diff --cached --name-status | while read x file; do if [ "$x" == 'D' ]; then continue; fi - for word in $disallowed - do if egrep $word $file ; then echo "ERROR: Disallowed expression \"${word}\" in file: ${file}" exit 1 fi - done done || exit $? \ No newline at end of file diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index c8832bfec..763adfa65 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1,17 +1,13 @@ import { decodeAddress, encodeAddress, getApplicationAddress } from "algosdk"; import { assert } from "chai"; + import { bobAcc } from "../../../../algob/test/mocks/account"; import { AccountStore } from "../../../src/account"; import { RUNTIME_ERRORS } from "../../../src/errors/errors-list"; import { getProgram, Runtime } from "../../../src/index"; import { Interpreter } from "../../../src/interpreter/interpreter"; import { ALGORAND_ACCOUNT_MIN_BALANCE } from "../../../src/lib/constants"; -import { - AccountAddress, - AccountStoreI, - ExecutionMode, - TxOnComplete, -} from "../../../src/types"; +import { AccountAddress, AccountStoreI, ExecutionMode, TxOnComplete } from "../../../src/types"; import { useFixture } from "../../helpers/integration"; import { expectRuntimeError } from "../../helpers/runtime-errors"; import { elonMuskAccount, johnAccount } from "../../mocks/account"; @@ -240,7 +236,9 @@ describe("Inner Transactions", function () { it(`should fail: "insufficient balance" because app account is charged fee`, function () { // set application account balance to 0 - const appAcc = interpreter.runtime.ctx.state.accounts.get(applicationAccount.account.addr); + const appAcc = interpreter.runtime.ctx.state.accounts.get( + applicationAccount.account.addr + ); if (appAcc) { appAcc.amount = BigInt(0); } @@ -1255,7 +1253,7 @@ describe("Inner Transactions", function () { }); }); - describe("Teal v6 update", function () { + describe.only("Teal v6 update", function () { this.beforeEach(function () { setUpInterpreter(6, ALGORAND_ACCOUNT_MIN_BALANCE); }); @@ -1477,6 +1475,5 @@ describe("Inner Transactions", function () { assert.equal(receiver, foreignAppAccAddr); }); }); - }); }); From 59a82e0de84d6a5895cbfbd96cdbbdc247ff86f9 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 10:52:56 +0200 Subject: [PATCH 06/50] test --- .husky/_/dissalowed_words.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index e75528d9e..44a79d3a6 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -3,7 +3,7 @@ disallowed="\.only\(" git diff --cached --name-status | while read x file; do if [ "$x" == 'D' ]; then continue; fi - if egrep $word $file ; then + if egrep $dissalowed $file ; then echo "ERROR: Disallowed expression \"${word}\" in file: ${file}" exit 1 fi From 6dda558ccf2952fc68a1e63b1e96be816deedbb9 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 10:53:56 +0200 Subject: [PATCH 07/50] test --- .husky/_/dissalowed_words.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 44a79d3a6..7278006c6 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -4,7 +4,7 @@ disallowed="\.only\(" git diff --cached --name-status | while read x file; do if [ "$x" == 'D' ]; then continue; fi if egrep $dissalowed $file ; then - echo "ERROR: Disallowed expression \"${word}\" in file: ${file}" + echo "ERROR: Disallowed expression \"${dissalowed}\" in file: ${file}" exit 1 fi done || exit $? \ No newline at end of file From 4391b9de7c82eb23d953403f330c948cc6d49fe6 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 11:07:34 +0200 Subject: [PATCH 08/50] updated script --- .husky/_/dissalowed_words.sh | 9 +++------ .../runtime/test/src/interpreter/inner-transaction.ts | 2 +- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 7278006c6..68e2e2737 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -1,10 +1,7 @@ -disallowed="\.only\(" - - git diff --cached --name-status | while read x file; do if [ "$x" == 'D' ]; then continue; fi - if egrep $dissalowed $file ; then - echo "ERROR: Disallowed expression \"${dissalowed}\" in file: ${file}" + if grep -rq --include $file it.only ; then + echo 'ERROR: Dissalowed it.only() in your tests in file: ${file}' exit 1 - fi + fi done || exit $? \ No newline at end of file diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index 763adfa65..b21d905b6 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1253,7 +1253,7 @@ describe("Inner Transactions", function () { }); }); - describe.only("Teal v6 update", function () { + describe("Teal v6 update", function () { this.beforeEach(function () { setUpInterpreter(6, ALGORAND_ACCOUNT_MIN_BALANCE); }); From 2de01e86ce6a50414907a3e96b594ea70b5657b3 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 11:08:06 +0200 Subject: [PATCH 09/50] test should fail --- packages/runtime/test/src/interpreter/inner-transaction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index b21d905b6..763adfa65 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1253,7 +1253,7 @@ describe("Inner Transactions", function () { }); }); - describe("Teal v6 update", function () { + describe.only("Teal v6 update", function () { this.beforeEach(function () { setUpInterpreter(6, ALGORAND_ACCOUNT_MIN_BALANCE); }); From f6a21bd1bb465c79c4a6b0dd7c70f5219b116519 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 11:28:07 +0200 Subject: [PATCH 10/50] updated script --- .husky/_/dissalowed_words.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 68e2e2737..659d56c6c 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -1,7 +1,12 @@ +RED='\033[0;31m' +NC='\033[0m' # No Color +PURPLE='\033[0;35m' +YELLOW='\033[1;33m' + git diff --cached --name-status | while read x file; do - if [ "$x" == 'D' ]; then continue; fi - if grep -rq --include $file it.only ; then - echo 'ERROR: Dissalowed it.only() in your tests in file: ${file}' - exit 1 + if [ "$x" == 'D' ]; then continue; fi + if egrep -q "\.only\(" $file ; then + echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}it.only()${NC} in file: ${PURPLE}${file}${NC}" + exit 1 fi done || exit $? \ No newline at end of file From 300754940b9668327b0ea8829196cd6fd32c0eb1 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 11:31:38 +0200 Subject: [PATCH 11/50] test --- .husky/_/dissalowed_words.sh | 6 ++++-- packages/runtime/test/src/interpreter/inner-transaction.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 659d56c6c..bd80a510a 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -2,11 +2,13 @@ RED='\033[0;31m' NC='\033[0m' # No Color PURPLE='\033[0;35m' YELLOW='\033[1;33m' +status=0; git diff --cached --name-status | while read x file; do if [ "$x" == 'D' ]; then continue; fi if egrep -q "\.only\(" $file ; then echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}it.only()${NC} in file: ${PURPLE}${file}${NC}" - exit 1 + status = 1; fi -done || exit $? \ No newline at end of file + +done || exit ${status} \ No newline at end of file diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index 763adfa65..89a4874a5 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1258,7 +1258,7 @@ describe("Inner Transactions", function () { setUpInterpreter(6, ALGORAND_ACCOUNT_MIN_BALANCE); }); - describe("keyreg transaction", function () { + describe.only("keyreg transaction", function () { let program: string; this.beforeEach(function () { // init more balance for application to test inner transaction From 6bd8a28b985682dc9fa7e582ec7672f5a454b53d Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 11:32:13 +0200 Subject: [PATCH 12/50] test --- .husky/_/dissalowed_words.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index bd80a510a..213b665c8 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -8,7 +8,5 @@ git diff --cached --name-status | while read x file; do if [ "$x" == 'D' ]; then continue; fi if egrep -q "\.only\(" $file ; then echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}it.only()${NC} in file: ${PURPLE}${file}${NC}" - status = 1; fi - done || exit ${status} \ No newline at end of file From 4942e8d134945e95b00fafb113249fe6e990ed92 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 11:32:40 +0200 Subject: [PATCH 13/50] test --- .husky/_/dissalowed_words.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 213b665c8..96c67b1ef 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -8,5 +8,6 @@ git diff --cached --name-status | while read x file; do if [ "$x" == 'D' ]; then continue; fi if egrep -q "\.only\(" $file ; then echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}it.only()${NC} in file: ${PURPLE}${file}${NC}" + status=1 fi done || exit ${status} \ No newline at end of file From ae46dc04ace3d5a172611422c97d01f51da6aa34 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 11:34:53 +0200 Subject: [PATCH 14/50] test --- .husky/_/dissalowed_words.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 96c67b1ef..266def785 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -10,4 +10,5 @@ git diff --cached --name-status | while read x file; do echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}it.only()${NC} in file: ${PURPLE}${file}${NC}" status=1 fi -done || exit ${status} \ No newline at end of file +done +exit ${status} \ No newline at end of file From 0e847105dc6a8f382d3107c58c61135f1c7b531d Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 11:38:58 +0200 Subject: [PATCH 15/50] test --- .husky/_/dissalowed_words.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 266def785..780efae6f 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -7,8 +7,9 @@ status=0; git diff --cached --name-status | while read x file; do if [ "$x" == 'D' ]; then continue; fi if egrep -q "\.only\(" $file ; then - echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}it.only()${NC} in file: ${PURPLE}${file}${NC}" + echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}.only()${NC} in file: ${PURPLE}${file}${NC}" status=1 fi done -exit ${status} \ No newline at end of file +echo "value of status ${status}" +exit $status \ No newline at end of file From 9bfe63324aec7eb8fd573a315fed54605e48300a Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 11:39:18 +0200 Subject: [PATCH 16/50] test --- .husky/_/dissalowed_words.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 780efae6f..cb49c2d04 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -8,7 +8,7 @@ git diff --cached --name-status | while read x file; do if [ "$x" == 'D' ]; then continue; fi if egrep -q "\.only\(" $file ; then echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}.only()${NC} in file: ${PURPLE}${file}${NC}" - status=1 + status=1; fi done echo "value of status ${status}" From 7fa00cdddb5aa1c34740121310ffa0d5cfc8adcc Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 11:46:38 +0200 Subject: [PATCH 17/50] test --- .husky/_/dissalowed_words.sh | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index cb49c2d04..ae4594ca1 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -1,15 +1,18 @@ -RED='\033[0;31m' -NC='\033[0m' # No Color -PURPLE='\033[0;35m' -YELLOW='\033[1;33m' -status=0; +# RED='\033[0;31m' +# NC='\033[0m' # No Color +# PURPLE='\033[0;35m' +# YELLOW='\033[1;33m' +# status=0; + +# git diff --cached --name-status | while read x file; do +# if [ "$x" == 'D' ]; then continue; fi +# if egrep -q "\.only\(" $file ; then +# echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}.only()${NC} in file: ${PURPLE}${file}${NC}" +# status=1; +# fi +# done +# [ $status -eq 1 ] || exit 1 git diff --cached --name-status | while read x file; do - if [ "$x" == 'D' ]; then continue; fi - if egrep -q "\.only\(" $file ; then - echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}.only()${NC} in file: ${PURPLE}${file}${NC}" - status=1; - fi -done -echo "value of status ${status}" -exit $status \ No newline at end of file + echo "${file}" +done || exit 0 \ No newline at end of file From 66fb5f3ffb0406ec8f92011b60e8c5a9aa44e06b Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 11:46:58 +0200 Subject: [PATCH 18/50] test --- packages/runtime/test/src/interpreter/inner-transaction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index 89a4874a5..763adfa65 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1258,7 +1258,7 @@ describe("Inner Transactions", function () { setUpInterpreter(6, ALGORAND_ACCOUNT_MIN_BALANCE); }); - describe.only("keyreg transaction", function () { + describe("keyreg transaction", function () { let program: string; this.beforeEach(function () { // init more balance for application to test inner transaction From c10b9a55e9b58a28a57803e3671f7e44c2f3b584 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 12:03:52 +0200 Subject: [PATCH 19/50] test --- .husky/_/dissalowed_words.sh | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index ae4594ca1..7423adb27 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -1,18 +1,15 @@ -# RED='\033[0;31m' -# NC='\033[0m' # No Color -# PURPLE='\033[0;35m' -# YELLOW='\033[1;33m' -# status=0; - -# git diff --cached --name-status | while read x file; do -# if [ "$x" == 'D' ]; then continue; fi -# if egrep -q "\.only\(" $file ; then -# echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}.only()${NC} in file: ${PURPLE}${file}${NC}" -# status=1; -# fi -# done -# [ $status -eq 1 ] || exit 1 +RED='\033[0;31m' +NC='\033[0m' # No Color +PURPLE='\033[0;35m' +YELLOW='\033[1;33m' +status=0; git diff --cached --name-status | while read x file; do - echo "${file}" -done || exit 0 \ No newline at end of file + if [ "$x" == 'D' ]; then continue; fi + if [[ ${file: -3} != ".ts" || ${file: -3} != ".js" ]]; then continue; fi + if egrep -q "\.only\(" $file ; then + echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}.only()${NC} in file: ${PURPLE}${file}${NC}" + status=1; + fi +done +exit ${status} \ No newline at end of file From 5018bb34d8132e314e115459926d3264aa3903a6 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 12:04:13 +0200 Subject: [PATCH 20/50] test --- packages/runtime/test/src/interpreter/inner-transaction.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index 763adfa65..207e6ec2e 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1253,12 +1253,12 @@ describe("Inner Transactions", function () { }); }); - describe.only("Teal v6 update", function () { + describe("Teal v6 update", function () { this.beforeEach(function () { setUpInterpreter(6, ALGORAND_ACCOUNT_MIN_BALANCE); }); - describe("keyreg transaction", function () { + describe.only("keyreg transaction", function () { let program: string; this.beforeEach(function () { // init more balance for application to test inner transaction From 520373bdc9ef126dbfaaf83924061487def0a514 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 12:05:30 +0200 Subject: [PATCH 21/50] test --- .husky/_/dissalowed_words.sh | 2 +- packages/runtime/test/src/interpreter/inner-transaction.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 7423adb27..fe936fefd 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -6,7 +6,7 @@ status=0; git diff --cached --name-status | while read x file; do if [ "$x" == 'D' ]; then continue; fi - if [[ ${file: -3} != ".ts" || ${file: -3} != ".js" ]]; then continue; fi + if [[ ${file: -3} != ".ts"] || [${file: -3} != ".js" ]]; then continue; fi if egrep -q "\.only\(" $file ; then echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}.only()${NC} in file: ${PURPLE}${file}${NC}" status=1; diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index 207e6ec2e..89a4874a5 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1253,7 +1253,7 @@ describe("Inner Transactions", function () { }); }); - describe("Teal v6 update", function () { + describe.only("Teal v6 update", function () { this.beforeEach(function () { setUpInterpreter(6, ALGORAND_ACCOUNT_MIN_BALANCE); }); From a69d617a504a1e32b41c82f405930c777ed3cfd8 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 12:05:42 +0200 Subject: [PATCH 22/50] test --- packages/runtime/test/src/interpreter/inner-transaction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index 89a4874a5..207e6ec2e 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1253,7 +1253,7 @@ describe("Inner Transactions", function () { }); }); - describe.only("Teal v6 update", function () { + describe("Teal v6 update", function () { this.beforeEach(function () { setUpInterpreter(6, ALGORAND_ACCOUNT_MIN_BALANCE); }); From 30be61d9c132e83359428cef287ed10542f4203b Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 12:12:23 +0200 Subject: [PATCH 23/50] test --- .husky/_/dissalowed_words.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index fe936fefd..327c3eb35 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -6,7 +6,7 @@ status=0; git diff --cached --name-status | while read x file; do if [ "$x" == 'D' ]; then continue; fi - if [[ ${file: -3} != ".ts"] || [${file: -3} != ".js" ]]; then continue; fi + # if [[ ${file: -3} != ".ts"] || [${file: -3} != ".js" ]]; then continue; fi if egrep -q "\.only\(" $file ; then echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}.only()${NC} in file: ${PURPLE}${file}${NC}" status=1; From f7fbb91e4f27ba16d1540d3a4ff4dfd5dbf597f0 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 12:14:25 +0200 Subject: [PATCH 24/50] test --- .husky/_/dissalowed_words.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 327c3eb35..e21ac9b30 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -12,4 +12,4 @@ git diff --cached --name-status | while read x file; do status=1; fi done -exit ${status} \ No newline at end of file +exit $status \ No newline at end of file From 02bd4d0eb458835f606a8e96396008ca3937881f Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 12:50:24 +0200 Subject: [PATCH 25/50] test --- .husky/_/dissalowed_words.sh | 9 +++++---- .../runtime/test/src/interpreter/inner-transaction.ts | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index e21ac9b30..f535ca464 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -2,14 +2,15 @@ RED='\033[0;31m' NC='\033[0m' # No Color PURPLE='\033[0;35m' YELLOW='\033[1;33m' -status=0; +failing=0; git diff --cached --name-status | while read x file; do if [ "$x" == 'D' ]; then continue; fi - # if [[ ${file: -3} != ".ts"] || [${file: -3} != ".js" ]]; then continue; fi + if ! [[ ${file: -3} == ".ts" ]]; then echo "przeszło"; fi if egrep -q "\.only\(" $file ; then echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}.only()${NC} in file: ${PURPLE}${file}${NC}" - status=1; + ((failing+=1)); fi done -exit $status \ No newline at end of file +if [ $failing != 0 ]; then exit 1; else exit 0; fi +exit; \ No newline at end of file diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index 207e6ec2e..89a4874a5 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1253,7 +1253,7 @@ describe("Inner Transactions", function () { }); }); - describe("Teal v6 update", function () { + describe.only("Teal v6 update", function () { this.beforeEach(function () { setUpInterpreter(6, ALGORAND_ACCOUNT_MIN_BALANCE); }); From c3c48fea8ed4fbcb05e165e2cdb7ff298c651197 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 12:50:38 +0200 Subject: [PATCH 26/50] test --- .husky/_/dissalowed_words.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index f535ca464..34c938bc0 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -6,7 +6,7 @@ failing=0; git diff --cached --name-status | while read x file; do if [ "$x" == 'D' ]; then continue; fi - if ! [[ ${file: -3} == ".ts" ]]; then echo "przeszło"; fi + if ! [[ ${file: -3} == ".ts" ]]; then continue; fi if egrep -q "\.only\(" $file ; then echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}.only()${NC} in file: ${PURPLE}${file}${NC}" ((failing+=1)); From 49ccedcb98f48812d1102b8f5c4e6d488bca3f5b Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 13:17:40 +0200 Subject: [PATCH 27/50] test --- .husky/_/dissalowed_words.sh | 19 +++++++++++-------- .../test/src/interpreter/inner-transaction.ts | 2 +- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 34c938bc0..4cf2517ce 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -1,16 +1,19 @@ +#!/bin/bash RED='\033[0;31m' NC='\033[0m' # No Color PURPLE='\033[0;35m' YELLOW='\033[1;33m' -failing=0; - -git diff --cached --name-status | while read x file; do +status=0 +set -o pipefail +func() { + git diff --cached --name-status | while read x file; do if [ "$x" == 'D' ]; then continue; fi - if ! [[ ${file: -3} == ".ts" ]]; then continue; fi - if egrep -q "\.only\(" $file ; then + if ! [[ "${file: -3}" == ".ts" ]] || [[ "${file: -3}" == ".js" ]]; then continue; fi + if gerp -E -q "\.only\(" "$file" ; then echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}.only()${NC} in file: ${PURPLE}${file}${NC}" - ((failing+=1)); + status=1; fi done -if [ $failing != 0 ]; then exit 1; else exit 0; fi -exit; \ No newline at end of file +exit $status +} +func; \ No newline at end of file diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index 89a4874a5..763adfa65 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1258,7 +1258,7 @@ describe("Inner Transactions", function () { setUpInterpreter(6, ALGORAND_ACCOUNT_MIN_BALANCE); }); - describe.only("keyreg transaction", function () { + describe("keyreg transaction", function () { let program: string; this.beforeEach(function () { // init more balance for application to test inner transaction From c39d07d718586fc1d553c9c9423ca5c80e1de8e1 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 13:18:50 +0200 Subject: [PATCH 28/50] test --- .husky/_/dissalowed_words.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 4cf2517ce..e2ebc017c 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -3,9 +3,9 @@ RED='\033[0;31m' NC='\033[0m' # No Color PURPLE='\033[0;35m' YELLOW='\033[1;33m' -status=0 set -o pipefail func() { + status=0 git diff --cached --name-status | while read x file; do if [ "$x" == 'D' ]; then continue; fi if ! [[ "${file: -3}" == ".ts" ]] || [[ "${file: -3}" == ".js" ]]; then continue; fi From 9d1ecb7a4d80c69f02aa09228cec9d13c7da5401 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 13:19:02 +0200 Subject: [PATCH 29/50] test --- packages/runtime/test/src/interpreter/inner-transaction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index 763adfa65..89a4874a5 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1258,7 +1258,7 @@ describe("Inner Transactions", function () { setUpInterpreter(6, ALGORAND_ACCOUNT_MIN_BALANCE); }); - describe("keyreg transaction", function () { + describe.only("keyreg transaction", function () { let program: string; this.beforeEach(function () { // init more balance for application to test inner transaction From 2d75424b06daeb77780a2ae69fd7449e51f0ff22 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 13:19:18 +0200 Subject: [PATCH 30/50] test --- .husky/_/dissalowed_words.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index e2ebc017c..b7c83ba05 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -9,7 +9,7 @@ func() { git diff --cached --name-status | while read x file; do if [ "$x" == 'D' ]; then continue; fi if ! [[ "${file: -3}" == ".ts" ]] || [[ "${file: -3}" == ".js" ]]; then continue; fi - if gerp -E -q "\.only\(" "$file" ; then + if grep -E -q "\.only\(" "$file" ; then echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}.only()${NC} in file: ${PURPLE}${file}${NC}" status=1; fi From 693faaccb1e15460b81bd1d30fbb5226f20b06c3 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 13:27:15 +0200 Subject: [PATCH 31/50] test --- .husky/_/dissalowed_words.sh | 19 ++++++++++--------- .../test/src/interpreter/inner-transaction.ts | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index b7c83ba05..6fc0b2eb0 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -7,13 +7,14 @@ set -o pipefail func() { status=0 git diff --cached --name-status | while read x file; do - if [ "$x" == 'D' ]; then continue; fi - if ! [[ "${file: -3}" == ".ts" ]] || [[ "${file: -3}" == ".js" ]]; then continue; fi - if grep -E -q "\.only\(" "$file" ; then - echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}.only()${NC} in file: ${PURPLE}${file}${NC}" - status=1; - fi -done -exit $status + if [ "$x" == 'D' ]; then continue; fi + if ! [[ "${file: -3}" == ".ts" ]] || [[ "${file: -3}" == ".js" ]]; then continue; fi + if grep -E -q "\.only\(" "$file" ; then + echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}.only()${NC} in file: ${PURPLE}${file}${NC}" + status=1; + fi + done + exit $status } -func; \ No newline at end of file +func; +exit $?; \ No newline at end of file diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index 89a4874a5..763adfa65 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1258,7 +1258,7 @@ describe("Inner Transactions", function () { setUpInterpreter(6, ALGORAND_ACCOUNT_MIN_BALANCE); }); - describe.only("keyreg transaction", function () { + describe("keyreg transaction", function () { let program: string; this.beforeEach(function () { // init more balance for application to test inner transaction From c792519b418c1a8927cad54dff68c74fe609a85f Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 14:21:54 +0200 Subject: [PATCH 32/50] updated script to display several files at once and only check .ts and .js --- .husky/_/dissalowed_words.sh | 36 +++++++++---------- .../test/src/interpreter/inner-transaction.ts | 15 ++++---- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 6fc0b2eb0..0738b0189 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -1,20 +1,16 @@ -#!/bin/bash -RED='\033[0;31m' -NC='\033[0m' # No Color -PURPLE='\033[0;35m' -YELLOW='\033[1;33m' -set -o pipefail -func() { - status=0 - git diff --cached --name-status | while read x file; do - if [ "$x" == 'D' ]; then continue; fi - if ! [[ "${file: -3}" == ".ts" ]] || [[ "${file: -3}" == ".js" ]]; then continue; fi - if grep -E -q "\.only\(" "$file" ; then - echo "${RED}ERROR:${NC} Disallowed expression ${YELLOW}.only()${NC} in file: ${PURPLE}${file}${NC}" - status=1; - fi - done - exit $status -} -func; -exit $?; \ No newline at end of file +#!/opt/homebrew/bin/bash +COLOR_REST="$(tput sgr0)" +COLOR_MAGENTA="$(tput setaf 4)" +COLOR_RED="$(tput setaf 1)" +COLOR_YELLOW="$(tput setaf 3)" +status=0 +set +o posix +while read x file; do + if [ "$x" == 'D' ]; then continue; fi + if ! [[ "${file: -3}" == ".ts" ]] || [[ "${file: -3}" == ".js" ]]; then continue; fi + if grep -E -q "\.only\(" "$file" ; then + printf "%40s\n" "${COLOR_RED}ERROR:${COLOR_REST} Disallowed expression${COLOR_YELLOW} .only()${COLOR_REST} in file: $COLOR_MAGENTA${file}$COLOR_REST" + status=1 + fi +done < <(git diff --cached --name-status); +exit $status \ No newline at end of file diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index 763adfa65..c8832bfec 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1,13 +1,17 @@ import { decodeAddress, encodeAddress, getApplicationAddress } from "algosdk"; import { assert } from "chai"; - import { bobAcc } from "../../../../algob/test/mocks/account"; import { AccountStore } from "../../../src/account"; import { RUNTIME_ERRORS } from "../../../src/errors/errors-list"; import { getProgram, Runtime } from "../../../src/index"; import { Interpreter } from "../../../src/interpreter/interpreter"; import { ALGORAND_ACCOUNT_MIN_BALANCE } from "../../../src/lib/constants"; -import { AccountAddress, AccountStoreI, ExecutionMode, TxOnComplete } from "../../../src/types"; +import { + AccountAddress, + AccountStoreI, + ExecutionMode, + TxOnComplete, +} from "../../../src/types"; import { useFixture } from "../../helpers/integration"; import { expectRuntimeError } from "../../helpers/runtime-errors"; import { elonMuskAccount, johnAccount } from "../../mocks/account"; @@ -236,9 +240,7 @@ describe("Inner Transactions", function () { it(`should fail: "insufficient balance" because app account is charged fee`, function () { // set application account balance to 0 - const appAcc = interpreter.runtime.ctx.state.accounts.get( - applicationAccount.account.addr - ); + const appAcc = interpreter.runtime.ctx.state.accounts.get(applicationAccount.account.addr); if (appAcc) { appAcc.amount = BigInt(0); } @@ -1253,7 +1255,7 @@ describe("Inner Transactions", function () { }); }); - describe.only("Teal v6 update", function () { + describe("Teal v6 update", function () { this.beforeEach(function () { setUpInterpreter(6, ALGORAND_ACCOUNT_MIN_BALANCE); }); @@ -1475,5 +1477,6 @@ describe("Inner Transactions", function () { assert.equal(receiver, foreignAppAccAddr); }); }); + }); }); From 0ad2e6b260566dd7e5b5864c20f95b36b05667c0 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 14:45:48 +0200 Subject: [PATCH 33/50] showcase --- .husky/pre-commit | 2 +- .../test/src/interpreter/inner-transaction.ts | 18 ++++++++---------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index b15fa986d..151b97760 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,5 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -. "$(dirname "$0")/_/dissalowed_words.sh" +# . "$(dirname "$0")/_/dissalowed_words.sh" yarn run lint-staged diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index c8832bfec..fd90d7b95 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1,17 +1,13 @@ import { decodeAddress, encodeAddress, getApplicationAddress } from "algosdk"; import { assert } from "chai"; + import { bobAcc } from "../../../../algob/test/mocks/account"; import { AccountStore } from "../../../src/account"; import { RUNTIME_ERRORS } from "../../../src/errors/errors-list"; import { getProgram, Runtime } from "../../../src/index"; import { Interpreter } from "../../../src/interpreter/interpreter"; import { ALGORAND_ACCOUNT_MIN_BALANCE } from "../../../src/lib/constants"; -import { - AccountAddress, - AccountStoreI, - ExecutionMode, - TxOnComplete, -} from "../../../src/types"; +import { AccountAddress, AccountStoreI, ExecutionMode, TxOnComplete } from "../../../src/types"; import { useFixture } from "../../helpers/integration"; import { expectRuntimeError } from "../../helpers/runtime-errors"; import { elonMuskAccount, johnAccount } from "../../mocks/account"; @@ -240,7 +236,9 @@ describe("Inner Transactions", function () { it(`should fail: "insufficient balance" because app account is charged fee`, function () { // set application account balance to 0 - const appAcc = interpreter.runtime.ctx.state.accounts.get(applicationAccount.account.addr); + const appAcc = interpreter.runtime.ctx.state.accounts.get( + applicationAccount.account.addr + ); if (appAcc) { appAcc.amount = BigInt(0); } @@ -1255,7 +1253,7 @@ describe("Inner Transactions", function () { }); }); - describe("Teal v6 update", function () { + describe.only("Teal v6 update", function () { this.beforeEach(function () { setUpInterpreter(6, ALGORAND_ACCOUNT_MIN_BALANCE); }); @@ -1266,7 +1264,8 @@ describe("Inner Transactions", function () { // init more balance for application to test inner transaction setUpInterpreter(6, ALGORAND_ACCOUNT_MIN_BALANCE * 10); }); - + const showcase = + "lfjksdafjsdal;kfjdasflkjsdf;lkjsdalfkjsadlfkjasdl;fjsda;lfjsdal;fkjsdalkfjasd;lkfjsdalkfjasdl;fjksad;lkfjsdlkjfls;adkjfals;dfjasldkfjasdklfasdfsdfsdaf"; it("Should support keyreg transaction", function () { program = ` itxn_begin @@ -1477,6 +1476,5 @@ describe("Inner Transactions", function () { assert.equal(receiver, foreignAppAccAddr); }); }); - }); }); From 2333c02b9e11f7bcd186dea9b7e3455594f3b457 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 14:46:18 +0200 Subject: [PATCH 34/50] showcase --- packages/runtime/test/src/interpreter/inner-transaction.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index fd90d7b95..aed519296 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1265,7 +1265,7 @@ describe("Inner Transactions", function () { setUpInterpreter(6, ALGORAND_ACCOUNT_MIN_BALANCE * 10); }); const showcase = - "lfjksdafjsdal;kfjdasflkjsdf;lkjsdalfkjsadlfkjasdl;fjsda;lfjsdal;fkjsdalkfjasd;lkfjsdalkfjasdl;fjksad;lkfjsdlkjfls;adkjfals;dfjasldkfjasdklfasdfsdfsdaf"; + "lfjksdsadasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdafjsdal;kfjdasflkjsdf;lkjsdalfkjsadlfkjasdl;fjsda;lfjsdal;fkjsdalkfjasd;lkfjsdalkfjasdl;fjksad;lkfjsdlkjfls;adkjfals;dfjasldkfjasdklfasdfsdfsdaf "; it("Should support keyreg transaction", function () { program = ` itxn_begin From 5c4cb024a51299bfb9697d1b16a12ad712b2101c Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 15:51:22 +0200 Subject: [PATCH 35/50] change the bash --- .husky/_/dissalowed_words.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 0738b0189..d72daaeb7 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -1,4 +1,4 @@ -#!/opt/homebrew/bin/bash +#!/bin/sh COLOR_REST="$(tput sgr0)" COLOR_MAGENTA="$(tput setaf 4)" COLOR_RED="$(tput setaf 1)" From de5c93408b2f1f015a134048db5f4f31b81319d2 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 15:54:16 +0200 Subject: [PATCH 36/50] update change log --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 362884512..c3cb40e94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,6 +50,7 @@ from `algosdk` and sends it to the network. - Added support for new txn opcode fileds `ApprovalProgramPages`, `ClearProgramStatePages`, `NumApprovalProgramPages`, `NumClearProgramStatePages`. - Added additional checks for the `maxStackByteElementSize` and `maxProgramLength` in `Runtime`. - Added partial support for `bn254` opcodes. The full support delyed until the official release of `TEALv8/v9`. +- Added a new pre-commit hook to check if there are any `.only`in tests . If there are any it will display error in which files the problem was found. #### @algo-builder/web - Added support for logic signature to `executeTx` method of `Webmode` for AlgoSigner, MyAlgo Wallet and Wallet Connect. From ed6d2741b921080e4feb967f66ea304832a057b4 Mon Sep 17 00:00:00 2001 From: sczembor <43810037+sczembor@users.noreply.github.com> Date: Mon, 24 Oct 2022 15:56:41 +0200 Subject: [PATCH 37/50] Update packages/runtime/test/src/interpreter/inner-transaction.ts --- packages/runtime/test/src/interpreter/inner-transaction.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index aed519296..3f62973d4 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1264,8 +1264,6 @@ describe("Inner Transactions", function () { // init more balance for application to test inner transaction setUpInterpreter(6, ALGORAND_ACCOUNT_MIN_BALANCE * 10); }); - const showcase = - "lfjksdsadasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdasdafjsdal;kfjdasflkjsdf;lkjsdalfkjsadlfkjasdl;fjsda;lfjsdal;fkjsdalkfjasd;lkfjsdalkfjasdl;fjksad;lkfjsdlkjfls;adkjfals;dfjasldkfjasdklfasdfsdfsdaf "; it("Should support keyreg transaction", function () { program = ` itxn_begin From b0fc1faedba14e603c13a55aac13a77cd01b1641 Mon Sep 17 00:00:00 2001 From: sczembor <43810037+sczembor@users.noreply.github.com> Date: Mon, 24 Oct 2022 15:58:59 +0200 Subject: [PATCH 38/50] Apply suggestions from code review --- .husky/pre-commit | 2 +- packages/runtime/test/src/interpreter/inner-transaction.ts | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 151b97760..b15fa986d 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,5 @@ #!/bin/sh . "$(dirname "$0")/_/husky.sh" -# . "$(dirname "$0")/_/dissalowed_words.sh" +. "$(dirname "$0")/_/dissalowed_words.sh" yarn run lint-staged diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index 3f62973d4..80d02506b 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1,6 +1,5 @@ import { decodeAddress, encodeAddress, getApplicationAddress } from "algosdk"; import { assert } from "chai"; - import { bobAcc } from "../../../../algob/test/mocks/account"; import { AccountStore } from "../../../src/account"; import { RUNTIME_ERRORS } from "../../../src/errors/errors-list"; @@ -236,9 +235,7 @@ describe("Inner Transactions", function () { it(`should fail: "insufficient balance" because app account is charged fee`, function () { // set application account balance to 0 - const appAcc = interpreter.runtime.ctx.state.accounts.get( - applicationAccount.account.addr - ); + const appAcc = interpreter.runtime.ctx.state.accounts.get(applicationAccount.account.addr); if (appAcc) { appAcc.amount = BigInt(0); } From ca5611cc75e48251c7626c876979a777a8db0219 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 16:04:13 +0200 Subject: [PATCH 39/50] cleanup --- .../runtime/test/src/interpreter/inner-transaction.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index 80d02506b..a9e3eb367 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1,12 +1,18 @@ import { decodeAddress, encodeAddress, getApplicationAddress } from "algosdk"; import { assert } from "chai"; + import { bobAcc } from "../../../../algob/test/mocks/account"; import { AccountStore } from "../../../src/account"; import { RUNTIME_ERRORS } from "../../../src/errors/errors-list"; import { getProgram, Runtime } from "../../../src/index"; import { Interpreter } from "../../../src/interpreter/interpreter"; import { ALGORAND_ACCOUNT_MIN_BALANCE } from "../../../src/lib/constants"; -import { AccountAddress, AccountStoreI, ExecutionMode, TxOnComplete } from "../../../src/types"; +import { + AccountAddress, + AccountStoreI, + ExecutionMode, + TxOnComplete, +} from "../../../src/types"; import { useFixture } from "../../helpers/integration"; import { expectRuntimeError } from "../../helpers/runtime-errors"; import { elonMuskAccount, johnAccount } from "../../mocks/account"; @@ -1250,7 +1256,7 @@ describe("Inner Transactions", function () { }); }); - describe.only("Teal v6 update", function () { + describe("Teal v6 update", function () { this.beforeEach(function () { setUpInterpreter(6, ALGORAND_ACCOUNT_MIN_BALANCE); }); @@ -1261,6 +1267,7 @@ describe("Inner Transactions", function () { // init more balance for application to test inner transaction setUpInterpreter(6, ALGORAND_ACCOUNT_MIN_BALANCE * 10); }); + it("Should support keyreg transaction", function () { program = ` itxn_begin From 3a75b5ab0fae80fd890e12b6747913061aaec2cb Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 16:12:07 +0200 Subject: [PATCH 40/50] example --- .husky/_/dissalowed_words.sh | 2 +- examples/inner-tx-create-assets/test/innerTxn.js | 2 +- packages/runtime/test/src/guide-examples.ts | 2 +- packages/runtime/test/src/interpreter/inner-transaction.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index d72daaeb7..d2bcde2fc 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -7,7 +7,7 @@ status=0 set +o posix while read x file; do if [ "$x" == 'D' ]; then continue; fi - if ! [[ "${file: -3}" == ".ts" ]] || [[ "${file: -3}" == ".js" ]]; then continue; fi + if ! [[ "${file: -3}" == ".ts" ]] || ! [[ "${file: -3}" == ".js" ]]; then continue; fi if grep -E -q "\.only\(" "$file" ; then printf "%40s\n" "${COLOR_RED}ERROR:${COLOR_REST} Disallowed expression${COLOR_YELLOW} .only()${COLOR_REST} in file: $COLOR_MAGENTA${file}$COLOR_REST" status=1 diff --git a/examples/inner-tx-create-assets/test/innerTxn.js b/examples/inner-tx-create-assets/test/innerTxn.js index 5822ec3c7..fd6dcab87 100644 --- a/examples/inner-tx-create-assets/test/innerTxn.js +++ b/examples/inner-tx-create-assets/test/innerTxn.js @@ -36,7 +36,7 @@ describe("Group txn", function () { runtime.executeTx([paymentTxnParam]); }); - it("Should create new app and asset from inner txn", function () { + it.only("Should create new app and asset from inner txn", function () { // create asset and log new asset id const masterTxnParam = { type: types.TransactionType.CallApp, diff --git a/packages/runtime/test/src/guide-examples.ts b/packages/runtime/test/src/guide-examples.ts index 00f05b2af..670068aef 100644 --- a/packages/runtime/test/src/guide-examples.ts +++ b/packages/runtime/test/src/guide-examples.ts @@ -21,7 +21,7 @@ describe("Guide examples", function () { defaultBalance = alice.balance(); }); - it("Should send 5 algos from alice to bob", function () { + it.only("Should send 5 algos from alice to bob", function () { //create the transaction const transaction = algosdk.makePaymentTxnWithSuggestedParamsFromObject({ from: alice.address, diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index a9e3eb367..37f6114c0 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1444,7 +1444,7 @@ describe("Inner Transactions", function () { setUpInterpreter(7, 1e9); }); - it("Should not throw error when accessing foreign application in create inner transaction", function () { + it.only("Should not throw error when accessing foreign application in create inner transaction", function () { const prog = ` itxn_begin int pay From 2f644f437084edda59e7ae82272f45391d8c97be Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 16:24:42 +0200 Subject: [PATCH 41/50] example --- .husky/_/dissalowed_words.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index d2bcde2fc..111fda26e 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -7,7 +7,7 @@ status=0 set +o posix while read x file; do if [ "$x" == 'D' ]; then continue; fi - if ! [[ "${file: -3}" == ".ts" ]] || ! [[ "${file: -3}" == ".js" ]]; then continue; fi + if [ "${file: -3}" != ".ts" ] && [ "${file: -3}" != ".js" ]; then continue; fi if grep -E -q "\.only\(" "$file" ; then printf "%40s\n" "${COLOR_RED}ERROR:${COLOR_REST} Disallowed expression${COLOR_YELLOW} .only()${COLOR_REST} in file: $COLOR_MAGENTA${file}$COLOR_REST" status=1 From 7b14875da81adbb06213b73111f521d64292210b Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Mon, 24 Oct 2022 16:28:18 +0200 Subject: [PATCH 42/50] example --- examples/inner-tx-create-assets/test/innerTxn.js | 2 +- packages/runtime/test/src/guide-examples.ts | 2 +- packages/runtime/test/src/interpreter/inner-transaction.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/inner-tx-create-assets/test/innerTxn.js b/examples/inner-tx-create-assets/test/innerTxn.js index fd6dcab87..5822ec3c7 100644 --- a/examples/inner-tx-create-assets/test/innerTxn.js +++ b/examples/inner-tx-create-assets/test/innerTxn.js @@ -36,7 +36,7 @@ describe("Group txn", function () { runtime.executeTx([paymentTxnParam]); }); - it.only("Should create new app and asset from inner txn", function () { + it("Should create new app and asset from inner txn", function () { // create asset and log new asset id const masterTxnParam = { type: types.TransactionType.CallApp, diff --git a/packages/runtime/test/src/guide-examples.ts b/packages/runtime/test/src/guide-examples.ts index 670068aef..00f05b2af 100644 --- a/packages/runtime/test/src/guide-examples.ts +++ b/packages/runtime/test/src/guide-examples.ts @@ -21,7 +21,7 @@ describe("Guide examples", function () { defaultBalance = alice.balance(); }); - it.only("Should send 5 algos from alice to bob", function () { + it("Should send 5 algos from alice to bob", function () { //create the transaction const transaction = algosdk.makePaymentTxnWithSuggestedParamsFromObject({ from: alice.address, diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index 37f6114c0..a9e3eb367 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1444,7 +1444,7 @@ describe("Inner Transactions", function () { setUpInterpreter(7, 1e9); }); - it.only("Should not throw error when accessing foreign application in create inner transaction", function () { + it("Should not throw error when accessing foreign application in create inner transaction", function () { const prog = ` itxn_begin int pay From 0af2a6b989524823e20f4399564797b0b7e05b37 Mon Sep 17 00:00:00 2001 From: sczembor <43810037+sczembor@users.noreply.github.com> Date: Mon, 24 Oct 2022 22:42:33 +0200 Subject: [PATCH 43/50] Update .husky/_/dissalowed_words.sh --- .husky/_/dissalowed_words.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 111fda26e..0604f7257 100644 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash COLOR_REST="$(tput sgr0)" COLOR_MAGENTA="$(tput setaf 4)" COLOR_RED="$(tput setaf 1)" From 965c223f47c4662fcc288d40165cbff5ebe6da96 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Tue, 25 Oct 2022 10:19:09 +0200 Subject: [PATCH 44/50] test --- .husky/_/dissalowed_words.sh | 32 +++++++++++++------ examples/dao/test/happy-path.js | 2 +- .../test/src/interpreter/inner-transaction.ts | 2 +- 3 files changed, 24 insertions(+), 12 deletions(-) mode change 100644 => 100755 .husky/_/dissalowed_words.sh diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh old mode 100644 new mode 100755 index 111fda26e..5b9a32e74 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -1,16 +1,28 @@ -#!/bin/sh +#!/bin/bash COLOR_REST="$(tput sgr0)" COLOR_MAGENTA="$(tput setaf 4)" COLOR_RED="$(tput setaf 1)" COLOR_YELLOW="$(tput setaf 3)" status=0 -set +o posix -while read x file; do - if [ "$x" == 'D' ]; then continue; fi + +for file in $(git diff --cached --name-only --diff-filter=ACMT); +do if [ "${file: -3}" != ".ts" ] && [ "${file: -3}" != ".js" ]; then continue; fi - if grep -E -q "\.only\(" "$file" ; then - printf "%40s\n" "${COLOR_RED}ERROR:${COLOR_REST} Disallowed expression${COLOR_YELLOW} .only()${COLOR_REST} in file: $COLOR_MAGENTA${file}$COLOR_REST" - status=1 - fi -done < <(git diff --cached --name-status); -exit $status \ No newline at end of file + grep -in -E "\.only\(" file | awk -F: '{print $2" - Line number : "$1}' + # if grep -E -q "\.only\(" "$file" ; then + # printf "%40s\n" "${COLOR_RED}ERROR:${COLOR_REST} Disallowed expression${COLOR_YELLOW} .only()${COLOR_REST} in file: $COLOR_MAGENTA${file}$COLOR_REST" + # status=1 + # fi +done +exit $status + + +# while read x file; do +# if [ "$x" == 'D' ]; then continue; fi +# if [ "${file: -3}" != ".ts" ] && [ "${file: -3}" != ".js" ]; then continue; fi +# if grep -E -q "\.only\(" "$file" ; then +# printf "%40s\n" "${COLOR_RED}ERROR:${COLOR_REST} Disallowed expression${COLOR_YELLOW} .only()${COLOR_REST} in file: $COLOR_MAGENTA${file}$COLOR_REST" +# status=1 +# fi +# done < <(git diff --cached --name-status); +# exit $status \ No newline at end of file diff --git a/examples/dao/test/happy-path.js b/examples/dao/test/happy-path.js index 5be8e7886..debf17b44 100644 --- a/examples/dao/test/happy-path.js +++ b/examples/dao/test/happy-path.js @@ -14,7 +14,7 @@ const { mkCloseProposalTx, } = require("../scripts/run/common/tx-params"); -describe("DAO - Happy Paths", function () { +describe.only("DAO - Happy Paths", function () { let master, creator, proposer, voterA, voterB; let daoFundLsigAcc, proposalLsigAcc; let ctx; diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index a9e3eb367..51370eaf6 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1439,7 +1439,7 @@ describe("Inner Transactions", function () { }); }); - describe("Foreign application account access", function () { + describe.only("Foreign application account access", function () { this.beforeEach(function () { setUpInterpreter(7, 1e9); }); From d03870d1d30008d1bb1e67ff7d266eef51003ed5 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Tue, 25 Oct 2022 10:19:34 +0200 Subject: [PATCH 45/50] test --- .husky/_/dissalowed_words.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 5b9a32e74..1b969ae3f 100755 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -8,7 +8,7 @@ status=0 for file in $(git diff --cached --name-only --diff-filter=ACMT); do if [ "${file: -3}" != ".ts" ] && [ "${file: -3}" != ".js" ]; then continue; fi - grep -in -E "\.only\(" file | awk -F: '{print $2" - Line number : "$1}' + grep -in -E "\.only\(" "$file" | awk -F: '{print $2" - Line number : "$1}' # if grep -E -q "\.only\(" "$file" ; then # printf "%40s\n" "${COLOR_RED}ERROR:${COLOR_REST} Disallowed expression${COLOR_YELLOW} .only()${COLOR_REST} in file: $COLOR_MAGENTA${file}$COLOR_REST" # status=1 From b44fe3e49ce9c37f3f75e17b97104e46627fc687 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Tue, 25 Oct 2022 10:35:37 +0200 Subject: [PATCH 46/50] add line number to error output --- .husky/_/dissalowed_words.sh | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index 1b969ae3f..dcbe0c70e 100755 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -1,6 +1,6 @@ #!/bin/bash COLOR_REST="$(tput sgr0)" -COLOR_MAGENTA="$(tput setaf 4)" +COLOR_MAGENTA="$(tput setaf 5)" COLOR_RED="$(tput setaf 1)" COLOR_YELLOW="$(tput setaf 3)" status=0 @@ -8,21 +8,10 @@ status=0 for file in $(git diff --cached --name-only --diff-filter=ACMT); do if [ "${file: -3}" != ".ts" ] && [ "${file: -3}" != ".js" ]; then continue; fi - grep -in -E "\.only\(" "$file" | awk -F: '{print $2" - Line number : "$1}' - # if grep -E -q "\.only\(" "$file" ; then - # printf "%40s\n" "${COLOR_RED}ERROR:${COLOR_REST} Disallowed expression${COLOR_YELLOW} .only()${COLOR_REST} in file: $COLOR_MAGENTA${file}$COLOR_REST" - # status=1 - # fi + for line in $(grep -in -E "\.only\(" "$file" | cut -f1 -d:); + do + printf "%40s\n" "${COLOR_RED}ERROR:${COLOR_REST} Disallowed expression${COLOR_YELLOW} .only()${COLOR_REST} in file: $COLOR_MAGENTA${line}:${file}$COLOR_REST" + status=1 + done done -exit $status - - -# while read x file; do -# if [ "$x" == 'D' ]; then continue; fi -# if [ "${file: -3}" != ".ts" ] && [ "${file: -3}" != ".js" ]; then continue; fi -# if grep -E -q "\.only\(" "$file" ; then -# printf "%40s\n" "${COLOR_RED}ERROR:${COLOR_REST} Disallowed expression${COLOR_YELLOW} .only()${COLOR_REST} in file: $COLOR_MAGENTA${file}$COLOR_REST" -# status=1 -# fi -# done < <(git diff --cached --name-status); -# exit $status \ No newline at end of file +exit $status \ No newline at end of file From 0c12192ae1172feb8d2cd710dd2fdab967b664d4 Mon Sep 17 00:00:00 2001 From: Stanislaw Czembor Date: Tue, 25 Oct 2022 10:43:58 +0200 Subject: [PATCH 47/50] delete cached varaible from grep --- .husky/_/dissalowed_words.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index dcbe0c70e..d80d6644a 100755 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -5,7 +5,7 @@ COLOR_RED="$(tput setaf 1)" COLOR_YELLOW="$(tput setaf 3)" status=0 -for file in $(git diff --cached --name-only --diff-filter=ACMT); +for file in $(git diff --name-only --diff-filter=ACMT); do if [ "${file: -3}" != ".ts" ] && [ "${file: -3}" != ".js" ]; then continue; fi for line in $(grep -in -E "\.only\(" "$file" | cut -f1 -d:); From 141e7c3b8d442c7eed2251860de879e301c1228e Mon Sep 17 00:00:00 2001 From: sczembor <43810037+sczembor@users.noreply.github.com> Date: Tue, 25 Oct 2022 10:45:41 +0200 Subject: [PATCH 48/50] Apply suggestions from code review --- examples/dao/test/happy-path.js | 2 +- packages/runtime/test/src/interpreter/inner-transaction.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/dao/test/happy-path.js b/examples/dao/test/happy-path.js index debf17b44..5be8e7886 100644 --- a/examples/dao/test/happy-path.js +++ b/examples/dao/test/happy-path.js @@ -14,7 +14,7 @@ const { mkCloseProposalTx, } = require("../scripts/run/common/tx-params"); -describe.only("DAO - Happy Paths", function () { +describe("DAO - Happy Paths", function () { let master, creator, proposer, voterA, voterB; let daoFundLsigAcc, proposalLsigAcc; let ctx; diff --git a/packages/runtime/test/src/interpreter/inner-transaction.ts b/packages/runtime/test/src/interpreter/inner-transaction.ts index 51370eaf6..a9e3eb367 100644 --- a/packages/runtime/test/src/interpreter/inner-transaction.ts +++ b/packages/runtime/test/src/interpreter/inner-transaction.ts @@ -1439,7 +1439,7 @@ describe("Inner Transactions", function () { }); }); - describe.only("Foreign application account access", function () { + describe("Foreign application account access", function () { this.beforeEach(function () { setUpInterpreter(7, 1e9); }); From 4e2123432df68969462cac77bdb52c4e59bd821c Mon Sep 17 00:00:00 2001 From: sczembor <43810037+sczembor@users.noreply.github.com> Date: Tue, 25 Oct 2022 10:48:14 +0200 Subject: [PATCH 49/50] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c3cb40e94..4c97c59f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -50,7 +50,7 @@ from `algosdk` and sends it to the network. - Added support for new txn opcode fileds `ApprovalProgramPages`, `ClearProgramStatePages`, `NumApprovalProgramPages`, `NumClearProgramStatePages`. - Added additional checks for the `maxStackByteElementSize` and `maxProgramLength` in `Runtime`. - Added partial support for `bn254` opcodes. The full support delyed until the official release of `TEALv8/v9`. -- Added a new pre-commit hook to check if there are any `.only`in tests . If there are any it will display error in which files the problem was found. +- Added a new pre-commit hook to check if there are any `.only`in tests . If there are any it will display error in which files/lines the problem was found. #### @algo-builder/web - Added support for logic signature to `executeTx` method of `Webmode` for AlgoSigner, MyAlgo Wallet and Wallet Connect. From d554b6efe1e80d2755c89bd7f2b6fbe5819d81e1 Mon Sep 17 00:00:00 2001 From: sczembor <43810037+sczembor@users.noreply.github.com> Date: Tue, 25 Oct 2022 10:55:18 +0200 Subject: [PATCH 50/50] add empty line at the end of the script --- .husky/_/dissalowed_words.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/_/dissalowed_words.sh b/.husky/_/dissalowed_words.sh index d80d6644a..00162ccfa 100755 --- a/.husky/_/dissalowed_words.sh +++ b/.husky/_/dissalowed_words.sh @@ -14,4 +14,4 @@ do status=1 done done -exit $status \ No newline at end of file +exit $status