Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

env:
GO_VER: 1.25.7
GO_VER: 1.26.0
GINKGO_VER: 2.27.3

jobs:
Expand Down Expand Up @@ -54,9 +54,9 @@ jobs:
go-version: ${{ env.GO_VER }}
cache: false
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
uses: golangci/golangci-lint-action@v9
with:
version: v2.5.0
version: v2.9.0
skip-cache: true
problem-matchers: true

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- 'v*'

env:
GO_VER: 1.25.7
GO_VER: 1.26.0
UBUNTU_VER: 22.04
APP_VER: ${{ github.ref_name }}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/vulnerability-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ permissions:
jobs:
scan-scheduled:
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}
uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@v2.2.2"
uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable.yml@v2.3.3"
with:
scan-args: |-
--config ./osv-scanner-config.toml
Expand All @@ -31,7 +31,7 @@ jobs:

scan-pr:
if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml@v2.2.2"
uses: "google/osv-scanner-action/.github/workflows/osv-scanner-reusable-pr.yml@v2.3.3"
with:
scan-args: |-
--config ./osv-scanner-config.toml
Expand Down
3 changes: 2 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "2"
run:
concurrency: 4
go: "1.25"
go: "1.26"
tests: false
linters:
default: none
Expand Down Expand Up @@ -56,6 +56,7 @@ linters:
- unparam
- usestdlibvars
- whitespace
- modernize
settings:
gosec:
excludes:
Expand Down
2 changes: 1 addition & 1 deletion cc/chaincode.go
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ func (c *ACL) setupMethods() error {
var err error
c.methodOnce.Do(func() {
c.methods = make(map[string]methods.Method)
t := reflect.TypeOf(c)
t := reflect.TypeOf(c) //nolint:modernize
for i := range t.NumMethod() {
method := t.Method(i)

Expand Down
2 changes: 1 addition & 1 deletion cc/querystub/query_stub.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ func (qs *queryStub) GetFunctionAndParameters() (function string, params []strin

func (qs *queryStub) GetArgsSlice() ([]byte, error) {
args := qs.GetArgs()
res := []byte{}
res := []byte{} //nolint:prealloc
for _, barg := range args {
res = append(res, barg...)
}
Expand Down
11 changes: 4 additions & 7 deletions helpers/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"encoding/hex"
"errors"
"fmt"
"slices"
"sort"
"strings"
"unicode"
Expand Down Expand Up @@ -180,7 +181,8 @@ func CheckAddress(address string) error {
return fmt.Errorf("check decode address : %w", err)
}

hash := []byte{version}
hash := make([]byte, 0, len(result)+1)
hash = append(hash, version)
hash = append(hash, result...)

if len(hash) != sha256Length {
Expand Down Expand Up @@ -220,12 +222,7 @@ func ValidatePublicKeyType(keyType string, notAllowedTypes ...string) bool {
if !ok {
return false
}
for _, notAllowed := range notAllowedTypes {
if notAllowed == keyType {
return false
}
}
return true
return !slices.Contains(notAllowedTypes, keyType)
}

func DefaultPublicKeyType() string {
Expand Down
2 changes: 1 addition & 1 deletion helpers/helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func TestCheckDuplicates(t *testing.T) {
func BenchmarkCheckDuplicates(b *testing.B) {
input := []string{"a", "b", "c", "a", "b", "c", "b", "c", "a", "b", "c", "b", "c", "a", "b", "c"}
var r []string
for i := 0; i < 1000; i++ {
for range 1000 {
r = append(r, input...)
}
for i := 0; i < b.N; i++ {
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/anoideaopen/acl/tests/integration

go 1.25.7
go 1.26.0

tool (
github.com/IBM/idemix/tools/idemixgen
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/change_public_key_with_base58_signature_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func (ss *secrets) getSigns() []string {
func newSecrets(validators int) (ss *secrets, err error) {
ss = &secrets{}

for i := 0; i < validators; i++ {
for range validators {
public, secret, err := ed25519.GenerateKey(rand.Reader)
if err != nil {
return nil, err
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/get_accounts_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,12 @@ func TestGetAccountsInfo(t *testing.T) {
description: "ok",
args: func() []string {
args := make([]string, 0, 10)
for i := 0; i < 5; i++ {
for range 5 {
bytes, err := json.Marshal([]string{common.FnGetAccInfoFn, "FcxURVVuLyR7bMJYYeW34HDKdzEvcMDwfWo1wS9oYmCaeps9N"})
require.NoError(t, err)
args = append(args, string(bytes))
}
for i := 0; i < 5; i++ {
for range 5 {
bytes, err := json.Marshal([]string{common.FnCheckKeys, "Cv8S2Y7pDT74AUma95Fdy6ZUX5NBVTQR7WRbdq46VR2z"})
require.NoError(t, err)
args = append(args, string(bytes))
Expand Down