From cf52c4d32190fb6c3569ce6709ba448789c1f7f9 Mon Sep 17 00:00:00 2001 From: chris erway Date: Wed, 9 Mar 2022 09:30:16 -0500 Subject: [PATCH 1/6] upgrade to golangci-lint v1.44.2 and enable gci --- .github/workflows/reviewdog.yml | 4 ++-- .golangci.yml | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/reviewdog.yml b/.github/workflows/reviewdog.yml index 30b76064bf..ffef23ea0d 100644 --- a/.github/workflows/reviewdog.yml +++ b/.github/workflows/reviewdog.yml @@ -18,7 +18,7 @@ jobs: - name: reviewdog-golangci-lint uses: reviewdog/action-golangci-lint@v2 with: - golangci_lint_version: "v1.41.1" + golangci_lint_version: "v1.44.2" golangci_lint_flags: "-c .golangci.yml --allow-parallel-runners" reporter: "github-pr-review" tool_name: "Lint Errors" @@ -59,7 +59,7 @@ jobs: run: | cd cicdtmp/golangci-lint git clone https://github.com/golangci/golangci-lint.git . - git checkout tags/v1.41.1 + git checkout tags/v1.44.2 CGO_ENABLED=true go build -trimpath -o golangci-lint-cgo ./cmd/golangci-lint ./golangci-lint-cgo --version cd ../../ diff --git a/.golangci.yml b/.golangci.yml index 9cf49999f3..e6de634ab3 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -11,6 +11,18 @@ linters: - govet - ineffassign - misspell + - gci + +linters-settings: + gci: + sections: + - standard + - default + - prefix(github.com/algorand) + - prefix(github.com/algorand/go-algorand) + + section-separators: + - newLine severity: default-severity: error From 932f5ca2d34c94dc6bb0ea7e78c2e1b05be2dede Mon Sep 17 00:00:00 2001 From: chris erway Date: Wed, 9 Mar 2022 09:30:39 -0500 Subject: [PATCH 2/6] run find . -name \*.go | xargs gci write -s Standard -s Default -s "Prefix(github.com/algorand)" -s "Prefix(github.com/algorand/go-algorand)" --- agreement/agreementtest/simulate_test.go | 3 ++- agreement/common_test.go | 3 ++- agreement/cryptoVerifier_test.go | 3 ++- agreement/fuzzer/dropMessageFilter_test.go | 1 + agreement/fuzzer/ledger_test.go | 3 ++- agreement/fuzzer/messageDecoderFilter_test.go | 1 + agreement/fuzzer/messageDelayFilter_test.go | 1 + agreement/fuzzer/messageDuplicationFilter_test.go | 3 ++- agreement/fuzzer/messagePriorityQueue_test.go | 1 + agreement/fuzzer/messageReflectionFilter_test.go | 3 ++- agreement/fuzzer/tests_test.go | 3 +-- agreement/msgp_gen.go | 3 ++- agreement/msgp_gen_test.go | 3 ++- agreement/proposalManager_test.go | 3 ++- agreement/proposalTracker_test.go | 3 ++- agreement/service_test.go | 3 ++- catchup/service_test.go | 3 ++- cmd/algod/main.go | 3 ++- cmd/algofix/deadlock_test.go | 3 ++- cmd/algoh/blockWatcher_test.go | 3 ++- cmd/algoh/blockstats_test.go | 3 ++- cmd/catchupsrv/download_test.go | 3 ++- cmd/catchupsrv/main.go | 3 ++- cmd/catchupsrv/tarblocks.go | 3 ++- cmd/goal/clerk.go | 4 ++-- cmd/goal/commands.go | 5 ++--- cmd/goal/commands_test.go | 3 ++- cmd/goal/formatting_test.go | 3 ++- cmd/goal/node.go | 3 +-- cmd/goal/tealsign.go | 4 ++-- cmd/netgoal/commands.go | 4 ++-- cmd/partitiontest_linter/plugin/plugin.go | 3 ++- cmd/pingpong/commands.go | 3 ++- cmd/tealdbg/cdtdbg.go | 3 ++- cmd/tealdbg/dryrunRequest.go | 5 ++--- cmd/tealdbg/local_test.go | 3 ++- cmd/tealdbg/server.go | 3 ++- cmd/tealdbg/server_test.go | 3 ++- cmd/tealdbg/util_test.go | 3 ++- cmd/tealdbg/webdbg.go | 6 ++++-- cmd/tealdbg/webdbg_test.go | 3 ++- compactcert/msgp_gen_test.go | 3 ++- compactcert/worker_test.go | 3 ++- config/consensus_test.go | 3 ++- crypto/compactcert/msgp_gen_test.go | 3 ++- crypto/encoding_test.go | 2 -- crypto/falconWrapper_test.go | 7 +++++-- crypto/hashes.go | 3 ++- crypto/hashes_test.go | 4 ++-- crypto/merklearray/msgp_gen.go | 3 ++- crypto/merklearray/msgp_gen_test.go | 3 ++- crypto/merklesignature/msgp_gen.go | 3 ++- crypto/merklesignature/msgp_gen_test.go | 3 ++- crypto/merkletrie/bitset_test.go | 3 ++- crypto/msgp_gen_test.go | 3 ++- crypto/onetimesig.go | 3 ++- crypto/util_test.go | 3 ++- daemon/algod/api/client/restClient.go | 3 +-- daemon/algod/api/server/lib/middlewares/auth_test.go | 3 ++- daemon/algod/api/server/v1/handlers/handlers_test.go | 3 ++- daemon/algod/api/server/v2/dryrun.go | 3 +-- .../algod/api/server/v2/generated/private/routes.go | 8 +++++--- daemon/algod/api/server/v2/generated/routes.go | 8 +++++--- daemon/algod/api/server/v2/handlers.go | 3 ++- .../api/server/v2/test/handlers_resources_test.go | 7 ++++--- daemon/algod/api/server/v2/test/handlers_test.go | 5 +++-- daemon/algod/api/server/v2/utils.go | 3 ++- daemon/algod/api/spec/v2/msgp_gen.go | 3 ++- daemon/algod/api/spec/v2/msgp_gen_test.go | 3 ++- daemon/algod/server_test.go | 3 ++- daemon/kmd/server/server.go | 3 ++- daemon/kmd/session/session.go | 3 ++- daemon/kmd/wallet/driver/sqlite.go | 5 +++-- data/abi/abi_encode_test.go | 3 ++- data/abi/abi_json_test.go | 3 ++- data/abi/abi_type_test.go | 3 ++- data/account/msgp_gen.go | 3 ++- data/account/msgp_gen_test.go | 3 ++- data/account/participationRegistry_test.go | 1 - data/account/registeryDbOps.go | 3 ++- data/basics/fields_test.go | 3 ++- data/basics/msgp_gen.go | 3 ++- data/basics/msgp_gen_test.go | 3 ++- data/basics/units_test.go | 3 ++- data/bookkeeping/msgp_gen.go | 3 ++- data/bookkeeping/msgp_gen_test.go | 3 ++- data/committee/msgp_gen_test.go | 3 ++- data/hashable/msgp_gen_test.go | 3 ++- data/transactions/logic/backwardCompat_test.go | 3 ++- data/transactions/logic/debugger_test.go | 3 ++- data/transactions/logic/doc_test.go | 3 ++- data/transactions/logic/evalAppTxn_test.go | 4 ++-- data/transactions/logic/opcodes_test.go | 3 ++- data/transactions/msgp_gen.go | 3 ++- data/transactions/msgp_gen_test.go | 3 ++- data/transactions/payset_test.go | 3 ++- data/transactions/teal_test.go | 3 ++- data/transactions/transaction_test.go | 4 ++-- gen/generate_test.go | 6 +++--- ledger/bulletin_test.go | 3 ++- ledger/catchpointtracker_test.go | 1 - ledger/evalbench_test.go | 3 ++- ledger/ledger_perf_test.go | 3 ++- ledger/ledger_test.go | 5 ++--- ledger/ledgercore/msgp_gen_test.go | 3 ++- ledger/msgp_gen.go | 3 ++- ledger/msgp_gen_test.go | 3 ++- ledger/perf_test.go | 3 ++- ledger/testing/randomAccounts.go | 5 +---- ledger/tracker.go | 3 ++- libgoal/libgoal.go | 11 +++++------ libgoal/libgoal_test.go | 3 ++- logging/cyclicWriter_test.go | 3 ++- logging/logBuffer_test.go | 3 ++- logging/log_test.go | 3 ++- logging/telemetryCommon.go | 3 ++- logging/telemetryConfig_test.go | 3 ++- logging/telemetryspec/metric_test.go | 3 ++- netdeploy/network.go | 3 +-- netdeploy/remote/bootstrappedNetwork_test.go | 3 ++- network/phonebook_test.go | 3 ++- network/topics_test.go | 3 ++- network/wsNetwork.go | 3 ++- network/wsPeer_test.go | 3 ++- node/msgp_gen_test.go | 3 ++- node/node.go | 3 ++- nodecontrol/algodControl_test.go | 3 ++- protocol/codec_test.go | 6 ++++-- protocol/codec_tester.go | 6 +++--- protocol/test/msgp_gen_test.go | 3 ++- rpcs/blockService.go | 1 - rpcs/msgp_gen_test.go | 3 ++- .../cc_agent/component/agent_test.go | 3 ++- test/e2e-go/cli/tealdbg/cdtmock/main.go | 1 - .../features/catchup/catchpointCatchup_test.go | 3 ++- test/e2e-go/features/multisig/multisig_test.go | 3 ++- test/e2e-go/features/transactions/proof_test.go | 3 ++- test/e2e-go/perf/basic_test.go | 3 +-- test/e2e-go/restAPI/restClient_test.go | 1 - test/e2e-go/upgrades/stateproof_test.go | 12 +++++++----- test/framework/fixtures/expectFixture.go | 3 ++- test/framework/fixtures/libgoalFixture.go | 3 ++- tools/debug/logfilter/main_test.go | 3 ++- tools/network/dnssec/anchor_test.go | 3 ++- tools/network/dnssec/client_test.go | 3 ++- tools/network/dnssec/config_test.go | 3 ++- tools/network/dnssec/config_unix_test.go | 3 ++- tools/network/dnssec/dnssec_test.go | 5 +++-- tools/network/dnssec/sort_test.go | 3 ++- tools/network/dnssec/trustchain.go | 3 ++- tools/network/dnssec/trustedchain_test.go | 3 ++- tools/network/dnssec/trustedzone_test.go | 3 ++- tools/network/dnssec/util_test.go | 3 ++- tools/network/resolver_test.go | 3 ++- util/codecs/json_test.go | 6 ++++-- util/condvar/timedwait_test.go | 3 ++- util/db/initialize_test.go | 4 ++-- util/db/versioning_test.go | 3 ++- util/metrics/counter_test.go | 3 ++- util/metrics/gauge_test.go | 3 ++- util/metrics/registry_test.go | 3 ++- util/metrics/reporter.go | 2 -- util/metrics/reporter_test.go | 3 ++- util/metrics/segment_test.go | 3 ++- util/metrics/stringGauge_test.go | 3 ++- util/metrics/tagcounter_test.go | 3 ++- util/s3/s3Helper_test.go | 3 ++- util/timers/monotonic_test.go | 3 ++- 168 files changed, 341 insertions(+), 214 deletions(-) diff --git a/agreement/agreementtest/simulate_test.go b/agreement/agreementtest/simulate_test.go index 173f91fad8..73a8791bad 100644 --- a/agreement/agreementtest/simulate_test.go +++ b/agreement/agreementtest/simulate_test.go @@ -25,9 +25,10 @@ import ( "testing" "time" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" diff --git a/agreement/common_test.go b/agreement/common_test.go index fa43d10912..bc0dd6d8e1 100644 --- a/agreement/common_test.go +++ b/agreement/common_test.go @@ -22,9 +22,10 @@ import ( "math/rand" "testing" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" diff --git a/agreement/cryptoVerifier_test.go b/agreement/cryptoVerifier_test.go index a42ffd9b0c..affe958116 100644 --- a/agreement/cryptoVerifier_test.go +++ b/agreement/cryptoVerifier_test.go @@ -24,10 +24,11 @@ import ( "testing" "time" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/account" diff --git a/agreement/fuzzer/dropMessageFilter_test.go b/agreement/fuzzer/dropMessageFilter_test.go index 519782c77c..cd2e3ff4d1 100644 --- a/agreement/fuzzer/dropMessageFilter_test.go +++ b/agreement/fuzzer/dropMessageFilter_test.go @@ -18,6 +18,7 @@ package fuzzer import ( "encoding/json" + "github.com/algorand/go-algorand/protocol" ) diff --git a/agreement/fuzzer/ledger_test.go b/agreement/fuzzer/ledger_test.go index 2ae73dd694..021271df95 100644 --- a/agreement/fuzzer/ledger_test.go +++ b/agreement/fuzzer/ledger_test.go @@ -21,6 +21,8 @@ import ( "fmt" "math/rand" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" @@ -28,7 +30,6 @@ import ( "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/data/committee" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-deadlock" ) const randseed = 0 diff --git a/agreement/fuzzer/messageDecoderFilter_test.go b/agreement/fuzzer/messageDecoderFilter_test.go index cb80ed990b..f4029b4421 100644 --- a/agreement/fuzzer/messageDecoderFilter_test.go +++ b/agreement/fuzzer/messageDecoderFilter_test.go @@ -19,6 +19,7 @@ package fuzzer import ( "bytes" "encoding/json" + "github.com/algorand/go-deadlock" //"github.com/algorand/go-algorand/agreement" diff --git a/agreement/fuzzer/messageDelayFilter_test.go b/agreement/fuzzer/messageDelayFilter_test.go index 04cf55081f..fb39f3bdf5 100644 --- a/agreement/fuzzer/messageDelayFilter_test.go +++ b/agreement/fuzzer/messageDelayFilter_test.go @@ -19,6 +19,7 @@ package fuzzer import ( "container/heap" "encoding/json" + "github.com/algorand/go-deadlock" "github.com/algorand/go-algorand/protocol" diff --git a/agreement/fuzzer/messageDuplicationFilter_test.go b/agreement/fuzzer/messageDuplicationFilter_test.go index 747301a11f..3ef8e97b0a 100644 --- a/agreement/fuzzer/messageDuplicationFilter_test.go +++ b/agreement/fuzzer/messageDuplicationFilter_test.go @@ -20,8 +20,9 @@ import ( "container/heap" "encoding/json" - "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-deadlock" + + "github.com/algorand/go-algorand/protocol" ) // Duplicate message with delay diff --git a/agreement/fuzzer/messagePriorityQueue_test.go b/agreement/fuzzer/messagePriorityQueue_test.go index bbb9f13647..54156c911e 100644 --- a/agreement/fuzzer/messagePriorityQueue_test.go +++ b/agreement/fuzzer/messagePriorityQueue_test.go @@ -18,6 +18,7 @@ package fuzzer import ( "container/heap" + "github.com/algorand/go-algorand/protocol" ) diff --git a/agreement/fuzzer/messageReflectionFilter_test.go b/agreement/fuzzer/messageReflectionFilter_test.go index c1b58ef27f..37b89c4054 100644 --- a/agreement/fuzzer/messageReflectionFilter_test.go +++ b/agreement/fuzzer/messageReflectionFilter_test.go @@ -20,8 +20,9 @@ import ( "container/heap" "encoding/json" - "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-deadlock" + + "github.com/algorand/go-algorand/protocol" ) // Simulate a 2 way mirror where messages are passed through and also reflected back to sender with a delay diff --git a/agreement/fuzzer/tests_test.go b/agreement/fuzzer/tests_test.go index 75a0cc67cf..aa52407b2d 100644 --- a/agreement/fuzzer/tests_test.go +++ b/agreement/fuzzer/tests_test.go @@ -25,7 +25,6 @@ import ( "math" "math/rand" "os" - //ossignal "os/signal" "path/filepath" //"runtime/pprof" @@ -35,9 +34,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/algorand/go-algorand/logging" "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/logging" //"github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" ) diff --git a/agreement/msgp_gen.go b/agreement/msgp_gen.go index 8df6c47a99..e9e4c1c8e1 100644 --- a/agreement/msgp_gen.go +++ b/agreement/msgp_gen.go @@ -5,11 +5,12 @@ package agreement import ( "sort" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/msgp/msgp" ) // The following msgp objects are implemented in this file: diff --git a/agreement/msgp_gen_test.go b/agreement/msgp_gen_test.go index 4bfe9d0280..3bf609c2bf 100644 --- a/agreement/msgp_gen_test.go +++ b/agreement/msgp_gen_test.go @@ -7,9 +7,10 @@ package agreement import ( "testing" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalCertificate(t *testing.T) { diff --git a/agreement/proposalManager_test.go b/agreement/proposalManager_test.go index a759739d0f..1021cc477b 100644 --- a/agreement/proposalManager_test.go +++ b/agreement/proposalManager_test.go @@ -19,8 +19,9 @@ package agreement import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) // Creates a proposal manager, and returns it in automata and white box form, along diff --git a/agreement/proposalTracker_test.go b/agreement/proposalTracker_test.go index 71096b4ad6..c5e4ea6f1e 100644 --- a/agreement/proposalTracker_test.go +++ b/agreement/proposalTracker_test.go @@ -21,9 +21,10 @@ import ( "sort" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func sortedVoteGen(t *testing.T) (votes []vote) { diff --git a/agreement/service_test.go b/agreement/service_test.go index ff1d19d87d..ec2294b86d 100644 --- a/agreement/service_test.go +++ b/agreement/service_test.go @@ -29,9 +29,10 @@ import ( "testing" "time" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/account" diff --git a/catchup/service_test.go b/catchup/service_test.go index 6ab2f22178..9df5e21969 100644 --- a/catchup/service_test.go +++ b/catchup/service_test.go @@ -25,9 +25,10 @@ import ( "testing" "time" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" diff --git a/cmd/algod/main.go b/cmd/algod/main.go index b29d55c2ff..849cdd5c7e 100644 --- a/cmd/algod/main.go +++ b/cmd/algod/main.go @@ -27,9 +27,10 @@ import ( "strings" "time" - "github.com/algorand/go-deadlock" "github.com/gofrs/flock" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/daemon/algod" diff --git a/cmd/algofix/deadlock_test.go b/cmd/algofix/deadlock_test.go index 720bafa105..72ba1aa178 100644 --- a/cmd/algofix/deadlock_test.go +++ b/cmd/algofix/deadlock_test.go @@ -25,8 +25,9 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) const deadlockSimpleSrc = `package main diff --git a/cmd/algoh/blockWatcher_test.go b/cmd/algoh/blockWatcher_test.go index f3efd1aaf5..cd8f9e2f0e 100644 --- a/cmd/algoh/blockWatcher_test.go +++ b/cmd/algoh/blockWatcher_test.go @@ -22,9 +22,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/daemon/algod/api/spec/v1" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) func bw(client Client) *blockWatcher { diff --git a/cmd/algoh/blockstats_test.go b/cmd/algoh/blockstats_test.go index d0cafaf3f3..4f464d34e3 100644 --- a/cmd/algoh/blockstats_test.go +++ b/cmd/algoh/blockstats_test.go @@ -20,10 +20,11 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/daemon/algod/api/spec/v1" "github.com/algorand/go-algorand/logging/telemetryspec" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) type event struct { diff --git a/cmd/catchupsrv/download_test.go b/cmd/catchupsrv/download_test.go index b616f81f5a..9b052c3951 100644 --- a/cmd/catchupsrv/download_test.go +++ b/cmd/catchupsrv/download_test.go @@ -19,8 +19,9 @@ package main import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestBlockToPath(t *testing.T) { diff --git a/cmd/catchupsrv/main.go b/cmd/catchupsrv/main.go index 86fd9645af..94e0cb0f54 100644 --- a/cmd/catchupsrv/main.go +++ b/cmd/catchupsrv/main.go @@ -27,9 +27,10 @@ import ( "path" "strconv" - "github.com/algorand/websocket" "github.com/gorilla/mux" + "github.com/algorand/websocket" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/network" diff --git a/cmd/catchupsrv/tarblocks.go b/cmd/catchupsrv/tarblocks.go index 25f686f0ca..06adbdf805 100644 --- a/cmd/catchupsrv/tarblocks.go +++ b/cmd/catchupsrv/tarblocks.go @@ -27,8 +27,9 @@ import ( "strconv" "strings" - "github.com/algorand/go-algorand/logging" "github.com/algorand/go-deadlock" + + "github.com/algorand/go-algorand/logging" ) type tarBlockSet struct { diff --git a/cmd/goal/clerk.go b/cmd/goal/clerk.go index 5359c372ff..f5dc228e19 100644 --- a/cmd/goal/clerk.go +++ b/cmd/goal/clerk.go @@ -26,6 +26,8 @@ import ( "strings" "time" + "github.com/spf13/cobra" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" generatedV2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" @@ -37,8 +39,6 @@ import ( "github.com/algorand/go-algorand/data/transactions/verify" "github.com/algorand/go-algorand/libgoal" "github.com/algorand/go-algorand/protocol" - - "github.com/spf13/cobra" ) var ( diff --git a/cmd/goal/commands.go b/cmd/goal/commands.go index f2eee77601..8093a0f87e 100644 --- a/cmd/goal/commands.go +++ b/cmd/goal/commands.go @@ -30,11 +30,10 @@ import ( "github.com/spf13/cobra/doc" "golang.org/x/crypto/ssh/terminal" - algodclient "github.com/algorand/go-algorand/daemon/algod/api/client" - kmdclient "github.com/algorand/go-algorand/daemon/kmd/client" - "github.com/algorand/go-algorand/config" + algodclient "github.com/algorand/go-algorand/daemon/algod/api/client" "github.com/algorand/go-algorand/daemon/algod/api/spec/common" + kmdclient "github.com/algorand/go-algorand/daemon/kmd/client" "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/libgoal" diff --git a/cmd/goal/commands_test.go b/cmd/goal/commands_test.go index 1d78642562..6a3bd486b7 100644 --- a/cmd/goal/commands_test.go +++ b/cmd/goal/commands_test.go @@ -20,8 +20,9 @@ import ( "os" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestEnsureDataDirReturnsWhenDataDirIsProvided(t *testing.T) { diff --git a/cmd/goal/formatting_test.go b/cmd/goal/formatting_test.go index bc3bce6704..7de31843d3 100644 --- a/cmd/goal/formatting_test.go +++ b/cmd/goal/formatting_test.go @@ -19,8 +19,9 @@ package main import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestUnicodePrintable(t *testing.T) { diff --git a/cmd/goal/node.go b/cmd/goal/node.go index 67fccbf41e..55fabb9016 100644 --- a/cmd/goal/node.go +++ b/cmd/goal/node.go @@ -32,9 +32,8 @@ import ( "github.com/spf13/cobra" - generatedV2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" - "github.com/algorand/go-algorand/config" + generatedV2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/libgoal" "github.com/algorand/go-algorand/network" diff --git a/cmd/goal/tealsign.go b/cmd/goal/tealsign.go index 3d35624a1d..5b296b5a72 100644 --- a/cmd/goal/tealsign.go +++ b/cmd/goal/tealsign.go @@ -21,13 +21,13 @@ import ( "encoding/base64" "io/ioutil" + "github.com/spf13/cobra" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/protocol" - - "github.com/spf13/cobra" ) var ( diff --git a/cmd/netgoal/commands.go b/cmd/netgoal/commands.go index 30522e87da..a54d8944d5 100644 --- a/cmd/netgoal/commands.go +++ b/cmd/netgoal/commands.go @@ -20,10 +20,10 @@ import ( "fmt" "os" - "github.com/algorand/go-deadlock" - "github.com/sirupsen/logrus" "github.com/spf13/cobra" + + "github.com/algorand/go-deadlock" ) var log *logrus.Logger diff --git a/cmd/partitiontest_linter/plugin/plugin.go b/cmd/partitiontest_linter/plugin/plugin.go index 587529feac..ef3fe70d04 100644 --- a/cmd/partitiontest_linter/plugin/plugin.go +++ b/cmd/partitiontest_linter/plugin/plugin.go @@ -17,9 +17,10 @@ package main import ( - linter "github.com/algorand/go-algorand/cmd/partitiontest_linter" "golang.org/x/tools/go/analysis" "golang.org/x/tools/go/analysis/singlechecker" + + linter "github.com/algorand/go-algorand/cmd/partitiontest_linter" ) type analyzerPlugin struct{} diff --git a/cmd/pingpong/commands.go b/cmd/pingpong/commands.go index 71733f22f8..b2a6e6f1a0 100644 --- a/cmd/pingpong/commands.go +++ b/cmd/pingpong/commands.go @@ -20,8 +20,9 @@ import ( "fmt" "os" - "github.com/algorand/go-algorand/logging" "github.com/spf13/cobra" + + "github.com/algorand/go-algorand/logging" ) var log = logging.Base() diff --git a/cmd/tealdbg/cdtdbg.go b/cmd/tealdbg/cdtdbg.go index fd88bf92e0..38eb7ef8c0 100644 --- a/cmd/tealdbg/cdtdbg.go +++ b/cmd/tealdbg/cdtdbg.go @@ -23,9 +23,10 @@ import ( "net/http" "time" - "github.com/algorand/go-deadlock" "github.com/gorilla/mux" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/cmd/tealdbg/cdt" ) diff --git a/cmd/tealdbg/dryrunRequest.go b/cmd/tealdbg/dryrunRequest.go index b1ec50cda8..e2f2b1b749 100644 --- a/cmd/tealdbg/dryrunRequest.go +++ b/cmd/tealdbg/dryrunRequest.go @@ -19,11 +19,10 @@ package main import ( "log" - "github.com/algorand/go-algorand/data/basics" - "github.com/algorand/go-algorand/protocol" - v2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2" generatedV2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" + "github.com/algorand/go-algorand/data/basics" + "github.com/algorand/go-algorand/protocol" ) // ddrFromParams converts serialized DryrunRequest to v2.DryrunRequest diff --git a/cmd/tealdbg/local_test.go b/cmd/tealdbg/local_test.go index 99cfa1562e..32277cd06c 100644 --- a/cmd/tealdbg/local_test.go +++ b/cmd/tealdbg/local_test.go @@ -26,6 +26,8 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" v2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2" "github.com/algorand/go-algorand/data/basics" @@ -34,7 +36,6 @@ import ( "github.com/algorand/go-algorand/ledger/apply" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) var txnSample string = `{ diff --git a/cmd/tealdbg/server.go b/cmd/tealdbg/server.go index cf062af627..69b3a1d264 100644 --- a/cmd/tealdbg/server.go +++ b/cmd/tealdbg/server.go @@ -25,8 +25,9 @@ import ( "strings" "time" - "github.com/algorand/websocket" "github.com/gorilla/mux" + + "github.com/algorand/websocket" ) const ( diff --git a/cmd/tealdbg/server_test.go b/cmd/tealdbg/server_test.go index a91be71819..37e18bae84 100644 --- a/cmd/tealdbg/server_test.go +++ b/cmd/tealdbg/server_test.go @@ -23,9 +23,10 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/gorilla/mux" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) type mockFactory struct{} diff --git a/cmd/tealdbg/util_test.go b/cmd/tealdbg/util_test.go index 85de0747dd..170528be05 100644 --- a/cmd/tealdbg/util_test.go +++ b/cmd/tealdbg/util_test.go @@ -19,8 +19,9 @@ package main import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestVLQ(t *testing.T) { diff --git a/cmd/tealdbg/webdbg.go b/cmd/tealdbg/webdbg.go index 3f99eea705..cea69a435f 100644 --- a/cmd/tealdbg/webdbg.go +++ b/cmd/tealdbg/webdbg.go @@ -25,10 +25,12 @@ import ( "log" "net/http" - "github.com/algorand/go-algorand/protocol" + "github.com/gorilla/mux" + "github.com/algorand/go-deadlock" "github.com/algorand/websocket" - "github.com/gorilla/mux" + + "github.com/algorand/go-algorand/protocol" ) // WebPageFrontend is web page debugging frontend diff --git a/cmd/tealdbg/webdbg_test.go b/cmd/tealdbg/webdbg_test.go index be6801d636..fcb24c45a7 100644 --- a/cmd/tealdbg/webdbg_test.go +++ b/cmd/tealdbg/webdbg_test.go @@ -23,9 +23,10 @@ import ( "net/http/httptest" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/gorilla/mux" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestWebPageFrontendHandlers(t *testing.T) { diff --git a/compactcert/msgp_gen_test.go b/compactcert/msgp_gen_test.go index 88c8395a37..809173bc02 100644 --- a/compactcert/msgp_gen_test.go +++ b/compactcert/msgp_gen_test.go @@ -7,9 +7,10 @@ package compactcert import ( "testing" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalsigFromAddr(t *testing.T) { diff --git a/compactcert/worker_test.go b/compactcert/worker_test.go index 5e72b96bf4..1c39209d0f 100644 --- a/compactcert/worker_test.go +++ b/compactcert/worker_test.go @@ -25,6 +25,8 @@ import ( "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/crypto/compactcert" @@ -39,7 +41,6 @@ import ( "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/db" - "github.com/algorand/go-deadlock" ) type testWorkerStubs struct { diff --git a/config/consensus_test.go b/config/consensus_test.go index 92edf17981..dfd1c259c8 100644 --- a/config/consensus_test.go +++ b/config/consensus_test.go @@ -19,8 +19,9 @@ package config import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestConsensusParams(t *testing.T) { diff --git a/crypto/compactcert/msgp_gen_test.go b/crypto/compactcert/msgp_gen_test.go index 23ebb5a3fd..1c2dab65bc 100644 --- a/crypto/compactcert/msgp_gen_test.go +++ b/crypto/compactcert/msgp_gen_test.go @@ -7,9 +7,10 @@ package compactcert import ( "testing" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalCert(t *testing.T) { diff --git a/crypto/encoding_test.go b/crypto/encoding_test.go index 515f6a3eff..5654bbe1df 100644 --- a/crypto/encoding_test.go +++ b/crypto/encoding_test.go @@ -20,8 +20,6 @@ import ( "testing" "github.com/algorand/go-algorand/test/partitiontest" - // "github.com/stretchr/testify/require" - // "github.com/algorand/go-algorand/protocol" ) func TestEmptyEncoding(t *testing.T) { diff --git a/crypto/falconWrapper_test.go b/crypto/falconWrapper_test.go index b659ce56eb..039c9bc51b 100644 --- a/crypto/falconWrapper_test.go +++ b/crypto/falconWrapper_test.go @@ -17,10 +17,13 @@ package crypto import ( + "testing" + + "github.com/stretchr/testify/require" + "github.com/algorand/falcon" + "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" - "testing" ) func TestSignAndVerifyFalcon(t *testing.T) { diff --git a/crypto/hashes.go b/crypto/hashes.go index 51db955242..15ceffd5e0 100644 --- a/crypto/hashes.go +++ b/crypto/hashes.go @@ -22,8 +22,9 @@ import ( "fmt" "hash" - "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-sumhash" + + "github.com/algorand/go-algorand/protocol" ) // HashType represents different hash functions diff --git a/crypto/hashes_test.go b/crypto/hashes_test.go index 2ebff4239d..dd7b2c1d33 100644 --- a/crypto/hashes_test.go +++ b/crypto/hashes_test.go @@ -19,9 +19,9 @@ package crypto import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestHashFactoryCreatingNewHashes(t *testing.T) { diff --git a/crypto/merklearray/msgp_gen.go b/crypto/merklearray/msgp_gen.go index 344e7b86d2..ba7e4a61c7 100644 --- a/crypto/merklearray/msgp_gen.go +++ b/crypto/merklearray/msgp_gen.go @@ -3,8 +3,9 @@ package merklearray // Code generated by github.com/algorand/msgp DO NOT EDIT. import ( - "github.com/algorand/go-algorand/crypto" "github.com/algorand/msgp/msgp" + + "github.com/algorand/go-algorand/crypto" ) // The following msgp objects are implemented in this file: diff --git a/crypto/merklearray/msgp_gen_test.go b/crypto/merklearray/msgp_gen_test.go index fbcc81970a..435d2c4fba 100644 --- a/crypto/merklearray/msgp_gen_test.go +++ b/crypto/merklearray/msgp_gen_test.go @@ -7,9 +7,10 @@ package merklearray import ( "testing" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalLayer(t *testing.T) { diff --git a/crypto/merklesignature/msgp_gen.go b/crypto/merklesignature/msgp_gen.go index c97e0df408..a40196d4a6 100644 --- a/crypto/merklesignature/msgp_gen.go +++ b/crypto/merklesignature/msgp_gen.go @@ -3,8 +3,9 @@ package merklesignature // Code generated by github.com/algorand/msgp DO NOT EDIT. import ( - "github.com/algorand/go-algorand/crypto" "github.com/algorand/msgp/msgp" + + "github.com/algorand/go-algorand/crypto" ) // The following msgp objects are implemented in this file: diff --git a/crypto/merklesignature/msgp_gen_test.go b/crypto/merklesignature/msgp_gen_test.go index 9c73788c54..d71c06ee86 100644 --- a/crypto/merklesignature/msgp_gen_test.go +++ b/crypto/merklesignature/msgp_gen_test.go @@ -7,9 +7,10 @@ package merklesignature import ( "testing" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalKeyRoundPair(t *testing.T) { diff --git a/crypto/merkletrie/bitset_test.go b/crypto/merkletrie/bitset_test.go index 758c3299e3..2dfd18acdd 100644 --- a/crypto/merkletrie/bitset_test.go +++ b/crypto/merkletrie/bitset_test.go @@ -20,8 +20,9 @@ import ( "math/bits" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestBitSet(t *testing.T) { diff --git a/crypto/msgp_gen_test.go b/crypto/msgp_gen_test.go index 21be375fad..f5daf82e41 100644 --- a/crypto/msgp_gen_test.go +++ b/crypto/msgp_gen_test.go @@ -7,9 +7,10 @@ package crypto import ( "testing" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalDigest(t *testing.T) { diff --git a/crypto/onetimesig.go b/crypto/onetimesig.go index 3f003719ae..319168ff32 100644 --- a/crypto/onetimesig.go +++ b/crypto/onetimesig.go @@ -20,9 +20,10 @@ import ( "encoding/binary" "fmt" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-deadlock" ) // A OneTimeSignature is a cryptographic signature that is produced a limited diff --git a/crypto/util_test.go b/crypto/util_test.go index 281d78a1de..a493c29598 100644 --- a/crypto/util_test.go +++ b/crypto/util_test.go @@ -19,8 +19,9 @@ package crypto import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestEncodeDecode(t *testing.T) { diff --git a/daemon/algod/api/client/restClient.go b/daemon/algod/api/client/restClient.go index 7f8b2d4121..51710c749a 100644 --- a/daemon/algod/api/client/restClient.go +++ b/daemon/algod/api/client/restClient.go @@ -30,10 +30,9 @@ import ( "github.com/google/go-querystring/query" + "github.com/algorand/go-algorand/crypto" generatedV2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" privateV2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated/private" - - "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/daemon/algod/api/spec/common" v1 "github.com/algorand/go-algorand/daemon/algod/api/spec/v1" "github.com/algorand/go-algorand/data/basics" diff --git a/daemon/algod/api/server/lib/middlewares/auth_test.go b/daemon/algod/api/server/lib/middlewares/auth_test.go index 7e00b66c3d..ea8b044002 100644 --- a/daemon/algod/api/server/lib/middlewares/auth_test.go +++ b/daemon/algod/api/server/lib/middlewares/auth_test.go @@ -21,9 +21,10 @@ import ( "net/http" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/labstack/echo/v4" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) var errSuccess = errors.New("unexpected success") diff --git a/daemon/algod/api/server/v1/handlers/handlers_test.go b/daemon/algod/api/server/v1/handlers/handlers_test.go index 6e54c9118b..541391c9a2 100644 --- a/daemon/algod/api/server/v1/handlers/handlers_test.go +++ b/daemon/algod/api/server/v1/handlers/handlers_test.go @@ -21,12 +21,13 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/node" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) func TestDecorateUnknownTransactionTypeError(t *testing.T) { diff --git a/daemon/algod/api/server/v2/dryrun.go b/daemon/algod/api/server/v2/dryrun.go index ee48ead97e..510dbe9f22 100644 --- a/daemon/algod/api/server/v2/dryrun.go +++ b/daemon/algod/api/server/v2/dryrun.go @@ -27,10 +27,9 @@ import ( "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/data/transactions/logic" + "github.com/algorand/go-algorand/ledger" "github.com/algorand/go-algorand/ledger/apply" "github.com/algorand/go-algorand/ledger/ledgercore" - - "github.com/algorand/go-algorand/ledger" "github.com/algorand/go-algorand/protocol" ) diff --git a/daemon/algod/api/server/v2/generated/private/routes.go b/daemon/algod/api/server/v2/generated/private/routes.go index 2617d7fb6f..65af276cbf 100644 --- a/daemon/algod/api/server/v2/generated/private/routes.go +++ b/daemon/algod/api/server/v2/generated/private/routes.go @@ -8,11 +8,13 @@ import ( "compress/gzip" "encoding/base64" "fmt" - "github.com/algorand/oapi-codegen/pkg/runtime" - "github.com/getkin/kin-openapi/openapi3" - "github.com/labstack/echo/v4" "net/http" "strings" + + "github.com/getkin/kin-openapi/openapi3" + "github.com/labstack/echo/v4" + + "github.com/algorand/oapi-codegen/pkg/runtime" ) // ServerInterface represents all server handlers. diff --git a/daemon/algod/api/server/v2/generated/routes.go b/daemon/algod/api/server/v2/generated/routes.go index 88c1f28a2b..5bd2894728 100644 --- a/daemon/algod/api/server/v2/generated/routes.go +++ b/daemon/algod/api/server/v2/generated/routes.go @@ -8,11 +8,13 @@ import ( "compress/gzip" "encoding/base64" "fmt" - "github.com/algorand/oapi-codegen/pkg/runtime" - "github.com/getkin/kin-openapi/openapi3" - "github.com/labstack/echo/v4" "net/http" "strings" + + "github.com/getkin/kin-openapi/openapi3" + "github.com/labstack/echo/v4" + + "github.com/algorand/oapi-codegen/pkg/runtime" ) // ServerInterface represents all server handlers. diff --git a/daemon/algod/api/server/v2/handlers.go b/daemon/algod/api/server/v2/handlers.go index 7c76d1dad0..4ed90bdea2 100644 --- a/daemon/algod/api/server/v2/handlers.go +++ b/daemon/algod/api/server/v2/handlers.go @@ -29,6 +29,8 @@ import ( "github.com/labstack/echo/v4" + "github.com/algorand/go-codec/codec" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" @@ -45,7 +47,6 @@ import ( "github.com/algorand/go-algorand/node" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/rpcs" - "github.com/algorand/go-codec/codec" ) const maxTealSourceBytes = 1e5 diff --git a/daemon/algod/api/server/v2/test/handlers_resources_test.go b/daemon/algod/api/server/v2/test/handlers_resources_test.go index e648c400ac..0970b90e79 100644 --- a/daemon/algod/api/server/v2/test/handlers_resources_test.go +++ b/daemon/algod/api/server/v2/test/handlers_resources_test.go @@ -22,6 +22,10 @@ import ( "net/http/httptest" "testing" + "github.com/labstack/echo/v4" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/config" v2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2" @@ -33,9 +37,6 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/labstack/echo/v4" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) type mockLedger struct { diff --git a/daemon/algod/api/server/v2/test/handlers_test.go b/daemon/algod/api/server/v2/test/handlers_test.go index a7f00b70c4..e4cba34ac1 100644 --- a/daemon/algod/api/server/v2/test/handlers_test.go +++ b/daemon/algod/api/server/v2/test/handlers_test.go @@ -28,12 +28,14 @@ import ( "github.com/labstack/echo/v4" "github.com/stretchr/testify/require" + "github.com/algorand/go-codec/codec" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/crypto/merklesignature" v2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2" - "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" generatedV2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" + "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" "github.com/algorand/go-algorand/data" "github.com/algorand/go-algorand/data/account" "github.com/algorand/go-algorand/data/basics" @@ -45,7 +47,6 @@ import ( "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/execpool" - "github.com/algorand/go-codec/codec" ) func setupTestForMethodGet(t *testing.T) (v2.Handlers, echo.Context, *httptest.ResponseRecorder, []account.Root, []transactions.SignedTxn, func()) { diff --git a/daemon/algod/api/server/v2/utils.go b/daemon/algod/api/server/v2/utils.go index 1fa1b1dfaf..e3c0790912 100644 --- a/daemon/algod/api/server/v2/utils.go +++ b/daemon/algod/api/server/v2/utils.go @@ -24,9 +24,10 @@ import ( "unicode" "unicode/utf8" - "github.com/algorand/go-codec/codec" "github.com/labstack/echo/v4" + "github.com/algorand/go-codec/codec" + "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/transactions" diff --git a/daemon/algod/api/spec/v2/msgp_gen.go b/daemon/algod/api/spec/v2/msgp_gen.go index 48590fd11d..b14d47b792 100644 --- a/daemon/algod/api/spec/v2/msgp_gen.go +++ b/daemon/algod/api/spec/v2/msgp_gen.go @@ -3,8 +3,9 @@ package v2 // Code generated by github.com/algorand/msgp DO NOT EDIT. import ( - "github.com/algorand/go-algorand/data/basics" "github.com/algorand/msgp/msgp" + + "github.com/algorand/go-algorand/data/basics" ) // The following msgp objects are implemented in this file: diff --git a/daemon/algod/api/spec/v2/msgp_gen_test.go b/daemon/algod/api/spec/v2/msgp_gen_test.go index 57bda723cf..8838387cf9 100644 --- a/daemon/algod/api/spec/v2/msgp_gen_test.go +++ b/daemon/algod/api/spec/v2/msgp_gen_test.go @@ -7,9 +7,10 @@ package v2 import ( "testing" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalAccountApplicationModel(t *testing.T) { diff --git a/daemon/algod/server_test.go b/daemon/algod/server_test.go index 145a6e9b66..3c5382b3c3 100644 --- a/daemon/algod/server_test.go +++ b/daemon/algod/server_test.go @@ -23,8 +23,9 @@ import ( "net" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func isTCPPortAvailable(host string, port int) bool { diff --git a/daemon/kmd/server/server.go b/daemon/kmd/server/server.go index 973df186b3..c3288da24d 100644 --- a/daemon/kmd/server/server.go +++ b/daemon/kmd/server/server.go @@ -27,9 +27,10 @@ import ( "syscall" "time" - "github.com/algorand/go-deadlock" "github.com/gofrs/flock" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/daemon/kmd/api" "github.com/algorand/go-algorand/daemon/kmd/session" "github.com/algorand/go-algorand/logging" diff --git a/daemon/kmd/session/session.go b/daemon/kmd/session/session.go index f1a8b0a52d..6aa0b0fe45 100644 --- a/daemon/kmd/session/session.go +++ b/daemon/kmd/session/session.go @@ -20,9 +20,10 @@ import ( "context" "time" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/daemon/kmd/config" "github.com/algorand/go-algorand/daemon/kmd/wallet" - "github.com/algorand/go-deadlock" ) type walletHandle struct { diff --git a/daemon/kmd/wallet/driver/sqlite.go b/daemon/kmd/wallet/driver/sqlite.go index eb78f4a77b..0b70881fb7 100644 --- a/daemon/kmd/wallet/driver/sqlite.go +++ b/daemon/kmd/wallet/driver/sqlite.go @@ -25,10 +25,12 @@ import ( "path/filepath" "regexp" - "github.com/algorand/go-deadlock" "github.com/jmoiron/sqlx" "github.com/mattn/go-sqlite3" + "github.com/algorand/go-codec/codec" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/daemon/kmd/config" "github.com/algorand/go-algorand/daemon/kmd/wallet" @@ -36,7 +38,6 @@ import ( "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-codec/codec" ) const ( diff --git a/data/abi/abi_encode_test.go b/data/abi/abi_encode_test.go index 620013c238..6873f83338 100644 --- a/data/abi/abi_encode_test.go +++ b/data/abi/abi_encode_test.go @@ -23,9 +23,10 @@ import ( "math/big" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/chrismcguire/gobberish" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) const ( diff --git a/data/abi/abi_json_test.go b/data/abi/abi_json_test.go index 0c3a006e32..e54ef4d126 100644 --- a/data/abi/abi_json_test.go +++ b/data/abi/abi_json_test.go @@ -21,9 +21,10 @@ import ( "math/big" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) func TestRandomAddressEquality(t *testing.T) { diff --git a/data/abi/abi_type_test.go b/data/abi/abi_type_test.go index fb7c7e9025..a612d89894 100644 --- a/data/abi/abi_type_test.go +++ b/data/abi/abi_type_test.go @@ -24,8 +24,9 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestMakeTypeValid(t *testing.T) { diff --git a/data/account/msgp_gen.go b/data/account/msgp_gen.go index e9c3a521a4..5fa8daa6e5 100644 --- a/data/account/msgp_gen.go +++ b/data/account/msgp_gen.go @@ -3,8 +3,9 @@ package account // Code generated by github.com/algorand/msgp DO NOT EDIT. import ( - "github.com/algorand/go-algorand/crypto/merklesignature" "github.com/algorand/msgp/msgp" + + "github.com/algorand/go-algorand/crypto/merklesignature" ) // The following msgp objects are implemented in this file: diff --git a/data/account/msgp_gen_test.go b/data/account/msgp_gen_test.go index 9bde0e5d83..a2b184c860 100644 --- a/data/account/msgp_gen_test.go +++ b/data/account/msgp_gen_test.go @@ -7,9 +7,10 @@ package account import ( "testing" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalParticipationKeyIdentity(t *testing.T) { diff --git a/data/account/participationRegistry_test.go b/data/account/participationRegistry_test.go index 22714ba1d3..2147e641db 100644 --- a/data/account/participationRegistry_test.go +++ b/data/account/participationRegistry_test.go @@ -22,7 +22,6 @@ import ( "encoding/binary" "errors" "fmt" - "strings" "sync" "testing" diff --git a/data/account/registeryDbOps.go b/data/account/registeryDbOps.go index 691ca5124a..64e0e3adbd 100644 --- a/data/account/registeryDbOps.go +++ b/data/account/registeryDbOps.go @@ -21,8 +21,9 @@ import ( "database/sql" "errors" "fmt" - "github.com/algorand/go-algorand/protocol" "strings" + + "github.com/algorand/go-algorand/protocol" ) type dbOp interface { diff --git a/data/basics/fields_test.go b/data/basics/fields_test.go index 2fcabbd4d0..c4e8e6b5bb 100644 --- a/data/basics/fields_test.go +++ b/data/basics/fields_test.go @@ -22,10 +22,11 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) type typePath []string diff --git a/data/basics/msgp_gen.go b/data/basics/msgp_gen.go index f16d67caf6..53bcc659f1 100644 --- a/data/basics/msgp_gen.go +++ b/data/basics/msgp_gen.go @@ -5,9 +5,10 @@ package basics import ( "sort" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" - "github.com/algorand/msgp/msgp" ) // The following msgp objects are implemented in this file: diff --git a/data/basics/msgp_gen_test.go b/data/basics/msgp_gen_test.go index 8756c3c4e1..467f862ff8 100644 --- a/data/basics/msgp_gen_test.go +++ b/data/basics/msgp_gen_test.go @@ -7,9 +7,10 @@ package basics import ( "testing" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalAccountData(t *testing.T) { diff --git a/data/basics/units_test.go b/data/basics/units_test.go index efc9bd72cb..f8f116eff5 100644 --- a/data/basics/units_test.go +++ b/data/basics/units_test.go @@ -20,8 +20,9 @@ import ( "math" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestSubSaturate(t *testing.T) { diff --git a/data/bookkeeping/msgp_gen.go b/data/bookkeeping/msgp_gen.go index e7a810e3d5..00089d7154 100644 --- a/data/bookkeeping/msgp_gen.go +++ b/data/bookkeeping/msgp_gen.go @@ -5,11 +5,12 @@ package bookkeeping import ( "sort" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/msgp/msgp" ) // The following msgp objects are implemented in this file: diff --git a/data/bookkeeping/msgp_gen_test.go b/data/bookkeeping/msgp_gen_test.go index 8bad965935..dfd267e2d7 100644 --- a/data/bookkeeping/msgp_gen_test.go +++ b/data/bookkeeping/msgp_gen_test.go @@ -7,9 +7,10 @@ package bookkeeping import ( "testing" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalBlock(t *testing.T) { diff --git a/data/committee/msgp_gen_test.go b/data/committee/msgp_gen_test.go index 7a8946a6cb..658a21f611 100644 --- a/data/committee/msgp_gen_test.go +++ b/data/committee/msgp_gen_test.go @@ -7,9 +7,10 @@ package committee import ( "testing" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalCredential(t *testing.T) { diff --git a/data/hashable/msgp_gen_test.go b/data/hashable/msgp_gen_test.go index 131eaebe03..b7cf0519c1 100644 --- a/data/hashable/msgp_gen_test.go +++ b/data/hashable/msgp_gen_test.go @@ -7,9 +7,10 @@ package hashable import ( "testing" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalMessage(t *testing.T) { diff --git a/data/transactions/logic/backwardCompat_test.go b/data/transactions/logic/backwardCompat_test.go index b5917219df..986c71d478 100644 --- a/data/transactions/logic/backwardCompat_test.go +++ b/data/transactions/logic/backwardCompat_test.go @@ -22,10 +22,11 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) // This test ensures a program compiled with by pre-TEAL v2 go-algorand diff --git a/data/transactions/logic/debugger_test.go b/data/transactions/logic/debugger_test.go index 80e4a639af..6e906c4cab 100644 --- a/data/transactions/logic/debugger_test.go +++ b/data/transactions/logic/debugger_test.go @@ -21,9 +21,10 @@ import ( "os" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) var testProgram string = `intcblock 0 1 1 1 1 5 100 diff --git a/data/transactions/logic/doc_test.go b/data/transactions/logic/doc_test.go index 85b97aaad1..5b5a4a21af 100644 --- a/data/transactions/logic/doc_test.go +++ b/data/transactions/logic/doc_test.go @@ -20,9 +20,10 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestOpDocs(t *testing.T) { diff --git a/data/transactions/logic/evalAppTxn_test.go b/data/transactions/logic/evalAppTxn_test.go index cb1a16408d..0f27561529 100644 --- a/data/transactions/logic/evalAppTxn_test.go +++ b/data/transactions/logic/evalAppTxn_test.go @@ -22,14 +22,14 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/transactions" . "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/data/txntest" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - - "github.com/stretchr/testify/require" ) func TestInnerTypesV5(t *testing.T) { diff --git a/data/transactions/logic/opcodes_test.go b/data/transactions/logic/opcodes_test.go index 955662cedf..af5240f2eb 100644 --- a/data/transactions/logic/opcodes_test.go +++ b/data/transactions/logic/opcodes_test.go @@ -21,8 +21,9 @@ import ( "reflect" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestOpSpecs(t *testing.T) { diff --git a/data/transactions/msgp_gen.go b/data/transactions/msgp_gen.go index 381c032c27..299d4da243 100644 --- a/data/transactions/msgp_gen.go +++ b/data/transactions/msgp_gen.go @@ -5,10 +5,11 @@ package transactions import ( "sort" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" - "github.com/algorand/msgp/msgp" ) // The following msgp objects are implemented in this file: diff --git a/data/transactions/msgp_gen_test.go b/data/transactions/msgp_gen_test.go index d92a29cf8f..2363050ad3 100644 --- a/data/transactions/msgp_gen_test.go +++ b/data/transactions/msgp_gen_test.go @@ -7,9 +7,10 @@ package transactions import ( "testing" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalApplicationCallTxnFields(t *testing.T) { diff --git a/data/transactions/payset_test.go b/data/transactions/payset_test.go index 9446f45b61..06de928a7d 100644 --- a/data/transactions/payset_test.go +++ b/data/transactions/payset_test.go @@ -19,8 +19,9 @@ package transactions import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func preparePayset(txnCount, acctCount int) Payset { diff --git a/data/transactions/teal_test.go b/data/transactions/teal_test.go index 9900368953..d9287f50f0 100644 --- a/data/transactions/teal_test.go +++ b/data/transactions/teal_test.go @@ -20,10 +20,11 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) func TestEvalDeltaEqual(t *testing.T) { diff --git a/data/transactions/transaction_test.go b/data/transactions/transaction_test.go index 5a7321c698..ce62b0054c 100644 --- a/data/transactions/transaction_test.go +++ b/data/transactions/transaction_test.go @@ -22,14 +22,14 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/crypto/merklesignature" + "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" + "github.com/algorand/go-algorand/crypto/merklesignature" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) func TestTransaction_EstimateEncodedSize(t *testing.T) { diff --git a/gen/generate_test.go b/gen/generate_test.go index 0d377a2b64..8dd4597637 100644 --- a/gen/generate_test.go +++ b/gen/generate_test.go @@ -25,13 +25,13 @@ import ( "sync" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/data/account" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/util/db" - "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/util/db" ) func TestLoadMultiRootKeyConcurrent(t *testing.T) { diff --git a/ledger/bulletin_test.go b/ledger/bulletin_test.go index a3d5ae1f90..48e100c839 100644 --- a/ledger/bulletin_test.go +++ b/ledger/bulletin_test.go @@ -17,9 +17,10 @@ package ledger import ( - "github.com/algorand/go-algorand/test/partitiontest" "testing" "time" + + "github.com/algorand/go-algorand/test/partitiontest" ) const epsilon = 5 * time.Millisecond diff --git a/ledger/catchpointtracker_test.go b/ledger/catchpointtracker_test.go index 4b7bcb545e..8012e9c3f7 100644 --- a/ledger/catchpointtracker_test.go +++ b/ledger/catchpointtracker_test.go @@ -25,7 +25,6 @@ import ( "path" "path/filepath" "runtime" - "sync/atomic" "testing" "time" diff --git a/ledger/evalbench_test.go b/ledger/evalbench_test.go index e80aa91470..b1e634a8ff 100644 --- a/ledger/evalbench_test.go +++ b/ledger/evalbench_test.go @@ -27,9 +27,10 @@ import ( "testing" "time" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" diff --git a/ledger/ledger_perf_test.go b/ledger/ledger_perf_test.go index 133386f9eb..e1b90535b2 100644 --- a/ledger/ledger_perf_test.go +++ b/ledger/ledger_perf_test.go @@ -26,9 +26,10 @@ import ( "strings" "testing" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" diff --git a/ledger/ledger_test.go b/ledger/ledger_test.go index 3b39564490..adc2bbde24 100644 --- a/ledger/ledger_test.go +++ b/ledger/ledger_test.go @@ -25,14 +25,12 @@ import ( "runtime/pprof" "testing" - "github.com/algorand/go-algorand/data/account" - "github.com/algorand/go-algorand/util/db" - "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" + "github.com/algorand/go-algorand/data/account" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/data/transactions" @@ -43,6 +41,7 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" + "github.com/algorand/go-algorand/util/db" "github.com/algorand/go-algorand/util/execpool" ) diff --git a/ledger/ledgercore/msgp_gen_test.go b/ledger/ledgercore/msgp_gen_test.go index 99ad64e4de..1be24b7f0f 100644 --- a/ledger/ledgercore/msgp_gen_test.go +++ b/ledger/ledgercore/msgp_gen_test.go @@ -7,9 +7,10 @@ package ledgercore import ( "testing" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalAccountTotals(t *testing.T) { diff --git a/ledger/msgp_gen.go b/ledger/msgp_gen.go index 5e0a025671..31c0c8224b 100644 --- a/ledger/msgp_gen.go +++ b/ledger/msgp_gen.go @@ -5,9 +5,10 @@ package ledger import ( "sort" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/data/basics" - "github.com/algorand/msgp/msgp" ) // The following msgp objects are implemented in this file: diff --git a/ledger/msgp_gen_test.go b/ledger/msgp_gen_test.go index 92b54bc521..d613a94167 100644 --- a/ledger/msgp_gen_test.go +++ b/ledger/msgp_gen_test.go @@ -7,9 +7,10 @@ package ledger import ( "testing" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalCatchpointFileHeader(t *testing.T) { diff --git a/ledger/perf_test.go b/ledger/perf_test.go index 53cc2cb494..7850c012e8 100644 --- a/ledger/perf_test.go +++ b/ledger/perf_test.go @@ -21,9 +21,10 @@ import ( "fmt" "testing" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" diff --git a/ledger/testing/randomAccounts.go b/ledger/testing/randomAccounts.go index 6cbc7cbcea..45d0c6b0de 100644 --- a/ledger/testing/randomAccounts.go +++ b/ledger/testing/randomAccounts.go @@ -22,11 +22,8 @@ import ( "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" - "github.com/algorand/go-algorand/protocol" - - //"github.com/algorand/go-algorand/data/bookkeeping" - "github.com/algorand/go-algorand/ledger/ledgercore" + "github.com/algorand/go-algorand/protocol" ) var testPoolAddr = basics.Address{0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff} diff --git a/ledger/tracker.go b/ledger/tracker.go index ece28a79ee..1e6fdcf3cb 100644 --- a/ledger/tracker.go +++ b/ledger/tracker.go @@ -25,6 +25,8 @@ import ( "sync" "time" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" @@ -34,7 +36,6 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/logging/telemetryspec" "github.com/algorand/go-algorand/util/db" - "github.com/algorand/go-deadlock" ) // ledgerTracker defines part of the API for any state machine that diff --git a/libgoal/libgoal.go b/libgoal/libgoal.go index a0107ba77d..bc09cfda23 100644 --- a/libgoal/libgoal.go +++ b/libgoal/libgoal.go @@ -23,24 +23,23 @@ import ( "os" "path/filepath" - algodclient "github.com/algorand/go-algorand/daemon/algod/api/client" - v2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2" - generatedV2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" - kmdclient "github.com/algorand/go-algorand/daemon/kmd/client" - "github.com/algorand/go-algorand/rpcs" - "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" + algodclient "github.com/algorand/go-algorand/daemon/algod/api/client" + v2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2" "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" + generatedV2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" "github.com/algorand/go-algorand/daemon/algod/api/spec/common" v1 "github.com/algorand/go-algorand/daemon/algod/api/spec/v1" modelV2 "github.com/algorand/go-algorand/daemon/algod/api/spec/v2" + kmdclient "github.com/algorand/go-algorand/daemon/kmd/client" "github.com/algorand/go-algorand/daemon/kmd/lib/kmdapi" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/nodecontrol" "github.com/algorand/go-algorand/protocol" + "github.com/algorand/go-algorand/rpcs" "github.com/algorand/go-algorand/util" ) diff --git a/libgoal/libgoal_test.go b/libgoal/libgoal_test.go index 96c524ef45..9e0123f550 100644 --- a/libgoal/libgoal_test.go +++ b/libgoal/libgoal_test.go @@ -19,8 +19,9 @@ package libgoal import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestValidRounds(t *testing.T) { diff --git a/logging/cyclicWriter_test.go b/logging/cyclicWriter_test.go index d1eaa43b0b..c5ca8c9f3b 100644 --- a/logging/cyclicWriter_test.go +++ b/logging/cyclicWriter_test.go @@ -21,8 +21,9 @@ import ( "os" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestCyclicWrite(t *testing.T) { diff --git a/logging/logBuffer_test.go b/logging/logBuffer_test.go index b2f8dc1e18..85b06ef411 100644 --- a/logging/logBuffer_test.go +++ b/logging/logBuffer_test.go @@ -22,8 +22,9 @@ import ( "io" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) type logBufferTestFixture struct { diff --git a/logging/log_test.go b/logging/log_test.go index 2f4365ccb6..c162694a37 100644 --- a/logging/log_test.go +++ b/logging/log_test.go @@ -21,8 +21,9 @@ import ( "encoding/json" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) /* diff --git a/logging/telemetryCommon.go b/logging/telemetryCommon.go index d4d57a817d..6dbbff1432 100644 --- a/logging/telemetryCommon.go +++ b/logging/telemetryCommon.go @@ -20,9 +20,10 @@ import ( "sync" "time" - "github.com/algorand/go-deadlock" "github.com/sirupsen/logrus" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/logging/telemetryspec" ) diff --git a/logging/telemetryConfig_test.go b/logging/telemetryConfig_test.go index e0522a3043..f91c42c534 100644 --- a/logging/telemetryConfig_test.go +++ b/logging/telemetryConfig_test.go @@ -23,8 +23,9 @@ import ( "path/filepath" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func Test_loadTelemetryConfig(t *testing.T) { diff --git a/logging/telemetryspec/metric_test.go b/logging/telemetryspec/metric_test.go index 4b470c1c56..f0eb8c669e 100644 --- a/logging/telemetryspec/metric_test.go +++ b/logging/telemetryspec/metric_test.go @@ -21,8 +21,9 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestTransactionProcessingTimeDistibutionFormatting(t *testing.T) { diff --git a/netdeploy/network.go b/netdeploy/network.go index 007d909859..f3b8573917 100644 --- a/netdeploy/network.go +++ b/netdeploy/network.go @@ -26,9 +26,8 @@ import ( "strings" "time" - generatedV2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" - "github.com/algorand/go-algorand/config" + generatedV2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" "github.com/algorand/go-algorand/gen" "github.com/algorand/go-algorand/libgoal" "github.com/algorand/go-algorand/nodecontrol" diff --git a/netdeploy/remote/bootstrappedNetwork_test.go b/netdeploy/remote/bootstrappedNetwork_test.go index 1c9f14e6e3..d6a085c55b 100644 --- a/netdeploy/remote/bootstrappedNetwork_test.go +++ b/netdeploy/remote/bootstrappedNetwork_test.go @@ -20,8 +20,9 @@ import ( "path/filepath" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestLoadBootstrappedData(t *testing.T) { diff --git a/network/phonebook_test.go b/network/phonebook_test.go index b1d6c35f4b..3cf0197ac6 100644 --- a/network/phonebook_test.go +++ b/network/phonebook_test.go @@ -23,9 +23,10 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func testPhonebookAll(t *testing.T, set []string, ph Phonebook) { diff --git a/network/topics_test.go b/network/topics_test.go index 07b29d09e7..715c611859 100644 --- a/network/topics_test.go +++ b/network/topics_test.go @@ -21,8 +21,9 @@ import ( "fmt" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) // Test the marshall/unmarshall of Topics diff --git a/network/wsNetwork.go b/network/wsNetwork.go index 8bde3040d3..36786b4fdb 100644 --- a/network/wsNetwork.go +++ b/network/wsNetwork.go @@ -36,9 +36,10 @@ import ( "sync/atomic" "time" + "github.com/gorilla/mux" + "github.com/algorand/go-deadlock" "github.com/algorand/websocket" - "github.com/gorilla/mux" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" diff --git a/network/wsPeer_test.go b/network/wsPeer_test.go index 60a0e3a799..fb70b95a07 100644 --- a/network/wsPeer_test.go +++ b/network/wsPeer_test.go @@ -22,8 +22,9 @@ import ( "time" "unsafe" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestCheckSlowWritingPeer(t *testing.T) { diff --git a/node/msgp_gen_test.go b/node/msgp_gen_test.go index e72b128ee6..d7aa668b27 100644 --- a/node/msgp_gen_test.go +++ b/node/msgp_gen_test.go @@ -7,9 +7,10 @@ package node import ( "testing" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalnetPrioResponse(t *testing.T) { diff --git a/node/node.go b/node/node.go index a1b095084f..64f30b2aad 100644 --- a/node/node.go +++ b/node/node.go @@ -28,6 +28,8 @@ import ( "sync" "time" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/agreement/gossip" "github.com/algorand/go-algorand/catchup" @@ -54,7 +56,6 @@ import ( "github.com/algorand/go-algorand/util/execpool" "github.com/algorand/go-algorand/util/metrics" "github.com/algorand/go-algorand/util/timers" - "github.com/algorand/go-deadlock" ) // StatusReport represents the current basic status of the node diff --git a/nodecontrol/algodControl_test.go b/nodecontrol/algodControl_test.go index 80c231ba79..80f00423b8 100644 --- a/nodecontrol/algodControl_test.go +++ b/nodecontrol/algodControl_test.go @@ -20,8 +20,9 @@ import ( "errors" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestStopAlgodErrorNotRunning(t *testing.T) { diff --git a/protocol/codec_test.go b/protocol/codec_test.go index 79814dadc6..dda8016f81 100644 --- a/protocol/codec_test.go +++ b/protocol/codec_test.go @@ -20,9 +20,11 @@ import ( "reflect" "testing" - "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/go-codec/codec" "github.com/stretchr/testify/require" + + "github.com/algorand/go-codec/codec" + + "github.com/algorand/go-algorand/test/partitiontest" ) type TestArray [4]uint64 diff --git a/protocol/codec_tester.go b/protocol/codec_tester.go index 694c2c492c..45a2b17663 100644 --- a/protocol/codec_tester.go +++ b/protocol/codec_tester.go @@ -29,12 +29,12 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/test/partitiontest" + "github.com/stretchr/testify/require" "github.com/algorand/go-deadlock" - "github.com/algorand/msgp/msgp" - "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) const debugCodecTester = false diff --git a/protocol/test/msgp_gen_test.go b/protocol/test/msgp_gen_test.go index d87b778e07..b00dbeb571 100644 --- a/protocol/test/msgp_gen_test.go +++ b/protocol/test/msgp_gen_test.go @@ -7,9 +7,10 @@ package test import ( "testing" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshaltestSlice(t *testing.T) { diff --git a/rpcs/blockService.go b/rpcs/blockService.go index 25fd161434..3236afb878 100644 --- a/rpcs/blockService.go +++ b/rpcs/blockService.go @@ -29,7 +29,6 @@ import ( "github.com/gorilla/mux" "github.com/algorand/go-codec/codec" - "github.com/algorand/go-deadlock" "github.com/algorand/go-algorand/agreement" diff --git a/rpcs/msgp_gen_test.go b/rpcs/msgp_gen_test.go index 46ec99aaf3..81f567ee18 100644 --- a/rpcs/msgp_gen_test.go +++ b/rpcs/msgp_gen_test.go @@ -7,9 +7,10 @@ package rpcs import ( "testing" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/msgp/msgp" ) func TestMarshalUnmarshalEncodedBlockCert(t *testing.T) { diff --git a/test/commandandcontrol/cc_agent/component/agent_test.go b/test/commandandcontrol/cc_agent/component/agent_test.go index 7ca805eb7f..86f50451a7 100644 --- a/test/commandandcontrol/cc_agent/component/agent_test.go +++ b/test/commandandcontrol/cc_agent/component/agent_test.go @@ -19,8 +19,9 @@ package component import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/assert" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestCommandStatus(t *testing.T) { diff --git a/test/e2e-go/cli/tealdbg/cdtmock/main.go b/test/e2e-go/cli/tealdbg/cdtmock/main.go index 9cb3cf0724..455d6d6aad 100644 --- a/test/e2e-go/cli/tealdbg/cdtmock/main.go +++ b/test/e2e-go/cli/tealdbg/cdtmock/main.go @@ -18,7 +18,6 @@ package main import ( "fmt" - "net/http" "os" "strings" diff --git a/test/e2e-go/features/catchup/catchpointCatchup_test.go b/test/e2e-go/features/catchup/catchpointCatchup_test.go index f1eb14b4e9..a1cc28ef6d 100644 --- a/test/e2e-go/features/catchup/catchpointCatchup_test.go +++ b/test/e2e-go/features/catchup/catchpointCatchup_test.go @@ -26,9 +26,10 @@ import ( "testing" "time" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" algodclient "github.com/algorand/go-algorand/daemon/algod/api/client" "github.com/algorand/go-algorand/logging" diff --git a/test/e2e-go/features/multisig/multisig_test.go b/test/e2e-go/features/multisig/multisig_test.go index 07c8f96618..3a2db63a21 100644 --- a/test/e2e-go/features/multisig/multisig_test.go +++ b/test/e2e-go/features/multisig/multisig_test.go @@ -20,11 +20,12 @@ import ( "path/filepath" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/test/framework/fixtures" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) // create a 2 out of 3 multisig address diff --git a/test/e2e-go/features/transactions/proof_test.go b/test/e2e-go/features/transactions/proof_test.go index 118e725f74..06729d479e 100644 --- a/test/e2e-go/features/transactions/proof_test.go +++ b/test/e2e-go/features/transactions/proof_test.go @@ -20,12 +20,13 @@ import ( "path/filepath" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/crypto/merklearray" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/framework/fixtures" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) // TxnMerkleElemRaw this struct helps creates a hashable struct from the bytes diff --git a/test/e2e-go/perf/basic_test.go b/test/e2e-go/perf/basic_test.go index dd70d422d4..e271d60e82 100644 --- a/test/e2e-go/perf/basic_test.go +++ b/test/e2e-go/perf/basic_test.go @@ -26,10 +26,9 @@ import ( "github.com/stretchr/testify/require" - generatedV2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" - "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" + generatedV2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/libgoal" diff --git a/test/e2e-go/restAPI/restClient_test.go b/test/e2e-go/restAPI/restClient_test.go index dee64d399e..1167d1f4cd 100644 --- a/test/e2e-go/restAPI/restClient_test.go +++ b/test/e2e-go/restAPI/restClient_test.go @@ -21,7 +21,6 @@ import ( "encoding/hex" "errors" "flag" - "math" "math/rand" "os" diff --git a/test/e2e-go/upgrades/stateproof_test.go b/test/e2e-go/upgrades/stateproof_test.go index 6f9cf7f13d..ab20287afc 100644 --- a/test/e2e-go/upgrades/stateproof_test.go +++ b/test/e2e-go/upgrades/stateproof_test.go @@ -17,6 +17,13 @@ package upgrades import ( + "path/filepath" + "strings" + "testing" + "time" + + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" @@ -24,11 +31,6 @@ import ( "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/framework/fixtures" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" - "path/filepath" - "strings" - "testing" - "time" ) func waitUntilProtocolUpgrades(a *require.Assertions, fixture *fixtures.RestClientFixture, nodeClient libgoal.Client) { diff --git a/test/framework/fixtures/expectFixture.go b/test/framework/fixtures/expectFixture.go index 8d5bc9d5b1..9397a05beb 100644 --- a/test/framework/fixtures/expectFixture.go +++ b/test/framework/fixtures/expectFixture.go @@ -29,8 +29,9 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) // ExpectFixture is a wrapper for running expect tests diff --git a/test/framework/fixtures/libgoalFixture.go b/test/framework/fixtures/libgoalFixture.go index 38ddefbebd..7d0c39d1ad 100644 --- a/test/framework/fixtures/libgoalFixture.go +++ b/test/framework/fixtures/libgoalFixture.go @@ -27,9 +27,10 @@ import ( "testing" "time" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/data/account" "github.com/algorand/go-algorand/gen" diff --git a/tools/debug/logfilter/main_test.go b/tools/debug/logfilter/main_test.go index 9058f611c8..84298c3ecf 100644 --- a/tools/debug/logfilter/main_test.go +++ b/tools/debug/logfilter/main_test.go @@ -25,8 +25,9 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestLogFilterExamples(t *testing.T) { diff --git a/tools/network/dnssec/anchor_test.go b/tools/network/dnssec/anchor_test.go index cea0d2adbc..1017a0a52b 100644 --- a/tools/network/dnssec/anchor_test.go +++ b/tools/network/dnssec/anchor_test.go @@ -19,8 +19,9 @@ package dnssec import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestParseRootTrustAnchor(t *testing.T) { diff --git a/tools/network/dnssec/client_test.go b/tools/network/dnssec/client_test.go index 3bcc8f79d5..4e77412eef 100644 --- a/tools/network/dnssec/client_test.go +++ b/tools/network/dnssec/client_test.go @@ -21,9 +21,10 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/miekg/dns" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestEmptyClient(t *testing.T) { diff --git a/tools/network/dnssec/config_test.go b/tools/network/dnssec/config_test.go index 6115c7eef8..e7316dbb84 100644 --- a/tools/network/dnssec/config_test.go +++ b/tools/network/dnssec/config_test.go @@ -20,8 +20,9 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestConfigSystem(t *testing.T) { diff --git a/tools/network/dnssec/config_unix_test.go b/tools/network/dnssec/config_unix_test.go index c6699e67f8..0753a5d9e9 100644 --- a/tools/network/dnssec/config_unix_test.go +++ b/tools/network/dnssec/config_unix_test.go @@ -23,8 +23,9 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestConfigEmpty(t *testing.T) { diff --git a/tools/network/dnssec/dnssec_test.go b/tools/network/dnssec/dnssec_test.go index 4964990487..115b02e07c 100644 --- a/tools/network/dnssec/dnssec_test.go +++ b/tools/network/dnssec/dnssec_test.go @@ -22,10 +22,11 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/logging" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/miekg/dns" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/logging" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestLookup(t *testing.T) { diff --git a/tools/network/dnssec/sort_test.go b/tools/network/dnssec/sort_test.go index 3440e23030..f71c5e7f70 100644 --- a/tools/network/dnssec/sort_test.go +++ b/tools/network/dnssec/sort_test.go @@ -20,8 +20,9 @@ import ( "net" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestSrvSort(t *testing.T) { diff --git a/tools/network/dnssec/trustchain.go b/tools/network/dnssec/trustchain.go index 3cde9bea70..0bfd0aaaad 100644 --- a/tools/network/dnssec/trustchain.go +++ b/tools/network/dnssec/trustchain.go @@ -22,8 +22,9 @@ import ( "strings" "time" - "github.com/algorand/go-deadlock" "github.com/miekg/dns" + + "github.com/algorand/go-deadlock" ) // TrustQuerier wraps Querier and trusted root anchor retrieval for better testability diff --git a/tools/network/dnssec/trustedchain_test.go b/tools/network/dnssec/trustedchain_test.go index 2f671c007f..c420838fdc 100644 --- a/tools/network/dnssec/trustedchain_test.go +++ b/tools/network/dnssec/trustedchain_test.go @@ -22,9 +22,10 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/miekg/dns" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestTrustChainBasic(t *testing.T) { diff --git a/tools/network/dnssec/trustedzone_test.go b/tools/network/dnssec/trustedzone_test.go index 6d3bbaa043..2a614ca76a 100644 --- a/tools/network/dnssec/trustedzone_test.go +++ b/tools/network/dnssec/trustedzone_test.go @@ -21,9 +21,10 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/miekg/dns" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestTrustedZone(t *testing.T) { diff --git a/tools/network/dnssec/util_test.go b/tools/network/dnssec/util_test.go index d467d52c80..1df599a3ce 100644 --- a/tools/network/dnssec/util_test.go +++ b/tools/network/dnssec/util_test.go @@ -19,8 +19,9 @@ package dnssec import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestSplitZone(t *testing.T) { diff --git a/tools/network/resolver_test.go b/tools/network/resolver_test.go index 9e2de0af9c..0b7d364581 100644 --- a/tools/network/resolver_test.go +++ b/tools/network/resolver_test.go @@ -22,8 +22,9 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestResolver(t *testing.T) { diff --git a/util/codecs/json_test.go b/util/codecs/json_test.go index de35acf3cf..ca00f1be35 100644 --- a/util/codecs/json_test.go +++ b/util/codecs/json_test.go @@ -17,9 +17,11 @@ package codecs import ( - "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" "testing" + + "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) type testValue struct { diff --git a/util/condvar/timedwait_test.go b/util/condvar/timedwait_test.go index 20b8f70a4d..718bc9dfa1 100644 --- a/util/condvar/timedwait_test.go +++ b/util/condvar/timedwait_test.go @@ -23,8 +23,9 @@ import ( "github.com/stretchr/testify/require" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-deadlock" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestTimedWaitSignal(t *testing.T) { diff --git a/util/db/initialize_test.go b/util/db/initialize_test.go index d7b879d6ae..a27187a376 100644 --- a/util/db/initialize_test.go +++ b/util/db/initialize_test.go @@ -22,10 +22,10 @@ import ( "errors" "testing" - "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) // A few migrations functions to mix and match in tests. diff --git a/util/db/versioning_test.go b/util/db/versioning_test.go index fd2fecc23a..ad21d3713a 100644 --- a/util/db/versioning_test.go +++ b/util/db/versioning_test.go @@ -22,8 +22,9 @@ import ( "os" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func testVersioning(t *testing.T, inMemory bool) { diff --git a/util/metrics/counter_test.go b/util/metrics/counter_test.go index 43ef0c27aa..397e49429a 100644 --- a/util/metrics/counter_test.go +++ b/util/metrics/counter_test.go @@ -22,8 +22,9 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) type CounterTest struct { diff --git a/util/metrics/gauge_test.go b/util/metrics/gauge_test.go index 301ae22a74..65748e9404 100644 --- a/util/metrics/gauge_test.go +++ b/util/metrics/gauge_test.go @@ -23,8 +23,9 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) type GaugeTest struct { diff --git a/util/metrics/registry_test.go b/util/metrics/registry_test.go index 3c60f09d8d..76b5663ee0 100644 --- a/util/metrics/registry_test.go +++ b/util/metrics/registry_test.go @@ -22,8 +22,9 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestWriteAdd(t *testing.T) { diff --git a/util/metrics/reporter.go b/util/metrics/reporter.go index efecf6f659..577c7c69bc 100644 --- a/util/metrics/reporter.go +++ b/util/metrics/reporter.go @@ -26,8 +26,6 @@ import ( "regexp" "strings" "time" - // logging imports metrics so that we can have metrics about logging, which is more important than the four Debug lines we had here logging about metrics. TODO: find a more clever cycle resolution - //"github.com/algorand/go-algorand/logging" ) const ( diff --git a/util/metrics/reporter_test.go b/util/metrics/reporter_test.go index 7339c708db..51fc1ff4aa 100755 --- a/util/metrics/reporter_test.go +++ b/util/metrics/reporter_test.go @@ -19,8 +19,9 @@ package metrics import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestParseNodeExporterArgs(t *testing.T) { diff --git a/util/metrics/segment_test.go b/util/metrics/segment_test.go index c5cae321d9..75cd9bbce9 100644 --- a/util/metrics/segment_test.go +++ b/util/metrics/segment_test.go @@ -24,8 +24,9 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) type SegmentTest struct { diff --git a/util/metrics/stringGauge_test.go b/util/metrics/stringGauge_test.go index 97296ba5c1..8bf10918ac 100644 --- a/util/metrics/stringGauge_test.go +++ b/util/metrics/stringGauge_test.go @@ -20,8 +20,9 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func hasKey(data map[string]string, key string) bool { diff --git a/util/metrics/tagcounter_test.go b/util/metrics/tagcounter_test.go index a2f8a87a0b..7eb46426b2 100644 --- a/util/metrics/tagcounter_test.go +++ b/util/metrics/tagcounter_test.go @@ -22,8 +22,9 @@ import ( "sync" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestTagCounter(t *testing.T) { diff --git a/util/s3/s3Helper_test.go b/util/s3/s3Helper_test.go index 6c46095015..7a285eb6e0 100644 --- a/util/s3/s3Helper_test.go +++ b/util/s3/s3Helper_test.go @@ -21,8 +21,9 @@ import ( "reflect" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestGetS3UploadBucket(t *testing.T) { diff --git a/util/timers/monotonic_test.go b/util/timers/monotonic_test.go index b9fecdbdbb..fe29cf0cb2 100644 --- a/util/timers/monotonic_test.go +++ b/util/timers/monotonic_test.go @@ -17,10 +17,11 @@ package timers import ( - "github.com/algorand/go-algorand/test/partitiontest" "math/rand" "testing" "time" + + "github.com/algorand/go-algorand/test/partitiontest" ) func polled(ch <-chan time.Time) bool { From 06f16c76fd2f2b66c2f55cc435c928515572c6cf Mon Sep 17 00:00:00 2001 From: chris erway Date: Wed, 9 Mar 2022 09:41:41 -0500 Subject: [PATCH 3/6] fix non-deterministic import order due to importing same package twice --- .../algod/api/server/v2/test/handlers_test.go | 19 +++++++++---------- libgoal/libgoal.go | 7 +++---- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/daemon/algod/api/server/v2/test/handlers_test.go b/daemon/algod/api/server/v2/test/handlers_test.go index e4cba34ac1..3a217bcf91 100644 --- a/daemon/algod/api/server/v2/test/handlers_test.go +++ b/daemon/algod/api/server/v2/test/handlers_test.go @@ -35,7 +35,6 @@ import ( "github.com/algorand/go-algorand/crypto/merklesignature" v2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2" generatedV2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" - "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" "github.com/algorand/go-algorand/data" "github.com/algorand/go-algorand/data/account" "github.com/algorand/go-algorand/data/basics" @@ -334,7 +333,7 @@ func getPendingTransactionsTest(t *testing.T, format string, max uint64, expecte func TestPendingTransactionLogsEncoding(t *testing.T) { partitiontest.PartitionTest(t) - response := generated.PendingTransactionResponse{ + response := generatedV2.PendingTransactionResponse{ Logs: &[][]byte{ {}, []byte(string("a")), @@ -604,7 +603,7 @@ func TestTealDryrun(t *testing.T) { partitiontest.PartitionTest(t) t.Parallel() - var gdr generated.DryrunRequest + var gdr generatedV2.DryrunRequest txns := []transactions.SignedTxn{ { Txn: transactions.Transaction{ @@ -631,24 +630,24 @@ func TestTealDryrun(t *testing.T) { failOps, err := logic.AssembleStringWithVersion("int 0", 2) require.NoError(t, err) - gdr.Apps = []generated.Application{ + gdr.Apps = []generatedV2.Application{ { Id: 1, - Params: generated.ApplicationParams{ + Params: generatedV2.ApplicationParams{ ApprovalProgram: sucOps.Program, }, }, } - localv := make(generated.TealKeyValueStore, 1) - localv[0] = generated.TealKeyValue{ + localv := make(generatedV2.TealKeyValueStore, 1) + localv[0] = generatedV2.TealKeyValue{ Key: "foo", - Value: generated.TealValue{Type: uint64(basics.TealBytesType), Bytes: "bar"}, + Value: generatedV2.TealValue{Type: uint64(basics.TealBytesType), Bytes: "bar"}, } - gdr.Accounts = []generated.Account{ + gdr.Accounts = []generatedV2.Account{ { Address: basics.Address{}.String(), - AppsLocalState: &[]generated.ApplicationLocalState{{ + AppsLocalState: &[]generatedV2.ApplicationLocalState{{ Id: 1, KeyValue: &localv, }}, diff --git a/libgoal/libgoal.go b/libgoal/libgoal.go index bc09cfda23..68e29e16a5 100644 --- a/libgoal/libgoal.go +++ b/libgoal/libgoal.go @@ -27,7 +27,6 @@ import ( "github.com/algorand/go-algorand/crypto" algodclient "github.com/algorand/go-algorand/daemon/algod/api/client" v2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2" - "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" generatedV2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated" "github.com/algorand/go-algorand/daemon/algod/api/spec/common" v1 "github.com/algorand/go-algorand/daemon/algod/api/spec/v1" @@ -939,7 +938,7 @@ func (c *Client) GetPendingTransactionsByAddress(addr string, maxTxns uint64) (r // AddParticipationKey takes a participation key file and sends it to the node. // The key will be loaded into the system when the function returns successfully. -func (c *Client) AddParticipationKey(keyfile string) (resp generated.PostParticipationResponse, err error) { +func (c *Client) AddParticipationKey(keyfile string) (resp generatedV2.PostParticipationResponse, err error) { data, err := ioutil.ReadFile(keyfile) if err != nil { return @@ -954,7 +953,7 @@ func (c *Client) AddParticipationKey(keyfile string) (resp generated.PostPartici } // GetParticipationKeys gets the currently installed participation keys. -func (c *Client) GetParticipationKeys() (resp generated.ParticipationKeysResponse, err error) { +func (c *Client) GetParticipationKeys() (resp generatedV2.ParticipationKeysResponse, err error) { algod, err := c.ensureAlgodClient() if err == nil { return algod.GetParticipationKeys() @@ -963,7 +962,7 @@ func (c *Client) GetParticipationKeys() (resp generated.ParticipationKeysRespons } // GetParticipationKeyByID looks up a specific participation key by its participationID. -func (c *Client) GetParticipationKeyByID(id string) (resp generated.ParticipationKeyResponse, err error) { +func (c *Client) GetParticipationKeyByID(id string) (resp generatedV2.ParticipationKeyResponse, err error) { algod, err := c.ensureAlgodClient() if err == nil { return algod.GetParticipationKeyByID(id) From 1c10968746b7b8749b195447dfc283b6bd17511e Mon Sep 17 00:00:00 2001 From: chris erway Date: Thu, 17 Mar 2022 11:09:46 -0400 Subject: [PATCH 4/6] try adding severity rules to force error --- .golangci.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.golangci.yml b/.golangci.yml index e6de634ab3..7d7541f312 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -26,6 +26,16 @@ linters-settings: severity: default-severity: error + rules: + - linters: + - errcheck + - gofmt + - golint + - govet + - ineffassign + - misspell + - gci + severity: error issues: # use these new lint checks on code since #2574 From 334fe0c9183e78f2a4979b09b4e68ab442a1d6ac Mon Sep 17 00:00:00 2001 From: chris erway Date: Wed, 11 May 2022 15:21:59 -0400 Subject: [PATCH 5/6] rerun gci --- daemon/algod/api/server/v2/generated/private/routes.go | 8 +++----- daemon/algod/api/server/v2/generated/routes.go | 8 +++----- data/transactions/logic/jsonspec_test.go | 3 ++- data/transactions/logic/sourcemap_test.go | 3 ++- ledger/internal/double_test.go | 3 ++- ledger/internal/prefetcher/prefetcher_alignment_test.go | 3 ++- ledger/internal/txnbench_test.go | 3 ++- test/e2e-go/features/accountPerf/sixMillion_test.go | 3 ++- util/metrics/metrics_test.go | 3 ++- 9 files changed, 20 insertions(+), 17 deletions(-) diff --git a/daemon/algod/api/server/v2/generated/private/routes.go b/daemon/algod/api/server/v2/generated/private/routes.go index 8364397b09..e37b754895 100644 --- a/daemon/algod/api/server/v2/generated/private/routes.go +++ b/daemon/algod/api/server/v2/generated/private/routes.go @@ -8,13 +8,11 @@ import ( "compress/gzip" "encoding/base64" "fmt" - "net/http" - "strings" - + "github.com/algorand/oapi-codegen/pkg/runtime" "github.com/getkin/kin-openapi/openapi3" "github.com/labstack/echo/v4" - - "github.com/algorand/oapi-codegen/pkg/runtime" + "net/http" + "strings" ) // ServerInterface represents all server handlers. diff --git a/daemon/algod/api/server/v2/generated/routes.go b/daemon/algod/api/server/v2/generated/routes.go index 96fe3cc867..b819ded7db 100644 --- a/daemon/algod/api/server/v2/generated/routes.go +++ b/daemon/algod/api/server/v2/generated/routes.go @@ -8,13 +8,11 @@ import ( "compress/gzip" "encoding/base64" "fmt" - "net/http" - "strings" - + "github.com/algorand/oapi-codegen/pkg/runtime" "github.com/getkin/kin-openapi/openapi3" "github.com/labstack/echo/v4" - - "github.com/algorand/oapi-codegen/pkg/runtime" + "net/http" + "strings" ) // ServerInterface represents all server handlers. diff --git a/data/transactions/logic/jsonspec_test.go b/data/transactions/logic/jsonspec_test.go index 7ab173a0f3..9d75d9a63f 100644 --- a/data/transactions/logic/jsonspec_test.go +++ b/data/transactions/logic/jsonspec_test.go @@ -22,10 +22,11 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" "golang.org/x/text/encoding/unicode" "golang.org/x/text/encoding/unicode/utf32" + + "github.com/algorand/go-algorand/test/partitiontest" ) // As of go1.10, json implements encoding and decoding of JSON as defined in RFC 7159. https://pkg.go.dev/encoding/json diff --git a/data/transactions/logic/sourcemap_test.go b/data/transactions/logic/sourcemap_test.go index 718535ec44..f58ccdb7b8 100644 --- a/data/transactions/logic/sourcemap_test.go +++ b/data/transactions/logic/sourcemap_test.go @@ -20,8 +20,9 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestGetSourceMap(t *testing.T) { diff --git a/ledger/internal/double_test.go b/ledger/internal/double_test.go index 84f1f092b7..6b081b2de3 100644 --- a/ledger/internal/double_test.go +++ b/ledger/internal/double_test.go @@ -19,6 +19,8 @@ package internal_test import ( "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/data/txntest" @@ -26,7 +28,6 @@ import ( "github.com/algorand/go-algorand/ledger/internal" "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/protocol" - "github.com/stretchr/testify/require" ) // DoubleLedger allows for easy "Double Entry bookkeeping" as a way to write diff --git a/ledger/internal/prefetcher/prefetcher_alignment_test.go b/ledger/internal/prefetcher/prefetcher_alignment_test.go index ba14fbe03f..24fb0582db 100644 --- a/ledger/internal/prefetcher/prefetcher_alignment_test.go +++ b/ledger/internal/prefetcher/prefetcher_alignment_test.go @@ -23,6 +23,8 @@ import ( "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/crypto/merklesignature" @@ -34,7 +36,6 @@ import ( "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/go-deadlock" ) type creatable struct { diff --git a/ledger/internal/txnbench_test.go b/ledger/internal/txnbench_test.go index 9c92c896cb..cdafa57428 100644 --- a/ledger/internal/txnbench_test.go +++ b/ledger/internal/txnbench_test.go @@ -22,12 +22,13 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/data/txntest" "github.com/algorand/go-algorand/ledger/ledgercore" ledgertesting "github.com/algorand/go-algorand/ledger/testing" - "github.com/stretchr/testify/require" ) // BenchmarkTxnTypes compares the execution time of various txn types diff --git a/test/e2e-go/features/accountPerf/sixMillion_test.go b/test/e2e-go/features/accountPerf/sixMillion_test.go index 679d2728a2..fe4b6646d0 100644 --- a/test/e2e-go/features/accountPerf/sixMillion_test.go +++ b/test/e2e-go/features/accountPerf/sixMillion_test.go @@ -29,9 +29,10 @@ import ( "testing" "time" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/require" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" clientApi "github.com/algorand/go-algorand/daemon/algod/api/client" diff --git a/util/metrics/metrics_test.go b/util/metrics/metrics_test.go index 03369c7a1b..013abc21d0 100644 --- a/util/metrics/metrics_test.go +++ b/util/metrics/metrics_test.go @@ -25,8 +25,9 @@ import ( "testing" "time" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/require" + + "github.com/algorand/go-deadlock" ) type MetricTest struct { From b0133ce55c4b9f1799924d0d989a5200ed5816cf Mon Sep 17 00:00:00 2001 From: chris erway Date: Wed, 11 May 2022 15:24:20 -0400 Subject: [PATCH 6/6] Add make gci target --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index f55089890c..69eb22bf93 100644 --- a/Makefile +++ b/Makefile @@ -121,6 +121,9 @@ generate: deps msgp: $(patsubst %,%/msgp_gen.go,$(MSGP_GENERATE)) +gci: + find . -name \*.go -not -path "*/generated/*" -print0 | xargs -0 -n 100 gci write -s Standard -s Default -s "Prefix(github.com/algorand)" -s "Prefix(github.com/algorand/go-algorand)" + %/msgp_gen.go: deps ALWAYS @set +e; \ printf "msgp: $(@D)..."; \