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
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ workflows:
name: 'test_go_<< matrix.go_version >>'
matrix:
parameters:
go_version: ['1.17']
go_version: ['1.20.5']

jobs:
test:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v3
uses: actions/checkout@v3.5.3
- name: Generate and PR
uses: algorand/generator/.github/actions/sdk-codegen/@master
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/create-release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
fi

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v3.5.3
with:
fetch-depth: 0

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/reviewdog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2
uses: actions/checkout@v3.5.3
with:
fetch-depth: 0 # required for new-from-rev option in .golangci.yml
- name: Install specific golang
uses: actions/setup-go@v2
uses: actions/setup-go@v4.0.1
with:
go-version: '1.17.13'
go-version: '1.20.5'
- name: Check format
run: test -z `go fmt ./...`
- name: Vet
run: go vet ./...
- name: reviewdog-golangci-lint
uses: reviewdog/action-golangci-lint@v2
uses: reviewdog/action-golangci-lint@v2.3.1
with:
golangci_lint_version: "v1.47.3"
golangci_lint_version: "v1.53.2"
golangci_lint_flags: "-c .golangci.yml --allow-parallel-runners"
go_version: "1.17.13"
go_version: "1.20.5"
reporter: "github-pr-review"
tool_name: "Lint Errors"
level: "error"
Expand Down
5 changes: 2 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ run:
linters:
disable-all: true
enable:
- deadcode
- errcheck
- exportloopref
- gci
Expand All @@ -21,10 +20,8 @@ linters:
- nolintlint
- revive
- staticcheck
- structcheck
- typecheck
- unused
- varcheck

linters-settings:
gci:
Expand Down Expand Up @@ -61,6 +58,8 @@ issues:
- "exported method (.*).Unwrap` should have comment or be unexported"
# ignore issues about the way we use _struct fields to define encoding settings
- "`_struct` is unused"
# we are not enforcing package-comments at this point
- "^package-comments: should have a package comment"

# Enable some golangci-lint default exception rules:
# "EXC0001 errcheck: Almost all programs ignore errors on these functions and in most cases it's ok"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ TEST_SOURCES := $(shell cd $(SRCPATH) && go list ./...)
TEST_SOURCES_NO_CUCUMBER := $(shell cd $(SRCPATH) && go list ./... | grep -v test)
UNIT_TAGS := "$(shell awk '{print $2}' test/unit.tags | paste -s -d, -)"
INTEGRATIONS_TAGS := "$(shell awk '{print $2}' test/integration.tags | paste -s -d, -)"
GO_IMAGE := golang:$(subst go,,$(shell go version | cut -d' ' -f 3 | cut -d'.' -f 1,2))-stretch
GO_IMAGE := golang:$(subst go,,$(shell go version | cut -d' ' -f 3 | cut -d'.' -f 1,2))-bookworm

lint:
golangci-lint run -c .golangci.yml
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/algorand/go-algorand-sdk/v2

go 1.17
go 1.20

