From c456673150844c878ee69cbd4a4fe391ead858b4 Mon Sep 17 00:00:00 2001 From: Jason Paulos Date: Thu, 9 May 2024 11:05:55 -0400 Subject: [PATCH 1/5] Upgrade to go 1.21 --- .github/workflows/build.yml | 2 +- .github/workflows/golangci-lint.yml | 6 +++--- go.mod | 4 +++- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f14be69..6f5590d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version-file: 'go.mod' diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 57704d0..55f2cba 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -11,18 +11,18 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + - uses: actions/setup-go@v4 with: go-version-file: 'go.mod' - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: v1.41.1 + version: v1.58.0 - name: golangci-lint warnings uses: golangci/golangci-lint-action@v3 with: # Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version - version: v1.41.1 + version: v1.58.0 # Optional: golangci-lint command line arguments. args: -c .golangci-warnings.yml diff --git a/go.mod b/go.mod index f7d8e2d..79d1562 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/algorand/avm-abi -go 1.20 +go 1.21 + +toolchain go1.21.10 require ( github.com/chrismcguire/gobberish v0.0.0-20150821175641-1d8adb509a0e From b97ac1c3b3a7d621f8b0f3708d2fc52e8fe72539 Mon Sep 17 00:00:00 2001 From: Jason Paulos Date: Thu, 9 May 2024 11:16:08 -0400 Subject: [PATCH 2/5] Add codecov token --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6f5590d..00b582e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,6 +26,8 @@ jobs: - name: Upload code coverage uses: codecov/codecov-action@v3 + env: # Or as an environment variable + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: fail_ci_if_error: true files: coverage.out From 2be9f0d3093d681d8d87e576cc2ef719ed722cd4 Mon Sep 17 00:00:00 2001 From: Jason Paulos Date: Thu, 9 May 2024 11:24:57 -0400 Subject: [PATCH 3/5] Satisfy linter --- abi/doc.go | 3 +-- abi/type.go | 1 + address/address.go | 4 ++++ apps/box.go | 3 +++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/abi/doc.go b/abi/doc.go index da680ab..0ace627 100644 --- a/abi/doc.go +++ b/abi/doc.go @@ -3,8 +3,7 @@ Package abi provides an implementation of the Algorand ARC-4 ABI type system. See https://arc.algorand.foundation/ARCs/arc-0004 for the corresponding specification. - -Basic Operations +# Basic Operations This package can parse ABI type names using the `abi.TypeOf()` function. diff --git a/abi/type.go b/abi/type.go index 4ebf6e2..8a3c6d2 100644 --- a/abi/type.go +++ b/abi/type.go @@ -187,6 +187,7 @@ type segment struct{ left, right int } // Each sub-string represents a content type of the tuple type. // The argument str is the content between parentheses of tuple, i.e. // (...... str ......) +// // ^ ^ func parseTupleContent(str string) ([]string, error) { // if the tuple type content is empty (which is also allowed) diff --git a/address/address.go b/address/address.go index 67efa93..a7d655f 100644 --- a/address/address.go +++ b/address/address.go @@ -1,3 +1,7 @@ +/* +Package address provides the ability to convert between 32 byte Algorand addresses and their base32 +string form. +*/ package address import ( diff --git a/apps/box.go b/apps/box.go index c627ce3..1f5e3e0 100644 --- a/apps/box.go +++ b/apps/box.go @@ -1,3 +1,6 @@ +/* +Package apps provides parsing utilities related to application arguments and box keys. +*/ package apps import ( From c18273dae79aafe76ae0ad0a2a2f4fb0fc8c00c0 Mon Sep 17 00:00:00 2001 From: Jason Paulos Date: Thu, 9 May 2024 11:29:43 -0400 Subject: [PATCH 4/5] Fix warnings --- .golangci-warnings.yml | 3 --- abi/type_test.go | 2 -- 2 files changed, 5 deletions(-) diff --git a/.golangci-warnings.yml b/.golangci-warnings.yml index 598c897..fb9c7b3 100644 --- a/.golangci-warnings.yml +++ b/.golangci-warnings.yml @@ -6,10 +6,7 @@ linters: disable-all: true enable: - staticcheck - - structcheck - typecheck - - varcheck - - deadcode - gosimple - unused diff --git a/abi/type_test.go b/abi/type_test.go index fa19035..51affb0 100644 --- a/abi/type_test.go +++ b/abi/type_test.go @@ -6,7 +6,6 @@ import ( "strconv" "strings" "testing" - "time" "github.com/stretchr/testify/require" ) @@ -564,7 +563,6 @@ func generateTupleType(baseTypes []Type, tupleTypes []Type) Type { func TestTypeMISC(t *testing.T) { t.Parallel() - rand.Seed(time.Now().Unix()) var testpool = []Type{ boolType, From 1e279930f7a0e4b68d75cac8b53565c889558d14 Mon Sep 17 00:00:00 2001 From: Jason Paulos Date: Thu, 9 May 2024 11:31:51 -0400 Subject: [PATCH 5/5] cleanup --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 00b582e..ab118df 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: - name: Upload code coverage uses: codecov/codecov-action@v3 - env: # Or as an environment variable + env: CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} with: fail_ci_if_error: true