require (
github.com/algorand/avm-abi v0.1.1
Expand Down
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ github.com/algorand/avm-abi v0.1.1/go.mod h1:+CgwM46dithy850bpTeHh9MC99zpn2Snirb
github.com/algorand/go-codec/codec v1.1.10 h1:zmWYU1cp64jQVTOG8Tw8wa+k0VfwgXIPbnDfiVa+5QA=
github.com/algorand/go-codec/codec v1.1.10/go.mod h1:YkEx5nmr/zuCeaDYOIhlDg92Lxju8tj2d2NrYqP7g7k=
github.com/chrismcguire/gobberish v0.0.0-20150821175641-1d8adb509a0e h1:CHPYEbz71w8DqJ7DRIq+MXyCQsdibK08vdcQTY4ufas=
github.com/chrismcguire/gobberish v0.0.0-20150821175641-1d8adb509a0e/go.mod h1:6Xhs0ZlsRjXLIiSMLKafbZxML/j30pg9Z1priLuha5s=
github.com/cucumber/godog v0.8.1 h1:lVb+X41I4YDreE+ibZ50bdXmySxgRviYFgKY6Aw4XE8=
github.com/cucumber/godog v0.8.1/go.mod h1:vSh3r/lM+psC1BPXvdkSEuNjmXfpVqrMGYAElF6hxnA=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
Expand Down
2 changes: 1 addition & 1 deletion protocol/config/consensus.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ var MaxBytesKeyValueLen int
var MaxExtraAppProgramLen int

// MaxAvailableAppProgramLen is the largest supported app program size include the extra pages
//supported supported by any of the consensus protocols. used for decoding purposes.
// supported supported by any of the consensus protocols. used for decoding purposes.
var MaxAvailableAppProgramLen int

// MaxProposedExpiredOnlineAccounts is the maximum number of online accounts, which need
Expand Down
6 changes: 3 additions & 3 deletions test/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"container/ring"
"encoding/base64"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/http/httptest"
"os"
Expand All @@ -21,7 +21,7 @@ func loadMockJsons(commaDelimitedFilenames, pathToJsons string) ([][]byte, error
if err != nil {
return nil, err
}
fileBytes, err := ioutil.ReadAll(jsonfile)
fileBytes, err := io.ReadAll(jsonfile)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -105,5 +105,5 @@ func expectErrorStringToContain(contains string) error {
}

func loadResource(filepath string) ([]byte, error) {
return ioutil.ReadFile(path.Join("features", "resources", filepath))
return os.ReadFile(path.Join("features", "resources", filepath))
}
4 changes: 2 additions & 2 deletions test/utilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"io"
"log"
"os"
"sort"
Expand All @@ -24,7 +24,7 @@ func VerifyResponse(expectedFile string, actual string) error {
if err != nil {
return err
}
fileBytes, err := ioutil.ReadAll(jsonfile)
fileBytes, err := io.ReadAll(jsonfile)
if err != nil {
return err
}
Expand Down
9 changes: 5 additions & 4 deletions transaction/transaction.go
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,11 @@ func MakeAssetCreateTxn(account string, note []byte, params types.SuggestedParam
// MakeAssetConfigTxn creates a tx template for changing the
// key configuration of an existing asset.
// Important notes -
// * Every asset config transaction is a fresh one. No parameters will be inherited from the current config.
// * Once an address is set to to the empty string, IT CAN NEVER BE CHANGED AGAIN. For example, if you want to keep
// The current manager, you must specify its address again.
// Parameters -
// - Every asset config transaction is a fresh one. No parameters will be inherited from the current config.
// - Once an address is set to to the empty string, IT CAN NEVER BE CHANGED AGAIN. For example, if you want to keep
// The current manager, you must specify its address again.
// Parameters -
//
// - account is a checksummed, human-readable address that will send the transaction
// - note is an arbitrary byte array
// - params is typically received from algod, it defines common-to-all-txns arguments like fee and validity period
Expand Down
5 changes: 3 additions & 2 deletions transaction/transactionSigner.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import (
// @param txnGroup - The atomic group containing transactions to be signed
// @param indexesToSign - An array of indexes in the atomic transaction group that should be signed
// @returns An array of encoded signed transactions. The length of the
// array will be the same as the length of indexesToSign, and each index i in the array
// corresponds to the signed transaction from txnGroup[indexesToSign[i]]
//
// array will be the same as the length of indexesToSign, and each index i in the array
// corresponds to the signed transaction from txnGroup[indexesToSign[i]]
type TransactionSigner interface { //nolint:revive // Ignore stuttering for backwards compatibility
SignTransactions(txGroup []types.Transaction, indexesToSign []int) ([][]byte, error)
Equals(other TransactionSigner) bool
Expand Down
7 changes: 3 additions & 4 deletions transaction/waitForConfirmation.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,9 @@ func WaitForConfirmation(c *algod.Client, txid string, waitRounds uint64, ctx co
return
}
}
// ignore errors from PendingTransactionInformation, since it may return 404 if the algod
// instance is behind a load balancer and the request goes to a different algod than the
// one we submitted the transaction to
err = nil
// Note that we intentionally ignore errors from PendingTransactionInformation, since it
// may return 404 if the algod instance is behind a load balancer and the request goes
// to a different algod than the one we submitted the transaction to

// Wait until the block for the `currentRound` is confirmed
response, err = c.StatusAfterBlock(currentRound).Do(ctx, headers...)
Expand Down
1 change: 1 addition & 0 deletions types/applications.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const (

// OnCompletion is an enum representing some layer 1 side effect that an
// ApplicationCall transaction will have if it is included in a block.
//
//go:generate stringer -type=OnCompletion -output=application_string.go
type OnCompletion uint64

Expand Down
1 change: 1 addition & 0 deletions types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,7 @@ type EvalDelta struct {

// StateDelta is a map from key/value store keys to ValueDeltas, indicating
// what should happen for that key
//
//msgp:allocbound StateDelta config.MaxStateDeltaKeys
type StateDelta map[string]ValueDelta

Expand Down
1 change: 1 addition & 0 deletions types/statedelta.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ type TealValue struct {

// TealKeyValue represents a key/value store for use in an application's
// LocalState or GlobalState
//
//msgp:allocbound TealKeyValue EncodedMaxKeyValueEntries
type TealKeyValue map[string]TealValue

Expand Down
3 changes: 3 additions & 0 deletions types/stateproof.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const (
)

// GenericDigest is a digest that implements CustomSizeDigest, and can be used as hash output.
//
//msgp:allocbound GenericDigest MaxHashDigestSize
type GenericDigest []byte

Expand Down Expand Up @@ -72,6 +73,7 @@ const (
)

// HashFactory is responsible for generating new hashes accordingly to the type it stores.
//
//msgp:postunmarshalcheck HashFactory Validate
type HashFactory struct {
_struct struct{} `codec:",omitempty,omitemptyarray"`
Expand Down Expand Up @@ -129,6 +131,7 @@ type Participant struct {
}

// MerkleSignature represents a Falcon signature in a compressed-form
//
//msgp:allocbound MerkleSignature FalconMaxSignatureSize
type MerkleSignature []byte

Expand Down