diff --git a/.golangci.yml b/.golangci.yml index 551341b0f9..3a78da6408 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -164,7 +164,15 @@ severity: formatters: enable: + - gci - gofmt + settings: + gci: + sections: + - standard + - default + - prefix(github.com/algorand) + - prefix(github.com/algorand/go-algorand) exclusions: generated: lax paths: diff --git a/agreement/credentialArrivalHistory_test.go b/agreement/credentialArrivalHistory_test.go index 915b7f1079..30a9bbb556 100644 --- a/agreement/credentialArrivalHistory_test.go +++ b/agreement/credentialArrivalHistory_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 TestCredentialHistoryStore(t *testing.T) { diff --git a/agreement/dynamicFilterTimeoutParams_test.go b/agreement/dynamicFilterTimeoutParams_test.go index 0a5af5e8dd..7b658aecda 100644 --- a/agreement/dynamicFilterTimeoutParams_test.go +++ b/agreement/dynamicFilterTimeoutParams_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 TestSampleIndexIsValid(t *testing.T) { diff --git a/agreement/events_test.go b/agreement/events_test.go index 8bdaf93004..d829f9c9fd 100644 --- a/agreement/events_test.go +++ b/agreement/events_test.go @@ -20,9 +20,10 @@ import ( "encoding/base64" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) // TestSerializableErrorBackwardCompatibility ensures Err field of type serializableError can be diff --git a/agreement/fuzzer/tests_test.go b/agreement/fuzzer/tests_test.go index 098dfa7df2..ac1d401e37 100644 --- a/agreement/fuzzer/tests_test.go +++ b/agreement/fuzzer/tests_test.go @@ -24,7 +24,6 @@ import ( "math" "math/rand" "os" - //ossignal "os/signal" "path/filepath" //"runtime/pprof" @@ -34,9 +33,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/proposalTracker_test.go b/agreement/proposalTracker_test.go index 9cd9f07f70..5cfa4a3fe5 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/sort_test.go b/agreement/sort_test.go index 87ac1594ff..83c7abb657 100644 --- a/agreement/sort_test.go +++ b/agreement/sort_test.go @@ -19,10 +19,11 @@ package agreement import ( "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" ) func TestSortProposalValueLess(t *testing.T) { diff --git a/catchup/classBasedPeerSelector.go b/catchup/classBasedPeerSelector.go index 3596f7c7f0..5506e45adc 100644 --- a/catchup/classBasedPeerSelector.go +++ b/catchup/classBasedPeerSelector.go @@ -20,8 +20,9 @@ import ( "errors" "time" - "github.com/algorand/go-algorand/network" "github.com/algorand/go-deadlock" + + "github.com/algorand/go-algorand/network" ) // classBasedPeerSelector is a rankPooledPeerSelector that tracks and ranks classes of peers based on their response behavior. diff --git a/catchup/classBasedPeerSelector_test.go b/catchup/classBasedPeerSelector_test.go index ff1470f0c6..ce7ce89f06 100644 --- a/catchup/classBasedPeerSelector_test.go +++ b/catchup/classBasedPeerSelector_test.go @@ -20,9 +20,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/network" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) // Use to mock the wrapped peer selectors where warranted diff --git a/cmd/algocfg/main.go b/cmd/algocfg/main.go index f503514703..5e2be37ad7 100644 --- a/cmd/algocfg/main.go +++ b/cmd/algocfg/main.go @@ -20,8 +20,9 @@ import ( "fmt" "os" - "github.com/algorand/go-algorand/cmd/util/datadir" "github.com/spf13/cobra" + + "github.com/algorand/go-algorand/cmd/util/datadir" ) func init() { diff --git a/cmd/algocfg/profileCommand_test.go b/cmd/algocfg/profileCommand_test.go index e9914279b7..4d53588c4e 100644 --- a/cmd/algocfg/profileCommand_test.go +++ b/cmd/algocfg/profileCommand_test.go @@ -19,10 +19,9 @@ package main import ( "testing" - "github.com/algorand/go-algorand/config" - "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/test/partitiontest" ) diff --git a/cmd/algod/main.go b/cmd/algod/main.go index 4b1a3a2ed8..a96b6a5473 100644 --- a/cmd/algod/main.go +++ b/cmd/algod/main.go @@ -29,6 +29,10 @@ import ( "strings" "time" + "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" @@ -41,9 +45,6 @@ import ( "github.com/algorand/go-algorand/util" "github.com/algorand/go-algorand/util/metrics" "github.com/algorand/go-algorand/util/tokens" - "github.com/gofrs/flock" - - "github.com/algorand/go-deadlock" ) var dataDirectory = flag.String("d", "", "Root Algorand daemon data path") diff --git a/cmd/algofix/deadlock_test.go b/cmd/algofix/deadlock_test.go index 2e13c4b7bc..475d14bc69 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/catchpointdump/bench_report.go b/cmd/catchpointdump/bench_report.go index 970486e926..483c779cf4 100644 --- a/cmd/catchpointdump/bench_report.go +++ b/cmd/catchpointdump/bench_report.go @@ -24,9 +24,10 @@ import ( "runtime" "time" - "github.com/algorand/go-algorand/util" "github.com/google/uuid" "github.com/klauspost/cpuid/v2" + + "github.com/algorand/go-algorand/util" ) type benchStage struct { diff --git a/cmd/catchpointdump/file.go b/cmd/catchpointdump/file.go index 50c68fd440..75b750a846 100644 --- a/cmd/catchpointdump/file.go +++ b/cmd/catchpointdump/file.go @@ -33,6 +33,7 @@ import ( "github.com/spf13/cobra" "github.com/algorand/avm-abi/apps" + cmdutil "github.com/algorand/go-algorand/cmd/util" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" diff --git a/cmd/catchupsrv/download_test.go b/cmd/catchupsrv/download_test.go index bf80605300..5a90a2b6ed 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/dispenser/server.go b/cmd/dispenser/server.go index e6f314a334..abdfb1e36c 100644 --- a/cmd/dispenser/server.go +++ b/cmd/dispenser/server.go @@ -18,12 +18,11 @@ package main import ( _ "embed" - "html" - // "bytes" "encoding/json" "flag" "fmt" + "html" "io" "log" "net/http" diff --git a/cmd/goal/application.go b/cmd/goal/application.go index 01614a49a1..45c8c7c671 100644 --- a/cmd/goal/application.go +++ b/cmd/goal/application.go @@ -32,6 +32,7 @@ import ( "github.com/algorand/avm-abi/abi" "github.com/algorand/avm-abi/apps" + "github.com/algorand/go-algorand/cmd/util/datadir" "github.com/algorand/go-algorand/crypto" apiclient "github.com/algorand/go-algorand/daemon/algod/api/client" diff --git a/cmd/goal/application_test.go b/cmd/goal/application_test.go index bb5d7e1bf7..c3375a01c0 100644 --- a/cmd/goal/application_test.go +++ b/cmd/goal/application_test.go @@ -21,9 +21,10 @@ import ( "slices" "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 TestParseMethodArgJSONtoByteSlice(t *testing.T) { diff --git a/cmd/goal/clerk_test.go b/cmd/goal/clerk_test.go index c590bdb46c..52306f6d77 100644 --- a/cmd/goal/clerk_test.go +++ b/cmd/goal/clerk_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 abs(t *testing.T, path string) string { diff --git a/cmd/goal/formatting_test.go b/cmd/goal/formatting_test.go index bb87249dc8..faba1aedef 100644 --- a/cmd/goal/formatting_test.go +++ b/cmd/goal/formatting_test.go @@ -19,9 +19,10 @@ package main import ( "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 TestUnicodePrintable(t *testing.T) { diff --git a/cmd/goal/node_test.go b/cmd/goal/node_test.go index 5ab6b3b53a..0873e52412 100644 --- a/cmd/goal/node_test.go +++ b/cmd/goal/node_test.go @@ -22,10 +22,11 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/ledger/ledgercore" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/ledger/ledgercore" + "github.com/algorand/go-algorand/test/partitiontest" ) var isNum = regexp.MustCompile(`^[0-9]+$`) diff --git a/cmd/goal/p2pid.go b/cmd/goal/p2pid.go index 2ccdfdc571..8201e44827 100644 --- a/cmd/goal/p2pid.go +++ b/cmd/goal/p2pid.go @@ -23,12 +23,13 @@ import ( "os" "path" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/spf13/cobra" + "github.com/algorand/go-algorand/cmd/util/datadir" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/network/p2p" "github.com/algorand/go-algorand/util" - "github.com/libp2p/go-libp2p/core/peer" - "github.com/spf13/cobra" ) var p2pID = &cobra.Command{ diff --git a/cmd/netgoal/commands.go b/cmd/netgoal/commands.go index c87f060816..172b1e9cd1 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/tealdbg/dryrunRequest.go b/cmd/tealdbg/dryrunRequest.go index e89e8cfc3d..5504623e00 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" "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated/model" + "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 c781e1d3c0..d31b2f9f9c 100644 --- a/cmd/tealdbg/local_test.go +++ b/cmd/tealdbg/local_test.go @@ -27,6 +27,9 @@ import ( "strings" "testing" + "github.com/stretchr/testify/assert" + "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" @@ -35,8 +38,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/assert" - "github.com/stretchr/testify/require" ) var txnSample string = `{ diff --git a/cmd/tealdbg/server.go b/cmd/tealdbg/server.go index 216c746e24..64131ad30e 100644 --- a/cmd/tealdbg/server.go +++ b/cmd/tealdbg/server.go @@ -25,9 +25,11 @@ import ( "strings" "time" - "github.com/algorand/go-algorand/data/basics" - "github.com/algorand/websocket" "github.com/gorilla/mux" + + "github.com/algorand/websocket" + + "github.com/algorand/go-algorand/data/basics" ) const ( diff --git a/cmd/tealdbg/server_test.go b/cmd/tealdbg/server_test.go index 04c03725de..b0106429d8 100644 --- a/cmd/tealdbg/server_test.go +++ b/cmd/tealdbg/server_test.go @@ -22,9 +22,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/webdbg_test.go b/cmd/tealdbg/webdbg_test.go index cb36742821..2a229a70a4 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/config/consensus_test.go b/config/consensus_test.go index 53af3a9aaa..296cb41b1e 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/config/dnsbootstrap_test.go b/config/dnsbootstrap_test.go index 43caa73134..885ccf6565 100644 --- a/config/dnsbootstrap_test.go +++ b/config/dnsbootstrap_test.go @@ -17,14 +17,15 @@ package config import ( - "github.com/algorand/go-algorand/protocol" - "pgregory.net/rapid" "strings" "testing" + "github.com/stretchr/testify/assert" + "pgregory.net/rapid" + "github.com/algorand/go-algorand/internal/rapidgen" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/assert" ) /** diff --git a/config/version_test.go b/config/version_test.go index bf289d65de..e491993d87 100644 --- a/config/version_test.go +++ b/config/version_test.go @@ -20,9 +20,10 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/s3" - "github.com/stretchr/testify/require" ) func TestAlgodVsUpdatedVersions(t *testing.T) { diff --git a/crypto/batchverifier.go b/crypto/batchverifier.go index a4d5d6a32f..74053f9fea 100644 --- a/crypto/batchverifier.go +++ b/crypto/batchverifier.go @@ -39,6 +39,7 @@ package crypto // size_t num, // int *valid_p); import "C" + import ( "errors" "unsafe" diff --git a/crypto/batchverifier_bench_test.go b/crypto/batchverifier_bench_test.go index 0fc983a831..7ba4d49ef6 100644 --- a/crypto/batchverifier_bench_test.go +++ b/crypto/batchverifier_bench_test.go @@ -21,8 +21,9 @@ import ( "io" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func randSignedMsg(t testing.TB, r io.Reader) (SignatureVerifier, Hashable, Signature) { diff --git a/crypto/falconWrapper_test.go b/crypto/falconWrapper_test.go index a105ed8845..b30c9f8881 100644 --- a/crypto/falconWrapper_test.go +++ b/crypto/falconWrapper_test.go @@ -19,9 +19,11 @@ 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" ) func TestSignAndVerifyFalcon(t *testing.T) { diff --git a/crypto/gobatchverifier_test.go b/crypto/gobatchverifier_test.go index a096ec5fe7..1049ed78a7 100644 --- a/crypto/gobatchverifier_test.go +++ b/crypto/gobatchverifier_test.go @@ -31,10 +31,11 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/protocol" + "github.com/algorand/go-algorand/test/partitiontest" ) // ensure internal ed25519 types match the expected []byte lengths used by ed25519consensus package diff --git a/crypto/hashes.go b/crypto/hashes.go index 039c38d239..2b0be41ca6 100644 --- a/crypto/hashes.go +++ b/crypto/hashes.go @@ -23,8 +23,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 0f748322e9..3a29780cc4 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/proof.go b/crypto/merklearray/proof.go index 5ea9fabf1d..9311298d03 100644 --- a/crypto/merklearray/proof.go +++ b/crypto/merklearray/proof.go @@ -19,8 +19,9 @@ package merklearray import ( "fmt" - "github.com/algorand/go-algorand/crypto" "github.com/algorand/msgp/msgp" + + "github.com/algorand/go-algorand/crypto" ) // Proof is used to convince a verifier about membership of leaves: h0,h1...hn diff --git a/crypto/merkletrie/bitset_test.go b/crypto/merkletrie/bitset_test.go index f65d7a818b..1d0d6231a9 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/onetimesig.go b/crypto/onetimesig.go index 6aee8ae2da..14f3f4e292 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/secp256k1/scalar_mult_cgo.go b/crypto/secp256k1/scalar_mult_cgo.go index d25046fd53..444f6e62bc 100644 --- a/crypto/secp256k1/scalar_mult_cgo.go +++ b/crypto/secp256k1/scalar_mult_cgo.go @@ -6,11 +6,6 @@ package secp256k1 -import ( - "math/big" - "unsafe" -) - /* #include "libsecp256k1/include/secp256k1.h" @@ -20,6 +15,11 @@ extern int secp256k1_ext_scalar_mul(const secp256k1_context* ctx, const unsigned */ import "C" +import ( + "math/big" + "unsafe" +) + // ScalarMult func func (BitCurve *BitCurve) ScalarMult(Bx, By *big.Int, scalar []byte) (*big.Int, *big.Int) { // Ensure scalar is exactly 32 bytes. We pad always, even if diff --git a/crypto/stateproof/weights_test.go b/crypto/stateproof/weights_test.go index 5620b66fb3..c571f36dfd 100644 --- a/crypto/stateproof/weights_test.go +++ b/crypto/stateproof/weights_test.go @@ -21,10 +21,11 @@ import ( "math" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config/bounds" "github.com/algorand/go-algorand/crypto/merklearray" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) func TestMaxNumberOfRevealsInVerify(t *testing.T) { diff --git a/daemon/algod/api/server/lib/middlewares/auth_test.go b/daemon/algod/api/server/lib/middlewares/auth_test.go index 8ef7900376..937fec4e57 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/lib/middlewares/cors_test.go b/daemon/algod/api/server/lib/middlewares/cors_test.go index 05ac524960..edad86f15f 100644 --- a/daemon/algod/api/server/lib/middlewares/cors_test.go +++ b/daemon/algod/api/server/lib/middlewares/cors_test.go @@ -21,9 +21,10 @@ import ( "net/http/httptest" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestMakeCORS(t *testing.T) { diff --git a/daemon/algod/api/server/router.go b/daemon/algod/api/server/router.go index acfc946dbb..e0b9adf0ed 100644 --- a/daemon/algod/api/server/router.go +++ b/daemon/algod/api/server/router.go @@ -22,10 +22,9 @@ import ( "net" "net/http" - "golang.org/x/sync/semaphore" - "github.com/labstack/echo/v4" "github.com/labstack/echo/v4/middleware" + "golang.org/x/sync/semaphore" "github.com/algorand/go-algorand/daemon/algod/api/server/common" "github.com/algorand/go-algorand/daemon/algod/api/server/lib" diff --git a/daemon/algod/api/server/v2/handlers_test.go b/daemon/algod/api/server/v2/handlers_test.go index 03186a7cef..fbf564407f 100644 --- a/daemon/algod/api/server/v2/handlers_test.go +++ b/daemon/algod/api/server/v2/handlers_test.go @@ -23,10 +23,11 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated/model" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated/model" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestApplicationBoxesMaxKeys(t *testing.T) { diff --git a/daemon/algod/api/server/v2/test/genesis_types_test.go b/daemon/algod/api/server/v2/test/genesis_types_test.go index 3795a2b9b0..526396074c 100644 --- a/daemon/algod/api/server/v2/test/genesis_types_test.go +++ b/daemon/algod/api/server/v2/test/genesis_types_test.go @@ -21,10 +21,11 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated/model" "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) // getCodecTag extracts the base name from a codec tag, ignoring any additional parameters 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 d4fe5daa70..6cb4b657e5 100644 --- a/daemon/algod/api/server/v2/test/handlers_resources_test.go +++ b/daemon/algod/api/server/v2/test/handlers_resources_test.go @@ -24,8 +24,6 @@ import ( "strconv" "testing" - "github.com/algorand/go-algorand/data/transactions/logic" - "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" @@ -38,6 +36,7 @@ import ( "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/data/transactions/logic" "github.com/algorand/go-algorand/ledger/ledgercore" ledgertesting "github.com/algorand/go-algorand/ledger/testing" "github.com/algorand/go-algorand/logging" diff --git a/daemon/algod/api/server/v2/test/handlers_test.go b/daemon/algod/api/server/v2/test/handlers_test.go index 11c60cc6ca..9bba4e25b7 100644 --- a/daemon/algod/api/server/v2/test/handlers_test.go +++ b/daemon/algod/api/server/v2/test/handlers_test.go @@ -33,16 +33,11 @@ import ( "testing" "time" - "golang.org/x/sync/semaphore" - - "github.com/algorand/go-algorand/daemon/algod/api/server" - "github.com/algorand/go-algorand/ledger/eval" - "github.com/algorand/go-algorand/ledger/ledgercore" - "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "golang.org/x/sync/semaphore" "github.com/algorand/go-codec/codec" @@ -52,6 +47,7 @@ import ( "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/crypto/merklearray" "github.com/algorand/go-algorand/crypto/merklesignature" + "github.com/algorand/go-algorand/daemon/algod/api/server" v2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2" "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated/model" "github.com/algorand/go-algorand/data" @@ -63,6 +59,8 @@ import ( "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/data/transactions/logic/mocktracer" "github.com/algorand/go-algorand/data/txntest" + "github.com/algorand/go-algorand/ledger/eval" + "github.com/algorand/go-algorand/ledger/ledgercore" simulationtesting "github.com/algorand/go-algorand/ledger/simulation/testing" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/node" diff --git a/daemon/algod/server_test.go b/daemon/algod/server_test.go index 53ec159b7c..c5ceaa84dc 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/data/account/participationRegistry.go b/data/account/participationRegistry.go index cbd4de2486..89f137f9d2 100644 --- a/data/account/participationRegistry.go +++ b/data/account/participationRegistry.go @@ -24,6 +24,8 @@ import ( "fmt" "time" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/crypto/merklesignature" @@ -31,7 +33,6 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/util/db" - "github.com/algorand/go-deadlock" ) const defaultTimeout = 5 * time.Second diff --git a/data/appRateLimiter.go b/data/appRateLimiter.go index 230fa8714a..b95b22798a 100644 --- a/data/appRateLimiter.go +++ b/data/appRateLimiter.go @@ -22,14 +22,16 @@ import ( "sync/atomic" "time" + "golang.org/x/crypto/blake2b" + + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config/bounds" "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/protocol" "github.com/algorand/go-algorand/util" - "github.com/algorand/go-deadlock" - "golang.org/x/crypto/blake2b" ) const numBuckets = 128 diff --git a/data/appRateLimiter_test.go b/data/appRateLimiter_test.go index 690fcb2012..dc4080053b 100644 --- a/data/appRateLimiter_test.go +++ b/data/appRateLimiter_test.go @@ -21,6 +21,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "golang.org/x/crypto/blake2b" + "golang.org/x/exp/rand" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/config/bounds" "github.com/algorand/go-algorand/crypto" @@ -28,9 +32,6 @@ import ( "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" - "golang.org/x/crypto/blake2b" - "golang.org/x/exp/rand" ) func TestAppRateLimiter_Make(t *testing.T) { diff --git a/data/basics/fraction_test.go b/data/basics/fraction_test.go index 02f61b8a30..a73744a297 100644 --- a/data/basics/fraction_test.go +++ b/data/basics/fraction_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 TestFraction(t *testing.T) { diff --git a/data/basics/serr_test.go b/data/basics/serr_test.go index 90f8a9b6d6..685c0690ec 100644 --- a/data/basics/serr_test.go +++ b/data/basics/serr_test.go @@ -21,8 +21,9 @@ import ( "fmt" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/assert" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestNew(t *testing.T) { diff --git a/data/basics/testing/nearzero_test.go b/data/basics/testing/nearzero_test.go index ef47b13096..e2363e779d 100644 --- a/data/basics/testing/nearzero_test.go +++ b/data/basics/testing/nearzero_test.go @@ -19,8 +19,9 @@ package testing import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/assert" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestNearZeros(t *testing.T) { diff --git a/data/basics/units_test.go b/data/basics/units_test.go index 8bd3ee6667..8d259922d0 100644 --- a/data/basics/units_test.go +++ b/data/basics/units_test.go @@ -21,9 +21,10 @@ import ( "math/big" "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 TestODiff(t *testing.T) { diff --git a/data/bookkeeping/lightBlockHeader_test.go b/data/bookkeeping/lightBlockHeader_test.go index ad8600307a..8bd7349ca3 100644 --- a/data/bookkeeping/lightBlockHeader_test.go +++ b/data/bookkeeping/lightBlockHeader_test.go @@ -20,12 +20,13 @@ 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/data/committee" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) func TestConvertSha256Header(t *testing.T) { diff --git a/data/committee/credential.go b/data/committee/credential.go index 7d6ce35b1e..6f7e35a8b1 100644 --- a/data/committee/credential.go +++ b/data/committee/credential.go @@ -21,12 +21,13 @@ import ( "fmt" "math/big" + "github.com/algorand/sortition" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/sortition" ) type ( diff --git a/data/transactions/asset_test.go b/data/transactions/asset_test.go index f12f19a716..33261fa95b 100644 --- a/data/transactions/asset_test.go +++ b/data/transactions/asset_test.go @@ -21,11 +21,12 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "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 TestAxferWellFormedErrors(t *testing.T) { diff --git a/data/transactions/heartbeat_test.go b/data/transactions/heartbeat_test.go index 538901dccc..e5b898a865 100644 --- a/data/transactions/heartbeat_test.go +++ b/data/transactions/heartbeat_test.go @@ -20,14 +20,15 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/committee" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestWellFormedHeartbeatErrors(t *testing.T) { diff --git a/data/transactions/json_test.go b/data/transactions/json_test.go index ddaca98413..0ef15db1b4 100644 --- a/data/transactions/json_test.go +++ b/data/transactions/json_test.go @@ -26,12 +26,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/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) func decode(t *testing.T, data string, v interface{}) { diff --git a/data/transactions/keyreg_test.go b/data/transactions/keyreg_test.go index 59d5dac223..8684f11a27 100644 --- a/data/transactions/keyreg_test.go +++ b/data/transactions/keyreg_test.go @@ -21,13 +21,14 @@ import ( "fmt" "testing" + "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" ) var generateFlag = flag.Bool("generate", false, "") diff --git a/data/transactions/logic/assembler.go b/data/transactions/logic/assembler.go index aba822b138..63638b6e9e 100644 --- a/data/transactions/logic/assembler.go +++ b/data/transactions/logic/assembler.go @@ -34,6 +34,7 @@ import ( "unicode" "github.com/algorand/avm-abi/abi" + "github.com/algorand/go-algorand/data/basics" ) diff --git a/data/transactions/logic/crypto.go b/data/transactions/logic/crypto.go index f3e05ee120..38707d4496 100644 --- a/data/transactions/logic/crypto.go +++ b/data/transactions/logic/crypto.go @@ -26,14 +26,15 @@ import ( "hash" "math/big" + bls12_381mimc "github.com/consensys/gnark-crypto/ecc/bls12-381/fr/mimc" + bn254mimc "github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc" + "golang.org/x/crypto/sha3" + + "github.com/algorand/go-sumhash" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/crypto/secp256k1" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-sumhash" - "golang.org/x/crypto/sha3" - - bls12_381mimc "github.com/consensys/gnark-crypto/ecc/bls12-381/fr/mimc" - bn254mimc "github.com/consensys/gnark-crypto/ecc/bn254/fr/mimc" ) // mimc is implemented for compatibility with zk circuits, diff --git a/data/transactions/logic/debugger_eval_test.go b/data/transactions/logic/debugger_eval_test.go index d2e6bf6efb..208e686165 100644 --- a/data/transactions/logic/debugger_eval_test.go +++ b/data/transactions/logic/debugger_eval_test.go @@ -21,11 +21,12 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/data/basics" . "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/data/transactions/logic/mocktracer" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) const debuggerTestProgramApprove string = `intcblock 0 1 1 1 1 5 100 diff --git a/data/transactions/logic/debugger_test.go b/data/transactions/logic/debugger_test.go index fedf24bd9c..ebcb152787 100644 --- a/data/transactions/logic/debugger_test.go +++ b/data/transactions/logic/debugger_test.go @@ -19,8 +19,9 @@ package logic import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestLineToPC(t *testing.T) { diff --git a/data/transactions/logic/doc_test.go b/data/transactions/logic/doc_test.go index a1e3512fef..955345211d 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 f1a645ffef..9102f8cf6e 100644 --- a/data/transactions/logic/evalAppTxn_test.go +++ b/data/transactions/logic/evalAppTxn_test.go @@ -24,6 +24,8 @@ 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/data/transactions" @@ -31,8 +33,6 @@ import ( "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/evalBench_test.go b/data/transactions/logic/evalBench_test.go index 229f1780bc..226379ccb7 100644 --- a/data/transactions/logic/evalBench_test.go +++ b/data/transactions/logic/evalBench_test.go @@ -19,12 +19,13 @@ package logic_test import ( "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "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/stretchr/testify/require" ) func BenchmarkCheckSignature(b *testing.B) { diff --git a/data/transactions/logic/eval_test.go b/data/transactions/logic/eval_test.go index 5c81bcaf41..d088b60581 100644 --- a/data/transactions/logic/eval_test.go +++ b/data/transactions/logic/eval_test.go @@ -30,6 +30,7 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "pgregory.net/rapid" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/config/bounds" @@ -41,8 +42,6 @@ import ( "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util" - - "pgregory.net/rapid" ) type protoOpt func(*config.ConsensusParams) diff --git a/data/transactions/logic/jsonspec_test.go b/data/transactions/logic/jsonspec_test.go index 3e78b4547c..63f047e168 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/mocktracer/tracer.go b/data/transactions/logic/mocktracer/tracer.go index 050fa7bbe4..19c98cbd64 100644 --- a/data/transactions/logic/mocktracer/tracer.go +++ b/data/transactions/logic/mocktracer/tracer.go @@ -19,14 +19,15 @@ package mocktracer import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "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/data/transactions/logic" "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/protocol" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) // EventType represents a type of logic.EvalTracer event diff --git a/data/transactions/logic/opcodes_test.go b/data/transactions/logic/opcodes_test.go index bdb8fb4441..43532c3ae5 100644 --- a/data/transactions/logic/opcodes_test.go +++ b/data/transactions/logic/opcodes_test.go @@ -22,8 +22,9 @@ import ( "slices" "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/logic/pairing.go b/data/transactions/logic/pairing.go index 25acf7a280..22941bf1ce 100644 --- a/data/transactions/logic/pairing.go +++ b/data/transactions/logic/pairing.go @@ -21,13 +21,12 @@ import ( "math/big" "github.com/consensys/gnark-crypto/ecc" - "github.com/consensys/gnark-crypto/ecc/bn254" - bn254fp "github.com/consensys/gnark-crypto/ecc/bn254/fp" - bn254fr "github.com/consensys/gnark-crypto/ecc/bn254/fr" - bls12381 "github.com/consensys/gnark-crypto/ecc/bls12-381" bls12381fp "github.com/consensys/gnark-crypto/ecc/bls12-381/fp" bls12381fr "github.com/consensys/gnark-crypto/ecc/bls12-381/fr" + "github.com/consensys/gnark-crypto/ecc/bn254" + bn254fp "github.com/consensys/gnark-crypto/ecc/bn254/fp" + bn254fr "github.com/consensys/gnark-crypto/ecc/bn254/fr" ) type sError string diff --git a/data/transactions/logic/pairing_test.go b/data/transactions/logic/pairing_test.go index f97e4e57c4..32a4676aba 100644 --- a/data/transactions/logic/pairing_test.go +++ b/data/transactions/logic/pairing_test.go @@ -24,7 +24,6 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/test/partitiontest" bls12381 "github.com/consensys/gnark-crypto/ecc/bls12-381" bls12381fp "github.com/consensys/gnark-crypto/ecc/bls12-381/fp" bls12381fr "github.com/consensys/gnark-crypto/ecc/bls12-381/fr" @@ -32,6 +31,8 @@ import ( bn254fp "github.com/consensys/gnark-crypto/ecc/bn254/fp" bn254fr "github.com/consensys/gnark-crypto/ecc/bn254/fr" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) const pairingNonsense = ` diff --git a/data/transactions/logic/resources_test.go b/data/transactions/logic/resources_test.go index 11691a0bc5..c93a91d81c 100644 --- a/data/transactions/logic/resources_test.go +++ b/data/transactions/logic/resources_test.go @@ -22,13 +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" ) // TestAppSharing confirms that as of v9, apps can be accessed across groups, diff --git a/data/transactions/logic/sourcemap_test.go b/data/transactions/logic/sourcemap_test.go index 04159bdc90..5f23231792 100644 --- a/data/transactions/logic/sourcemap_test.go +++ b/data/transactions/logic/sourcemap_test.go @@ -19,8 +19,9 @@ package logic import ( "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/data/transactions/logic/tracer_test.go b/data/transactions/logic/tracer_test.go index 386c9ee3a7..0ea5124fbf 100644 --- a/data/transactions/logic/tracer_test.go +++ b/data/transactions/logic/tracer_test.go @@ -19,11 +19,12 @@ package logic_test import ( "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/data/basics" . "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/data/transactions/logic/mocktracer" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) type tracerTestCase struct { diff --git a/data/transactions/payset_test.go b/data/transactions/payset_test.go index 33f99dafbf..11dc6eded2 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 generatePayset(txnCount, acctCount int) Payset { diff --git a/data/transactions/stateproof_test.go b/data/transactions/stateproof_test.go index 6ef95e8d6d..18acf8e56d 100644 --- a/data/transactions/stateproof_test.go +++ b/data/transactions/stateproof_test.go @@ -20,6 +20,8 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/crypto/stateproof" @@ -27,7 +29,6 @@ import ( "github.com/algorand/go-algorand/data/stateproofmsg" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) type stateproofTxnTestCase struct { diff --git a/data/transactions/teal_test.go b/data/transactions/teal_test.go index 954fe501ba..e7095188ef 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/verify/artifact_test.go b/data/transactions/verify/artifact_test.go index 748d7dccab..e7569f20b6 100644 --- a/data/transactions/verify/artifact_test.go +++ b/data/transactions/verify/artifact_test.go @@ -19,14 +19,14 @@ package verify import ( "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "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/data/txntest" "github.com/algorand/go-algorand/protocol" - - "github.com/stretchr/testify/require" ) // test/benchmark real programs found in the wild (testnet/mainnet). diff --git a/data/txDupCache.go b/data/txDupCache.go index 92b7087721..3f85c910af 100644 --- a/data/txDupCache.go +++ b/data/txDupCache.go @@ -23,11 +23,12 @@ import ( "sync" "time" - "github.com/algorand/go-algorand/config/bounds" - "github.com/algorand/go-algorand/crypto" + "golang.org/x/crypto/blake2b" + "github.com/algorand/go-deadlock" - "golang.org/x/crypto/blake2b" + "github.com/algorand/go-algorand/config/bounds" + "github.com/algorand/go-algorand/crypto" ) // digestCache is a rotating cache of size N accepting crypto.Digest as a key diff --git a/data/txDupCache_test.go b/data/txDupCache_test.go index 79899b313d..ac0f9be0ee 100644 --- a/data/txDupCache_test.go +++ b/data/txDupCache_test.go @@ -25,12 +25,12 @@ import ( "time" "github.com/stretchr/testify/require" + "golang.org/x/crypto/blake2b" - "github.com/algorand/go-algorand/crypto" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-deadlock" - "golang.org/x/crypto/blake2b" + "github.com/algorand/go-algorand/crypto" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestTxHandlerDigestCache(t *testing.T) { diff --git a/data/txHandler.go b/data/txHandler.go index e82f06af01..80b6555897 100644 --- a/data/txHandler.go +++ b/data/txHandler.go @@ -26,6 +26,8 @@ import ( "sync" "time" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/config/bounds" "github.com/algorand/go-algorand/crypto" @@ -39,7 +41,6 @@ import ( "github.com/algorand/go-algorand/util" "github.com/algorand/go-algorand/util/execpool" "github.com/algorand/go-algorand/util/metrics" - "github.com/algorand/go-deadlock" ) var transactionMessagesHandled = metrics.MakeCounter(metrics.TransactionMessagesHandled) diff --git a/data/txntest/defi.go b/data/txntest/defi.go index 490fc35b86..027badccc3 100644 --- a/data/txntest/defi.go +++ b/data/txntest/defi.go @@ -19,11 +19,12 @@ package txntest import ( "testing" + "github.com/stretchr/testify/require" + "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/stretchr/testify/require" ) // Test/benchmark real programs found in the wild (testnet/mainnet). diff --git a/gen/generate_test.go b/gen/generate_test.go index c02bf5bd63..e8207bb107 100644 --- a/gen/generate_test.go +++ b/gen/generate_test.go @@ -27,14 +27,13 @@ import ( "sync" "testing" - "github.com/algorand/go-algorand/data/basics" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "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/protocol" "github.com/algorand/go-algorand/test/partitiontest" diff --git a/heartbeat/service_test.go b/heartbeat/service_test.go index 652cfe153d..8fcc9a7056 100644 --- a/heartbeat/service_test.go +++ b/heartbeat/service_test.go @@ -21,6 +21,10 @@ import ( "testing" "time" + "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" @@ -32,8 +36,6 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/go-deadlock" - "github.com/stretchr/testify/require" ) type table map[basics.Address]ledgercore.AccountData diff --git a/internal/rapidgen/rapidgenerators.go b/internal/rapidgen/rapidgenerators.go index d8fcf0cace..1f31da168b 100644 --- a/internal/rapidgen/rapidgenerators.go +++ b/internal/rapidgen/rapidgenerators.go @@ -20,8 +20,9 @@ package rapidgen import ( "fmt" - "pgregory.net/rapid" "strings" + + "pgregory.net/rapid" ) // DomainWithPort generates an RFC 1035 compliant domain name with a port. diff --git a/ledger/acctdeltas_test.go b/ledger/acctdeltas_test.go index 1e685e3ca8..0bf62c2197 100644 --- a/ledger/acctdeltas_test.go +++ b/ledger/acctdeltas_test.go @@ -36,6 +36,7 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/avm-abi/apps" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/config/bounds" "github.com/algorand/go-algorand/crypto" diff --git a/ledger/acctonline_expired_test.go b/ledger/acctonline_expired_test.go index c35667316a..c748fa0e69 100644 --- a/ledger/acctonline_expired_test.go +++ b/ledger/acctonline_expired_test.go @@ -23,6 +23,8 @@ import ( "strconv" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/crypto/merklesignature" @@ -32,7 +34,6 @@ import ( ledgertesting "github.com/algorand/go-algorand/ledger/testing" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) // onlineAcctModel provides a simple interface for tracking accounts diff --git a/ledger/acctonline_test.go b/ledger/acctonline_test.go index 4327f2ae24..4d4008668e 100644 --- a/ledger/acctonline_test.go +++ b/ledger/acctonline_test.go @@ -25,6 +25,8 @@ import ( "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" @@ -35,7 +37,6 @@ import ( ledgertesting "github.com/algorand/go-algorand/ledger/testing" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) func commitSync(t *testing.T, oa *onlineAccounts, ml *mockLedgerForTracker, rnd basics.Round) { diff --git a/ledger/acctonlineexp.go b/ledger/acctonlineexp.go index 0a772e6b9b..c7f62dcf9e 100644 --- a/ledger/acctonlineexp.go +++ b/ledger/acctonlineexp.go @@ -17,8 +17,9 @@ package ledger import ( - "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-deadlock" + + "github.com/algorand/go-algorand/data/basics" ) type expiredCirculationCache struct { diff --git a/ledger/acctonlineexp_test.go b/ledger/acctonlineexp_test.go index 3f5b943b4e..e124cd2bf4 100644 --- a/ledger/acctonlineexp_test.go +++ b/ledger/acctonlineexp_test.go @@ -19,9 +19,10 @@ package ledger import ( "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 TestAcctOnline_ExpiredCirculationCacheBasic(t *testing.T) { diff --git a/ledger/acctupdates_test.go b/ledger/acctupdates_test.go index 4017a26835..4666bb1cb2 100644 --- a/ledger/acctupdates_test.go +++ b/ledger/acctupdates_test.go @@ -32,6 +32,8 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/avm-abi/apps" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "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/db" - "github.com/algorand/go-deadlock" ) 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/apply/challenge_test.go b/ledger/apply/challenge_test.go index b0362a846b..15e6e55343 100644 --- a/ledger/apply/challenge_test.go +++ b/ledger/apply/challenge_test.go @@ -19,13 +19,14 @@ package apply import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "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/go-algorand/test/partitiontest" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestBitsMatch(t *testing.T) { diff --git a/ledger/boxtxn_test.go b/ledger/boxtxn_test.go index 8fef48da77..b14de3e95a 100644 --- a/ledger/boxtxn_test.go +++ b/ledger/boxtxn_test.go @@ -24,6 +24,8 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/transactions" @@ -33,7 +35,6 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) var boxAppSource = main(` diff --git a/ledger/bulletin_test.go b/ledger/bulletin_test.go index d5ecaa8558..402b959073 100644 --- a/ledger/bulletin_test.go +++ b/ledger/bulletin_test.go @@ -20,9 +20,10 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) const epsilon = 5 * time.Millisecond diff --git a/ledger/catchpointfilewriter_test.go b/ledger/catchpointfilewriter_test.go index b534995eb7..7ffcd7b0d0 100644 --- a/ledger/catchpointfilewriter_test.go +++ b/ledger/catchpointfilewriter_test.go @@ -35,6 +35,8 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/avm-abi/apps" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/crypto/merkletrie" @@ -48,7 +50,6 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/msgp/msgp" ) type decodedCatchpointChunkData struct { diff --git a/ledger/catchpointtracker.go b/ledger/catchpointtracker.go index d95d299ea6..9cb214efc0 100644 --- a/ledger/catchpointtracker.go +++ b/ledger/catchpointtracker.go @@ -33,9 +33,10 @@ import ( "sync/atomic" "time" - "github.com/algorand/go-deadlock" "github.com/golang/snappy" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/crypto/merkletrie" diff --git a/ledger/catchupaccessor_test.go b/ledger/catchupaccessor_test.go index 87cb32aed8..77ef32f488 100644 --- a/ledger/catchupaccessor_test.go +++ b/ledger/catchupaccessor_test.go @@ -28,6 +28,8 @@ import ( "github.com/stretchr/testify/require" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" @@ -41,7 +43,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/msgp/msgp" ) func createTestingEncodedChunks(accountsCount uint64) (encodedAccountChunks [][]byte, last64KIndex int) { diff --git a/ledger/double_test.go b/ledger/double_test.go index 728d4e65c6..73e31fd932 100644 --- a/ledger/double_test.go +++ b/ledger/double_test.go @@ -19,6 +19,8 @@ package ledger import ( "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/data/basics" @@ -28,7 +30,6 @@ import ( "github.com/algorand/go-algorand/ledger/eval" "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/encoded/recordsV5.go b/ledger/encoded/recordsV5.go index 12c133c251..91506f5319 100644 --- a/ledger/encoded/recordsV5.go +++ b/ledger/encoded/recordsV5.go @@ -17,8 +17,9 @@ package encoded import ( - "github.com/algorand/go-algorand/data/basics" "github.com/algorand/msgp/msgp" + + "github.com/algorand/go-algorand/data/basics" ) // BalanceRecordV5 is the encoded account balance record. diff --git a/ledger/encoded/recordsV6.go b/ledger/encoded/recordsV6.go index 12df070e64..232ee6d019 100644 --- a/ledger/encoded/recordsV6.go +++ b/ledger/encoded/recordsV6.go @@ -17,9 +17,10 @@ package encoded import ( + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/msgp/msgp" ) // Adjust these to be big enough for boxes, but not directly tied to box values. diff --git a/ledger/encoded/recordsV6_test.go b/ledger/encoded/recordsV6_test.go index 42fb6c2e55..9bc973c6f5 100644 --- a/ledger/encoded/recordsV6_test.go +++ b/ledger/encoded/recordsV6_test.go @@ -20,12 +20,14 @@ import ( "math" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/avm-abi/apps" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) func TestEncodedKVRecordV6Allocbounds(t *testing.T) { diff --git a/ledger/eval/applications.go b/ledger/eval/applications.go index 08dd68e587..b0ff12fa31 100644 --- a/ledger/eval/applications.go +++ b/ledger/eval/applications.go @@ -20,6 +20,7 @@ import ( "fmt" "github.com/algorand/avm-abi/apps" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/ledger/apply" diff --git a/ledger/eval/prefetcher/prefetcher_alignment_test.go b/ledger/eval/prefetcher/prefetcher_alignment_test.go index 433f518172..7cb43ebb49 100644 --- a/ledger/eval/prefetcher/prefetcher_alignment_test.go +++ b/ledger/eval/prefetcher/prefetcher_alignment_test.go @@ -24,6 +24,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" @@ -38,7 +40,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/evalbench_test.go b/ledger/evalbench_test.go index acd855d6b4..4a1062c5e0 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_test.go b/ledger/ledger_test.go index 3df15d2cd5..7d47841a11 100644 --- a/ledger/ledger_test.go +++ b/ledger/ledger_test.go @@ -31,6 +31,8 @@ import ( "github.com/stretchr/testify/assert" "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" @@ -51,7 +53,6 @@ import ( "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/db" "github.com/algorand/go-algorand/util/execpool" - "github.com/algorand/go-deadlock" ) const preReleaseDBVersion = 6 diff --git a/ledger/ledgercore/accountdata_test.go b/ledger/ledgercore/accountdata_test.go index caa1a672aa..a6dd01e298 100644 --- a/ledger/ledgercore/accountdata_test.go +++ b/ledger/ledgercore/accountdata_test.go @@ -19,10 +19,11 @@ package ledgercore import ( "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" ) // TestBasicsAccountDataRoundtripConversion ensures that basics.AccountData can be converted to diff --git a/ledger/simple_test.go b/ledger/simple_test.go index 638f8055b7..250067b3e6 100644 --- a/ledger/simple_test.go +++ b/ledger/simple_test.go @@ -23,6 +23,8 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" @@ -37,7 +39,6 @@ import ( "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/stretchr/testify/require" ) type simpleLedgerCfg struct { diff --git a/ledger/simulation/resources_test.go b/ledger/simulation/resources_test.go index c7f20c0b6a..c060863158 100644 --- a/ledger/simulation/resources_test.go +++ b/ledger/simulation/resources_test.go @@ -19,13 +19,14 @@ package simulation import ( "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "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/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) func TestAppAccounts(t *testing.T) { diff --git a/ledger/simulation/simulation_eval_test.go b/ledger/simulation/simulation_eval_test.go index 7e60d829e0..4cb4ae5f44 100644 --- a/ledger/simulation/simulation_eval_test.go +++ b/ledger/simulation/simulation_eval_test.go @@ -25,6 +25,9 @@ import ( "strings" "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/transactions" @@ -38,9 +41,6 @@ import ( "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func uint64ToBytes(num uint64) []byte { diff --git a/ledger/simulation/simulator_test.go b/ledger/simulation/simulator_test.go index 7f416021a6..62baa5bf4a 100644 --- a/ledger/simulation/simulator_test.go +++ b/ledger/simulation/simulator_test.go @@ -21,6 +21,8 @@ import ( "slices" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data" "github.com/algorand/go-algorand/data/basics" @@ -34,7 +36,6 @@ import ( simulationtesting "github.com/algorand/go-algorand/ledger/simulation/testing" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) // We want to be careful that the Algod ledger does not move on to another round diff --git a/ledger/simulation/testing/utils.go b/ledger/simulation/testing/utils.go index 0910e0061f..099d0810e1 100644 --- a/ledger/simulation/testing/utils.go +++ b/ledger/simulation/testing/utils.go @@ -21,6 +21,8 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" @@ -35,7 +37,6 @@ import ( ledgertesting "github.com/algorand/go-algorand/ledger/testing" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/stretchr/testify/require" ) // Account contains public and private keys, as well as the state of an account diff --git a/ledger/simulation/tracer_test.go b/ledger/simulation/tracer_test.go index 8335d5ac43..6d07c9d794 100644 --- a/ledger/simulation/tracer_test.go +++ b/ledger/simulation/tracer_test.go @@ -19,11 +19,12 @@ package simulation import ( "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/data/transactions/logic/mocktracer" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) func TestCursorEvalTracer(t *testing.T) { diff --git a/ledger/spverificationtracker_test.go b/ledger/spverificationtracker_test.go index a46ba5bde4..1a3fdb3b97 100644 --- a/ledger/spverificationtracker_test.go +++ b/ledger/spverificationtracker_test.go @@ -20,6 +20,8 @@ import ( "context" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/bookkeeping" @@ -27,7 +29,6 @@ import ( "github.com/algorand/go-algorand/ledger/store/trackerdb" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) const defaultStateProofInterval = uint64(256) diff --git a/ledger/store/testing/helpers.go b/ledger/store/testing/helpers.go index f05093c924..5384a06313 100644 --- a/ledger/store/testing/helpers.go +++ b/ledger/store/testing/helpers.go @@ -21,10 +21,11 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/util/db" - "github.com/stretchr/testify/require" ) // DbOpenTest opens a db file for testing purposes. diff --git a/ledger/store/trackerdb/data_test.go b/ledger/store/trackerdb/data_test.go index 3078f0b1a3..b77c7a56d9 100644 --- a/ledger/store/trackerdb/data_test.go +++ b/ledger/store/trackerdb/data_test.go @@ -23,6 +23,9 @@ import ( "reflect" "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" @@ -31,8 +34,6 @@ import ( ledgertesting "github.com/algorand/go-algorand/ledger/testing" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestResourcesDataApp(t *testing.T) { diff --git a/ledger/store/trackerdb/dualdriver/accounts_reader.go b/ledger/store/trackerdb/dualdriver/accounts_reader.go index 27bede02b7..ff3961843a 100644 --- a/ledger/store/trackerdb/dualdriver/accounts_reader.go +++ b/ledger/store/trackerdb/dualdriver/accounts_reader.go @@ -17,9 +17,10 @@ package dualdriver import ( + "github.com/google/go-cmp/cmp" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/ledger/store/trackerdb" - "github.com/google/go-cmp/cmp" ) type accountsReader struct { diff --git a/ledger/store/trackerdb/dualdriver/accounts_reader_ext.go b/ledger/store/trackerdb/dualdriver/accounts_reader_ext.go index 5696955516..d469635841 100644 --- a/ledger/store/trackerdb/dualdriver/accounts_reader_ext.go +++ b/ledger/store/trackerdb/dualdriver/accounts_reader_ext.go @@ -19,11 +19,12 @@ package dualdriver import ( "context" + "github.com/google/go-cmp/cmp" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/ledger/store/trackerdb" - "github.com/google/go-cmp/cmp" ) type accountsReaderExt struct { diff --git a/ledger/store/trackerdb/dualdriver/accounts_writer_ext.go b/ledger/store/trackerdb/dualdriver/accounts_writer_ext.go index ced4d0aa72..303e0fd334 100644 --- a/ledger/store/trackerdb/dualdriver/accounts_writer_ext.go +++ b/ledger/store/trackerdb/dualdriver/accounts_writer_ext.go @@ -18,6 +18,7 @@ package dualdriver import ( "context" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/ledger/store/trackerdb" diff --git a/ledger/store/trackerdb/dualdriver/dualdriver.go b/ledger/store/trackerdb/dualdriver/dualdriver.go index c88729636d..7cd1e3e2ce 100644 --- a/ledger/store/trackerdb/dualdriver/dualdriver.go +++ b/ledger/store/trackerdb/dualdriver/dualdriver.go @@ -24,12 +24,13 @@ import ( "sync" "time" + "github.com/google/go-cmp/cmp" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/ledger/encoded" "github.com/algorand/go-algorand/ledger/store/trackerdb" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/util/db" - "github.com/google/go-cmp/cmp" ) // ErrInconsistentResult is returned when the two stores return different results. diff --git a/ledger/store/trackerdb/dualdriver/online_accounts_reader.go b/ledger/store/trackerdb/dualdriver/online_accounts_reader.go index 8ffcb91334..f30ed07a4d 100644 --- a/ledger/store/trackerdb/dualdriver/online_accounts_reader.go +++ b/ledger/store/trackerdb/dualdriver/online_accounts_reader.go @@ -17,10 +17,11 @@ package dualdriver import ( + "github.com/google/go-cmp/cmp" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/ledger/store/trackerdb" - "github.com/google/go-cmp/cmp" ) type onlineAccountsReader struct { diff --git a/ledger/store/trackerdb/dualdriver/stateproof_reader.go b/ledger/store/trackerdb/dualdriver/stateproof_reader.go index ef15ed2ee6..926b8abb46 100644 --- a/ledger/store/trackerdb/dualdriver/stateproof_reader.go +++ b/ledger/store/trackerdb/dualdriver/stateproof_reader.go @@ -19,10 +19,11 @@ package dualdriver import ( "context" + "github.com/google/go-cmp/cmp" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/ledger/store/trackerdb" - "github.com/google/go-cmp/cmp" ) type stateproofReader struct { diff --git a/ledger/store/trackerdb/dualdriver/stateproof_writer.go b/ledger/store/trackerdb/dualdriver/stateproof_writer.go index 026522bf77..46a5806cb4 100644 --- a/ledger/store/trackerdb/dualdriver/stateproof_writer.go +++ b/ledger/store/trackerdb/dualdriver/stateproof_writer.go @@ -18,6 +18,7 @@ package dualdriver import ( "context" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/ledger/store/trackerdb" diff --git a/ledger/store/trackerdb/generickv/init_accounts.go b/ledger/store/trackerdb/generickv/init_accounts.go index e38b77093a..32a2d20407 100644 --- a/ledger/store/trackerdb/generickv/init_accounts.go +++ b/ledger/store/trackerdb/generickv/init_accounts.go @@ -20,10 +20,11 @@ import ( "context" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/ledger/store/trackerdb" "github.com/algorand/go-algorand/protocol" - "github.com/stretchr/testify/require" ) type dbForInit interface { diff --git a/ledger/store/trackerdb/pebbledbdriver/pebbledriver.go b/ledger/store/trackerdb/pebbledbdriver/pebbledriver.go index 341457e024..2fe5d1301a 100644 --- a/ledger/store/trackerdb/pebbledbdriver/pebbledriver.go +++ b/ledger/store/trackerdb/pebbledbdriver/pebbledriver.go @@ -24,14 +24,15 @@ import ( "runtime" "time" + "github.com/cockroachdb/pebble" + "github.com/cockroachdb/pebble/bloom" + "github.com/cockroachdb/pebble/vfs" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/ledger/store/trackerdb" "github.com/algorand/go-algorand/ledger/store/trackerdb/generickv" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/util/db" - "github.com/cockroachdb/pebble" - "github.com/cockroachdb/pebble/bloom" - "github.com/cockroachdb/pebble/vfs" ) const ( diff --git a/ledger/store/trackerdb/pebbledbdriver/testing.go b/ledger/store/trackerdb/pebbledbdriver/testing.go index 57483aa1b7..6b694ce5c6 100644 --- a/ledger/store/trackerdb/pebbledbdriver/testing.go +++ b/ledger/store/trackerdb/pebbledbdriver/testing.go @@ -20,11 +20,12 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/ledger/store/trackerdb" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/stretchr/testify/require" ) // OpenForTesting opens a sqlite db file for testing purposes. diff --git a/ledger/store/trackerdb/sqlitedriver/accountsV2.go b/ledger/store/trackerdb/sqlitedriver/accountsV2.go index d8eae963ae..97777ae994 100644 --- a/ledger/store/trackerdb/sqlitedriver/accountsV2.go +++ b/ledger/store/trackerdb/sqlitedriver/accountsV2.go @@ -24,13 +24,14 @@ 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/ledger/ledgercore" "github.com/algorand/go-algorand/ledger/store/trackerdb" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/util/db" - "github.com/stretchr/testify/require" ) type accountsV2Reader struct { diff --git a/ledger/store/trackerdb/sqlitedriver/accountsV2_test.go b/ledger/store/trackerdb/sqlitedriver/accountsV2_test.go index d3c6dad6e6..d6ba02dcb8 100644 --- a/ledger/store/trackerdb/sqlitedriver/accountsV2_test.go +++ b/ledger/store/trackerdb/sqlitedriver/accountsV2_test.go @@ -19,8 +19,9 @@ package sqlitedriver import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestRowidsToChunkedArgs(t *testing.T) { diff --git a/ledger/store/trackerdb/sqlitedriver/catchpoint.go b/ledger/store/trackerdb/sqlitedriver/catchpoint.go index f3d8242af7..8a986a3b9f 100644 --- a/ledger/store/trackerdb/sqlitedriver/catchpoint.go +++ b/ledger/store/trackerdb/sqlitedriver/catchpoint.go @@ -23,13 +23,14 @@ import ( "fmt" "time" + "github.com/mattn/go-sqlite3" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/ledger/encoded" "github.com/algorand/go-algorand/ledger/store/trackerdb" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/util/db" - "github.com/mattn/go-sqlite3" ) type catchpointReader struct { diff --git a/ledger/store/trackerdb/sqlitedriver/catchpoint_test.go b/ledger/store/trackerdb/sqlitedriver/catchpoint_test.go index aa5c54137c..600fbd7331 100644 --- a/ledger/store/trackerdb/sqlitedriver/catchpoint_test.go +++ b/ledger/store/trackerdb/sqlitedriver/catchpoint_test.go @@ -21,12 +21,13 @@ import ( "crypto/rand" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" storetesting "github.com/algorand/go-algorand/ledger/store/testing" "github.com/algorand/go-algorand/ledger/store/trackerdb" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) // Test functions operating on catchpointfirststageinfo table. diff --git a/ledger/store/trackerdb/sqlitedriver/encodedAccountsIter.go b/ledger/store/trackerdb/sqlitedriver/encodedAccountsIter.go index 79861c74d6..3266e84f50 100644 --- a/ledger/store/trackerdb/sqlitedriver/encodedAccountsIter.go +++ b/ledger/store/trackerdb/sqlitedriver/encodedAccountsIter.go @@ -20,11 +20,12 @@ import ( "context" "database/sql" + "github.com/algorand/msgp/msgp" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/ledger/encoded" "github.com/algorand/go-algorand/ledger/store/trackerdb" "github.com/algorand/go-algorand/util/db" - "github.com/algorand/msgp/msgp" ) // encodedAccountsBatchIter allows us to iterate over the accounts data stored in the accountbase table. diff --git a/ledger/store/trackerdb/sqlitedriver/schema.go b/ledger/store/trackerdb/sqlitedriver/schema.go index be2276ff6f..92b957b039 100644 --- a/ledger/store/trackerdb/sqlitedriver/schema.go +++ b/ledger/store/trackerdb/sqlitedriver/schema.go @@ -25,6 +25,8 @@ import ( "fmt" "time" + "github.com/mattn/go-sqlite3" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto/merklesignature" "github.com/algorand/go-algorand/crypto/merkletrie" @@ -35,7 +37,6 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/util/db" - "github.com/mattn/go-sqlite3" ) var accountsSchema = []string{ diff --git a/ledger/store/trackerdb/sqlitedriver/schema_test.go b/ledger/store/trackerdb/sqlitedriver/schema_test.go index 683d0932f6..f1b46ab168 100644 --- a/ledger/store/trackerdb/sqlitedriver/schema_test.go +++ b/ledger/store/trackerdb/sqlitedriver/schema_test.go @@ -23,6 +23,8 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/crypto/merklesignature" @@ -35,7 +37,6 @@ import ( "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/db" - "github.com/stretchr/testify/require" ) func TestAccountsReencoding(t *testing.T) { diff --git a/ledger/store/trackerdb/sqlitedriver/sql.go b/ledger/store/trackerdb/sqlitedriver/sql.go index f88adb7611..eeb298690f 100644 --- a/ledger/store/trackerdb/sqlitedriver/sql.go +++ b/ledger/store/trackerdb/sqlitedriver/sql.go @@ -19,6 +19,7 @@ package sqlitedriver import ( "database/sql" "fmt" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/ledger/store/trackerdb" diff --git a/ledger/store/trackerdb/sqlitedriver/sql_test.go b/ledger/store/trackerdb/sqlitedriver/sql_test.go index ac00b397d9..f1b1ac3299 100644 --- a/ledger/store/trackerdb/sqlitedriver/sql_test.go +++ b/ledger/store/trackerdb/sqlitedriver/sql_test.go @@ -21,13 +21,14 @@ import ( "database/sql" "testing" + "github.com/mattn/go-sqlite3" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/data/basics" storetesting "github.com/algorand/go-algorand/ledger/store/testing" "github.com/algorand/go-algorand/ledger/store/trackerdb" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/mattn/go-sqlite3" - "github.com/stretchr/testify/require" ) func TestKeyPrefixIntervalPreprocessing(t *testing.T) { diff --git a/ledger/store/trackerdb/sqlitedriver/sqlitedriver.go b/ledger/store/trackerdb/sqlitedriver/sqlitedriver.go index 5f8e2c040a..a3d988b849 100644 --- a/ledger/store/trackerdb/sqlitedriver/sqlitedriver.go +++ b/ledger/store/trackerdb/sqlitedriver/sqlitedriver.go @@ -23,13 +23,14 @@ import ( "testing" "time" + "github.com/mattn/go-sqlite3" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/ledger/encoded" "github.com/algorand/go-algorand/ledger/store/trackerdb" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/util/db" - "github.com/mattn/go-sqlite3" ) type trackerSQLStore struct { diff --git a/ledger/store/trackerdb/sqlitedriver/testing.go b/ledger/store/trackerdb/sqlitedriver/testing.go index 0f7bab6307..33021b3f79 100644 --- a/ledger/store/trackerdb/sqlitedriver/testing.go +++ b/ledger/store/trackerdb/sqlitedriver/testing.go @@ -22,6 +22,8 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" @@ -29,7 +31,6 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/util/db" - "github.com/stretchr/testify/require" ) // OpenForTesting opens a sqlite db file for testing purposes. diff --git a/ledger/store/trackerdb/testsuite/accounts_ext_kv_test.go b/ledger/store/trackerdb/testsuite/accounts_ext_kv_test.go index f2b5c79fd2..189c188c4d 100644 --- a/ledger/store/trackerdb/testsuite/accounts_ext_kv_test.go +++ b/ledger/store/trackerdb/testsuite/accounts_ext_kv_test.go @@ -19,13 +19,14 @@ package testsuite import ( "context" + "github.com/stretchr/testify/require" + "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/ledger/ledgercore" "github.com/algorand/go-algorand/ledger/store/trackerdb" "github.com/algorand/go-algorand/protocol" - "github.com/stretchr/testify/require" ) func init() { diff --git a/ledger/store/trackerdb/testsuite/accounts_kv_test.go b/ledger/store/trackerdb/testsuite/accounts_kv_test.go index 99c7d00e95..aed556f696 100644 --- a/ledger/store/trackerdb/testsuite/accounts_kv_test.go +++ b/ledger/store/trackerdb/testsuite/accounts_kv_test.go @@ -17,10 +17,11 @@ package testsuite import ( + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/ledger/store/trackerdb" ledgertesting "github.com/algorand/go-algorand/ledger/testing" - "github.com/stretchr/testify/require" ) func init() { diff --git a/ledger/store/trackerdb/testsuite/dbsemantics_test.go b/ledger/store/trackerdb/testsuite/dbsemantics_test.go index 72ea207462..fe12dd4da4 100644 --- a/ledger/store/trackerdb/testsuite/dbsemantics_test.go +++ b/ledger/store/trackerdb/testsuite/dbsemantics_test.go @@ -19,8 +19,9 @@ package testsuite import ( "context" - "github.com/algorand/go-algorand/ledger/store/trackerdb" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/ledger/store/trackerdb" ) func init() { diff --git a/ledger/store/trackerdb/testsuite/migration_test.go b/ledger/store/trackerdb/testsuite/migration_test.go index aa3060765d..fb6ce4d285 100644 --- a/ledger/store/trackerdb/testsuite/migration_test.go +++ b/ledger/store/trackerdb/testsuite/migration_test.go @@ -19,13 +19,14 @@ package testsuite import ( "context" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/ledger/store/trackerdb" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" - "github.com/stretchr/testify/require" ) func init() { diff --git a/ledger/store/trackerdb/testsuite/onlineaccounts_kv_test.go b/ledger/store/trackerdb/testsuite/onlineaccounts_kv_test.go index fb65f49b93..b2acba56ab 100644 --- a/ledger/store/trackerdb/testsuite/onlineaccounts_kv_test.go +++ b/ledger/store/trackerdb/testsuite/onlineaccounts_kv_test.go @@ -17,11 +17,12 @@ package testsuite import ( + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/ledger/store/trackerdb" "github.com/algorand/go-algorand/protocol" - "github.com/stretchr/testify/require" ) func init() { diff --git a/ledger/store/trackerdb/testsuite/pebbledb_test.go b/ledger/store/trackerdb/testsuite/pebbledb_test.go index fd3d42864c..6bfbe59f7f 100644 --- a/ledger/store/trackerdb/testsuite/pebbledb_test.go +++ b/ledger/store/trackerdb/testsuite/pebbledb_test.go @@ -20,10 +20,11 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/ledger/store/trackerdb/pebbledbdriver" "github.com/algorand/go-algorand/logging" - "github.com/stretchr/testify/require" ) func TestPebbleDB(t *testing.T) { diff --git a/ledger/store/trackerdb/testsuite/sqlitedb_test.go b/ledger/store/trackerdb/testsuite/sqlitedb_test.go index 94a6b93634..a145a9507e 100644 --- a/ledger/store/trackerdb/testsuite/sqlitedb_test.go +++ b/ledger/store/trackerdb/testsuite/sqlitedb_test.go @@ -20,10 +20,11 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/ledger/store/trackerdb/sqlitedriver" "github.com/algorand/go-algorand/logging" - "github.com/stretchr/testify/require" ) func TestSqliteDB(t *testing.T) { diff --git a/ledger/store/trackerdb/testsuite/stateproofs_kv_test.go b/ledger/store/trackerdb/testsuite/stateproofs_kv_test.go index a211257826..e0d2558693 100644 --- a/ledger/store/trackerdb/testsuite/stateproofs_kv_test.go +++ b/ledger/store/trackerdb/testsuite/stateproofs_kv_test.go @@ -19,10 +19,11 @@ package testsuite import ( "context" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/ledger/ledgercore" "github.com/algorand/go-algorand/ledger/store/trackerdb" - "github.com/stretchr/testify/require" ) func init() { diff --git a/ledger/store/trackerdb/testsuite/utils_test.go b/ledger/store/trackerdb/testsuite/utils_test.go index 658c852231..ec59df1daa 100644 --- a/ledger/store/trackerdb/testsuite/utils_test.go +++ b/ledger/store/trackerdb/testsuite/utils_test.go @@ -26,6 +26,8 @@ import ( "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" @@ -35,7 +37,6 @@ import ( "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/db" - "github.com/stretchr/testify/require" ) type customT struct { diff --git a/ledger/testing/consensusRange.go b/ledger/testing/consensusRange.go index 13b5f2f61b..9f52c647bd 100644 --- a/ledger/testing/consensusRange.go +++ b/ledger/testing/consensusRange.go @@ -21,9 +21,10 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/protocol" - "github.com/stretchr/testify/require" ) var consensusByNumber = []protocol.ConsensusVersion{ diff --git a/ledger/testing/consensusRange_test.go b/ledger/testing/consensusRange_test.go index 1b50e4b1ef..d6fa019605 100644 --- a/ledger/testing/consensusRange_test.go +++ b/ledger/testing/consensusRange_test.go @@ -19,10 +19,11 @@ package testing import ( "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) // TestReleasedVersion ensures that the necessary tidying is done when a new diff --git a/ledger/testing/randomAccounts.go b/ledger/testing/randomAccounts.go index ee5a5a6f66..af86364236 100644 --- a/ledger/testing/randomAccounts.go +++ b/ledger/testing/randomAccounts.go @@ -23,9 +23,8 @@ import ( "github.com/algorand/go-algorand/config/bounds" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" - "github.com/algorand/go-algorand/protocol" - "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/testing/randomAccounts_test.go b/ledger/testing/randomAccounts_test.go index cadd9aa1cb..334710eb18 100644 --- a/ledger/testing/randomAccounts_test.go +++ b/ledger/testing/randomAccounts_test.go @@ -20,10 +20,11 @@ import ( "reflect" "testing" + "github.com/stretchr/testify/assert" + "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/test/reflectionhelpers" - "github.com/stretchr/testify/assert" ) func TestAccounts(t *testing.T) { diff --git a/ledger/tracker.go b/ledger/tracker.go index 3b95df3240..413050c2e5 100644 --- a/ledger/tracker.go +++ b/ledger/tracker.go @@ -25,6 +25,8 @@ import ( "sync/atomic" "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" @@ -37,7 +39,6 @@ import ( "github.com/algorand/go-algorand/logging/telemetryspec" "github.com/algorand/go-algorand/protocol" "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/ledger/txnbench_test.go b/ledger/txnbench_test.go index 99d854998a..53a08a101a 100644 --- a/ledger/txnbench_test.go +++ b/ledger/txnbench_test.go @@ -22,13 +22,14 @@ import ( "strings" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/txntest" "github.com/algorand/go-algorand/ledger/ledgercore" ledgertesting "github.com/algorand/go-algorand/ledger/testing" "github.com/algorand/go-algorand/protocol" - "github.com/stretchr/testify/require" ) // BenchmarkTxnTypes compares the execution time of various txn types diff --git a/ledger/voters_test.go b/ledger/voters_test.go index 56a7f61fc8..836ac2e453 100644 --- a/ledger/voters_test.go +++ b/ledger/voters_test.go @@ -20,6 +20,8 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/crypto/merklesignature" @@ -29,7 +31,6 @@ import ( ledgertesting "github.com/algorand/go-algorand/ledger/testing" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) func addBlockToAccountsUpdate(t *testing.T, blk bookkeeping.Block, ml *mockLedgerForTracker) { diff --git a/libgoal/libgoal.go b/libgoal/libgoal.go index 876c0778ff..1c04c14f28 100644 --- a/libgoal/libgoal.go +++ b/libgoal/libgoal.go @@ -24,20 +24,19 @@ import ( "path/filepath" "time" - algodclient "github.com/algorand/go-algorand/daemon/algod/api/client" - v2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2" - kmdclient "github.com/algorand/go-algorand/daemon/kmd/client" - "github.com/algorand/go-algorand/ledger/ledgercore" - "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/model" "github.com/algorand/go-algorand/daemon/algod/api/spec/common" 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/ledger/ledgercore" "github.com/algorand/go-algorand/nodecontrol" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/util" diff --git a/libgoal/libgoal_test.go b/libgoal/libgoal_test.go index 9a008d9bf2..6fd3261a7c 100644 --- a/libgoal/libgoal_test.go +++ b/libgoal/libgoal_test.go @@ -20,12 +20,13 @@ import ( "fmt" "testing" + "github.com/stretchr/testify/assert" + "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/test/partitiontest" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestValidRounds(t *testing.T) { diff --git a/libgoal/participation/participation_test.go b/libgoal/participation/participation_test.go index e5f8187dc8..9d6746fb39 100644 --- a/libgoal/participation/participation_test.go +++ b/libgoal/participation/participation_test.go @@ -17,13 +17,13 @@ package participation import ( - "github.com/algorand/go-algorand/data/account" - "github.com/algorand/go-algorand/data/basics" - "github.com/algorand/go-algorand/test/partitiontest" + "testing" "github.com/stretchr/testify/require" - "testing" + "github.com/algorand/go-algorand/data/account" + "github.com/algorand/go-algorand/data/basics" + "github.com/algorand/go-algorand/test/partitiontest" ) func TestGenParticipationKeysTo_Install(t *testing.T) { diff --git a/logging/cyclicWriter.go b/logging/cyclicWriter.go index 45f40718a5..eb8b6deb8a 100644 --- a/logging/cyclicWriter.go +++ b/logging/cyclicWriter.go @@ -26,8 +26,9 @@ import ( "text/template" "time" - "github.com/algorand/go-algorand/util" "github.com/algorand/go-deadlock" + + "github.com/algorand/go-algorand/util" ) // CyclicFileWriter implements the io.Writer interface and wraps an underlying file. diff --git a/logging/cyclicWriter_test.go b/logging/cyclicWriter_test.go index 7c16e730b7..f5b16caa9d 100644 --- a/logging/cyclicWriter_test.go +++ b/logging/cyclicWriter_test.go @@ -24,8 +24,9 @@ import ( "strings" "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, liveFileName, archiveFileName string) { diff --git a/logging/logBuffer_test.go b/logging/logBuffer_test.go index cb448d40ba..c378b93a26 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 4df219f26e..b75c7eacf9 100644 --- a/logging/log_test.go +++ b/logging/log_test.go @@ -22,8 +22,9 @@ import ( "sync/atomic" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) /* diff --git a/logging/telemetryConfig_test.go b/logging/telemetryConfig_test.go index b99415e5ae..3eb44fe725 100644 --- a/logging/telemetryConfig_test.go +++ b/logging/telemetryConfig_test.go @@ -22,8 +22,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/netdeploy/remote/bootstrappedNetwork_test.go b/netdeploy/remote/bootstrappedNetwork_test.go index b0761c4895..316acce273 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/addr/addr_test.go b/network/addr/addr_test.go index 9bf6a2ce9f..917491f8bf 100644 --- a/network/addr/addr_test.go +++ b/network/addr/addr_test.go @@ -20,8 +20,9 @@ import ( "net/url" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) type urlCase struct { diff --git a/network/hybridNetwork_test.go b/network/hybridNetwork_test.go index d15ca20066..7d975555e3 100644 --- a/network/hybridNetwork_test.go +++ b/network/hybridNetwork_test.go @@ -21,11 +21,12 @@ import ( "testing" "time" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/libp2p/go-libp2p/core/peer" - "github.com/stretchr/testify/require" ) // TestHybridNetwork_DuplicateConn checks the same nodes do not connect over ws and p2p. diff --git a/network/limitcaller/rateLimitingTransport_test.go b/network/limitcaller/rateLimitingTransport_test.go index 6e7e007f20..fb8955b34d 100644 --- a/network/limitcaller/rateLimitingTransport_test.go +++ b/network/limitcaller/rateLimitingTransport_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" ) type ctStore struct { diff --git a/network/mesh.go b/network/mesh.go index c755f72e20..4f21ed329e 100644 --- a/network/mesh.go +++ b/network/mesh.go @@ -23,9 +23,10 @@ import ( "sync" "time" + "github.com/libp2p/go-libp2p/p2p/discovery/backoff" + "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/network/p2p" - "github.com/libp2p/go-libp2p/p2p/discovery/backoff" ) const meshThreadInterval = time.Minute diff --git a/network/mesh_test.go b/network/mesh_test.go index b2f8a76d7c..92ba33eff6 100644 --- a/network/mesh_test.go +++ b/network/mesh_test.go @@ -23,16 +23,17 @@ import ( "testing" "time" + pubsub "github.com/libp2p/go-libp2p-pubsub" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/network/limitcaller" p2piface "github.com/algorand/go-algorand/network/p2p" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - pubsub "github.com/libp2p/go-libp2p-pubsub" - "github.com/libp2p/go-libp2p/core/network" - "github.com/libp2p/go-libp2p/core/peer" - "github.com/stretchr/testify/require" ) // mockP2PService implements p2p.Service and counts DialPeersUntilTargetCount invocations. diff --git a/network/msgCompressor_test.go b/network/msgCompressor_test.go index 76717b4914..aaaf59c0b7 100644 --- a/network/msgCompressor_test.go +++ b/network/msgCompressor_test.go @@ -24,15 +24,16 @@ import ( "time" "github.com/DataDog/zstd" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/network/phonebook" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/libp2p/go-libp2p/core/peer" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) var ( diff --git a/network/netidentity.go b/network/netidentity.go index 317f7f0017..02555fd3c4 100644 --- a/network/netidentity.go +++ b/network/netidentity.go @@ -21,9 +21,10 @@ import ( "fmt" "net/http" + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-deadlock" ) // netidentity.go implements functionality to participate in an "Identity Challenge Exchange" diff --git a/network/netidentity_test.go b/network/netidentity_test.go index 396defde0d..ac9a0705e5 100644 --- a/network/netidentity_test.go +++ b/network/netidentity_test.go @@ -21,10 +21,11 @@ import ( "net/http" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) // if the scheme has a dedup name, attach to headers. otherwise, don't diff --git a/network/p2p/http.go b/network/p2p/http.go index ae3468aa23..f2373e135b 100644 --- a/network/p2p/http.go +++ b/network/p2p/http.go @@ -25,8 +25,6 @@ import ( "sync" "time" - "github.com/algorand/go-algorand/logging" - "github.com/algorand/go-algorand/network/limitcaller" "github.com/gorilla/mux" "github.com/libp2p/go-libp2p" "github.com/libp2p/go-libp2p/core/host" @@ -36,6 +34,9 @@ import ( bhost "github.com/libp2p/go-libp2p/p2p/host/basic" libp2phttp "github.com/libp2p/go-libp2p/p2p/http" "github.com/multiformats/go-multiaddr" + + "github.com/algorand/go-algorand/logging" + "github.com/algorand/go-algorand/network/limitcaller" ) // algorandP2pHTTPProtocol defines a libp2p protocol name for algorand's http over p2p messages diff --git a/network/p2p/p2p.go b/network/p2p/p2p.go index 44677ecb14..bc3d28c1f6 100644 --- a/network/p2p/p2p.go +++ b/network/p2p/p2p.go @@ -25,14 +25,6 @@ import ( "strings" "time" - "github.com/algorand/go-algorand/config" - "github.com/algorand/go-algorand/logging" - "github.com/algorand/go-algorand/network/limitcaller" - pstore "github.com/algorand/go-algorand/network/p2p/peerstore" - "github.com/algorand/go-algorand/network/phonebook" - "github.com/algorand/go-algorand/util/metrics" - "github.com/algorand/go-deadlock" - "github.com/libp2p/go-libp2p" pubsub "github.com/libp2p/go-libp2p-pubsub" "github.com/libp2p/go-libp2p/core/crypto" @@ -46,6 +38,15 @@ import ( "github.com/libp2p/go-libp2p/p2p/transport/tcp" "github.com/multiformats/go-multiaddr" manet "github.com/multiformats/go-multiaddr/net" + + "github.com/algorand/go-deadlock" + + "github.com/algorand/go-algorand/config" + "github.com/algorand/go-algorand/logging" + "github.com/algorand/go-algorand/network/limitcaller" + pstore "github.com/algorand/go-algorand/network/p2p/peerstore" + "github.com/algorand/go-algorand/network/phonebook" + "github.com/algorand/go-algorand/util/metrics" ) // SubNextCancellable is an abstraction for pubsub.Subscription diff --git a/network/p2p/peerID.go b/network/p2p/peerID.go index 291de66425..84b535f8e5 100644 --- a/network/p2p/peerID.go +++ b/network/p2p/peerID.go @@ -27,12 +27,12 @@ import ( "os" "path" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/algorand/go-algorand/config" algocrypto "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/util" - - "github.com/libp2p/go-libp2p/core/crypto" - "github.com/libp2p/go-libp2p/core/peer" ) // DefaultPrivKeyPath is the default path inside the node's root directory at which the private key diff --git a/network/p2p/peerstore/peerstore.go b/network/p2p/peerstore/peerstore.go index 3d37334d5d..23a9737fad 100644 --- a/network/p2p/peerstore/peerstore.go +++ b/network/p2p/peerstore/peerstore.go @@ -27,8 +27,9 @@ import ( libp2p "github.com/libp2p/go-libp2p/core/peerstore" mempstore "github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem" - "github.com/algorand/go-algorand/network/phonebook" "github.com/algorand/go-deadlock" + + "github.com/algorand/go-algorand/network/phonebook" ) // when using GetAddresses with getAllAddresses, all the addresses will be retrieved, regardless diff --git a/network/p2p/streams.go b/network/p2p/streams.go index 7f9cf0260f..b8ed478d5f 100644 --- a/network/p2p/streams.go +++ b/network/p2p/streams.go @@ -21,13 +21,15 @@ import ( "fmt" "io" - "github.com/algorand/go-algorand/logging" - "github.com/algorand/go-deadlock" "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/peer" "github.com/libp2p/go-libp2p/core/protocol" "github.com/multiformats/go-multiaddr" + + "github.com/algorand/go-deadlock" + + "github.com/algorand/go-algorand/logging" ) // streamManager implements network.Notifiee to create and manage streams for use with non-gossipsub protocols. diff --git a/network/p2p/streams_test.go b/network/p2p/streams_test.go index 6e71755d4f..5c7605ccab 100644 --- a/network/p2p/streams_test.go +++ b/network/p2p/streams_test.go @@ -22,16 +22,16 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/config" - "github.com/algorand/go-algorand/logging" - "github.com/algorand/go-algorand/network/p2p/peerstore" - "github.com/algorand/go-algorand/test/partitiontest" - "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/core/network" "github.com/libp2p/go-libp2p/core/peer" "github.com/multiformats/go-multiaddr" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/config" + "github.com/algorand/go-algorand/logging" + "github.com/algorand/go-algorand/network/p2p/peerstore" + "github.com/algorand/go-algorand/test/partitiontest" ) // TestConnectedLogsNonDialedOutgoingConnection tests that the Connected function diff --git a/network/p2p/testing/httpNode.go b/network/p2p/testing/httpNode.go index b1e8555ce5..ff226d7b55 100644 --- a/network/p2p/testing/httpNode.go +++ b/network/p2p/testing/httpNode.go @@ -23,13 +23,14 @@ import ( "net/http" "testing" - "github.com/algorand/go-algorand/components/mocks" - "github.com/algorand/go-algorand/network" - "github.com/algorand/go-algorand/network/p2p" "github.com/libp2p/go-libp2p" "github.com/libp2p/go-libp2p/core/host" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/components/mocks" + "github.com/algorand/go-algorand/network" + "github.com/algorand/go-algorand/network/p2p" ) // HTTPNode is a mock network node that uses libp2p and http. diff --git a/network/p2pMetainfo.go b/network/p2pMetainfo.go index 0646e817f6..39497bbaed 100644 --- a/network/p2pMetainfo.go +++ b/network/p2pMetainfo.go @@ -23,8 +23,9 @@ import ( "math" "net/http" - "github.com/algorand/go-algorand/data/basics" "github.com/libp2p/go-libp2p/core/peer" + + "github.com/algorand/go-algorand/data/basics" ) // peerMetaHeaders holds peer metadata headers similar to wsnet http.Header diff --git a/network/p2pMetainfo_test.go b/network/p2pMetainfo_test.go index 2d65ee2362..66089b8c61 100644 --- a/network/p2pMetainfo_test.go +++ b/network/p2pMetainfo_test.go @@ -22,11 +22,12 @@ import ( "net/http" "testing" - "github.com/algorand/go-algorand/logging" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/libp2p/go-libp2p/core/peer" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" + + "github.com/algorand/go-algorand/logging" + "github.com/algorand/go-algorand/test/partitiontest" ) // MockStream is a io.ReaderWriter testing mock diff --git a/network/p2pNetwork.go b/network/p2pNetwork.go index 452b843369..711f7d92a9 100644 --- a/network/p2pNetwork.go +++ b/network/p2pNetwork.go @@ -25,6 +25,14 @@ import ( "sync/atomic" "time" + pubsub "github.com/libp2p/go-libp2p-pubsub" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/multiformats/go-multiaddr" + manet "github.com/multiformats/go-multiaddr/net" + + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" algocrypto "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/logging" @@ -35,13 +43,6 @@ import ( "github.com/algorand/go-algorand/network/p2p/peerstore" "github.com/algorand/go-algorand/network/phonebook" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-deadlock" - - pubsub "github.com/libp2p/go-libp2p-pubsub" - "github.com/libp2p/go-libp2p/core/network" - "github.com/libp2p/go-libp2p/core/peer" - "github.com/multiformats/go-multiaddr" - manet "github.com/multiformats/go-multiaddr/net" ) // some arbitrary number TODO: figure out a better value based on peerSelector/fetcher algorithm diff --git a/network/p2pNetwork_test.go b/network/p2pNetwork_test.go index 9d8762912c..177baf47c2 100644 --- a/network/p2pNetwork_test.go +++ b/network/p2pNetwork_test.go @@ -30,6 +30,17 @@ import ( "testing" "time" + pubsub "github.com/libp2p/go-libp2p-pubsub" + pb "github.com/libp2p/go-libp2p-pubsub/pb" + "github.com/libp2p/go-libp2p/core/crypto" + "github.com/libp2p/go-libp2p/core/network" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/multiformats/go-multiaddr" + ma "github.com/multiformats/go-multiaddr" + "github.com/stretchr/testify/require" + + "github.com/algorand/go-deadlock" + "github.com/algorand/go-algorand/config" algocrypto "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/logging" @@ -41,16 +52,6 @@ import ( "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/uuid" - "github.com/algorand/go-deadlock" - - pubsub "github.com/libp2p/go-libp2p-pubsub" - pb "github.com/libp2p/go-libp2p-pubsub/pb" - "github.com/libp2p/go-libp2p/core/crypto" - "github.com/libp2p/go-libp2p/core/network" - "github.com/libp2p/go-libp2p/core/peer" - "github.com/multiformats/go-multiaddr" - ma "github.com/multiformats/go-multiaddr" - "github.com/stretchr/testify/require" ) func (n *P2PNetwork) hasPeers() bool { diff --git a/network/p2pPeer.go b/network/p2pPeer.go index fae62f5379..9eff715488 100644 --- a/network/p2pPeer.go +++ b/network/p2pPeer.go @@ -23,12 +23,13 @@ import ( "net" "time" - "github.com/algorand/go-algorand/logging" - "github.com/algorand/websocket" - "github.com/libp2p/go-libp2p/core/network" yamux "github.com/libp2p/go-yamux/v4" mnet "github.com/multiformats/go-multiaddr/net" + + "github.com/algorand/websocket" + + "github.com/algorand/go-algorand/logging" ) type wsPeerConnP2P struct { diff --git a/network/phonebook/phonebook_test.go b/network/phonebook/phonebook_test.go index ed2da2dbaf..a2f3a5ba95 100644 --- a/network/phonebook/phonebook_test.go +++ b/network/phonebook/phonebook_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 testPhonebookAll(t *testing.T, set []string, ph Phonebook) { diff --git a/network/topics_test.go b/network/topics_test.go index 0c830bc0a5..35a50f6c0b 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/vpack/dynamic_vpack_test.go b/network/vpack/dynamic_vpack_test.go index 612c9dc404..7820b25526 100644 --- a/network/vpack/dynamic_vpack_test.go +++ b/network/vpack/dynamic_vpack_test.go @@ -23,11 +23,12 @@ import ( "testing" "unsafe" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/agreement" "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" ) // TestStatefulEncoderDecoderSequence verifies that a StatefulEncoder/StatefulDecoder diff --git a/network/vpack/lru_table_test.go b/network/vpack/lru_table_test.go index 3e5d0a9c53..bb89781cf3 100644 --- a/network/vpack/lru_table_test.go +++ b/network/vpack/lru_table_test.go @@ -22,9 +22,10 @@ import ( "testing" "testing/quick" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) func TestLRUTableSizeValidation(t *testing.T) { diff --git a/network/vpack/parse_test.go b/network/vpack/parse_test.go index f69c577953..b7c9d6b40d 100644 --- a/network/vpack/parse_test.go +++ b/network/vpack/parse_test.go @@ -19,10 +19,11 @@ package vpack import ( "testing" + "github.com/stretchr/testify/assert" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/assert" ) // a string that is greater than the max 5-bit fixmap size diff --git a/network/vpack/proposal_window_test.go b/network/vpack/proposal_window_test.go index 0161107240..a8738ba8d3 100644 --- a/network/vpack/proposal_window_test.go +++ b/network/vpack/proposal_window_test.go @@ -19,8 +19,9 @@ package vpack import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func makeTestPropBundle(seed byte) proposalEntry { diff --git a/network/vpack/rapid_test.go b/network/vpack/rapid_test.go index fc58c57528..32c63a0bd3 100644 --- a/network/vpack/rapid_test.go +++ b/network/vpack/rapid_test.go @@ -23,12 +23,13 @@ import ( "testing" "unsafe" + "github.com/stretchr/testify/require" + "pgregory.net/rapid" + "github.com/algorand/go-algorand/agreement" "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" - "pgregory.net/rapid" ) // TestCheckStatelessEncoder tests the StatelessEncoder/Decoder using randomly generated votes diff --git a/network/vpack/vpack_test.go b/network/vpack/vpack_test.go index 3b6bc5643c..78fe3691aa 100644 --- a/network/vpack/vpack_test.go +++ b/network/vpack/vpack_test.go @@ -23,11 +23,12 @@ import ( "testing" "unsafe" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/agreement" "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" ) // checkVoteValid analyzes a vote to determine if it would cause compression errors and what kind. diff --git a/network/websocketProxy_test.go b/network/websocketProxy_test.go index a08c18db1e..f08f397b38 100644 --- a/network/websocketProxy_test.go +++ b/network/websocketProxy_test.go @@ -28,10 +28,12 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + + "github.com/algorand/websocket" + "github.com/algorand/go-algorand/network/addr" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/websocket" - "github.com/stretchr/testify/require" ) var testProxyUpgrader = websocket.Upgrader{ diff --git a/network/wsNetwork_test.go b/network/wsNetwork_test.go index 8603fbf4ff..73b54c7d94 100644 --- a/network/wsNetwork_test.go +++ b/network/wsNetwork_test.go @@ -40,20 +40,19 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/internal/rapidgen" - "github.com/algorand/go-algorand/network/phonebook" - "pgregory.net/rapid" - "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" + "pgregory.net/rapid" "github.com/algorand/go-deadlock" "github.com/algorand/websocket" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" + "github.com/algorand/go-algorand/internal/rapidgen" "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/logging/telemetryspec" + "github.com/algorand/go-algorand/network/phonebook" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util" diff --git a/node/netprio_test.go b/node/netprio_test.go index 1073c88f75..c4e99f5dc8 100644 --- a/node/netprio_test.go +++ b/node/netprio_test.go @@ -20,9 +20,10 @@ import ( "encoding/base64" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) // TestBase64AllocboundSize tests that the base64 encoded size of the Nonce is the same as the allocbound diff --git a/nodecontrol/algodControl_test.go b/nodecontrol/algodControl_test.go index 1cd5849830..92268d50d5 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 91a83932ab..12c89e2564 100644 --- a/protocol/codec_test.go +++ b/protocol/codec_test.go @@ -23,9 +23,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 27654bb120..06e62b8151 100644 --- a/protocol/codec_tester.go +++ b/protocol/codec_tester.go @@ -27,12 +27,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/hash_test.go b/protocol/hash_test.go index 459a0160e9..a30b46f477 100644 --- a/protocol/hash_test.go +++ b/protocol/hash_test.go @@ -20,8 +20,9 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/assert" + + "github.com/algorand/go-algorand/test/partitiontest" ) // TestHashIDPrefix checks if any HashID const declared in hash.go is a prefix of another. diff --git a/protocol/tags_test.go b/protocol/tags_test.go index e1a42bb85a..cab4ba1b13 100644 --- a/protocol/tags_test.go +++ b/protocol/tags_test.go @@ -24,8 +24,9 @@ import ( "strconv" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) // getConstValues uses the AST to get a list of the values of declared const diff --git a/rpcs/healthService_test.go b/rpcs/healthService_test.go index 3b5284c5dd..f42ce3df0a 100644 --- a/rpcs/healthService_test.go +++ b/rpcs/healthService_test.go @@ -22,10 +22,11 @@ import ( "path" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/network" "github.com/algorand/go-algorand/network/addr" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) func TestHealthService_ServeHTTP(t *testing.T) { diff --git a/shared/pingpong/accounts_test.go b/shared/pingpong/accounts_test.go index c35c032aec..c243c8c207 100644 --- a/shared/pingpong/accounts_test.go +++ b/shared/pingpong/accounts_test.go @@ -20,11 +20,11 @@ import ( "encoding/binary" "testing" + "github.com/stretchr/testify/assert" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/data/basics" - "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/assert" ) func makeKeyFromSeed(i uint64) *crypto.SignatureSecrets { diff --git a/stateproof/verify/stateproof_test.go b/stateproof/verify/stateproof_test.go index 07e3d9d79c..832f8fd903 100644 --- a/stateproof/verify/stateproof_test.go +++ b/stateproof/verify/stateproof_test.go @@ -17,6 +17,10 @@ package verify import ( + "testing" + + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto/stateproof" "github.com/algorand/go-algorand/data/basics" @@ -26,8 +30,6 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" - "testing" ) func invokeValidateStateProof(latestRoundInIntervalHdr *bookkeeping.BlockHeader, diff --git a/stateproof/worker_test.go b/stateproof/worker_test.go index de1de63c91..7a08c71fdc 100644 --- a/stateproof/worker_test.go +++ b/stateproof/worker_test.go @@ -30,6 +30,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/merklearray" @@ -46,7 +48,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/test/e2e-go/features/accountPerf/sixMillion_test.go b/test/e2e-go/features/accountPerf/sixMillion_test.go index 1ed8e1cb4e..7e9ea5c579 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/test/e2e-go/features/incentives/suspension_test.go b/test/e2e-go/features/incentives/suspension_test.go index 965b837c98..cef9ef432d 100644 --- a/test/e2e-go/features/incentives/suspension_test.go +++ b/test/e2e-go/features/incentives/suspension_test.go @@ -22,9 +22,9 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/config" "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated/model" "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/libgoal" diff --git a/test/e2e-go/features/incentives/whalejoin_test.go b/test/e2e-go/features/incentives/whalejoin_test.go index 082b803f83..bad75c7536 100644 --- a/test/e2e-go/features/incentives/whalejoin_test.go +++ b/test/e2e-go/features/incentives/whalejoin_test.go @@ -21,9 +21,9 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/config" "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/daemon/algod/api/server/v2/generated/model" "github.com/algorand/go-algorand/data/basics" diff --git a/test/e2e-go/features/p2p/p2p_basic_test.go b/test/e2e-go/features/p2p/p2p_basic_test.go index 2f5614ee5d..24de2254f6 100644 --- a/test/e2e-go/features/p2p/p2p_basic_test.go +++ b/test/e2e-go/features/p2p/p2p_basic_test.go @@ -22,11 +22,12 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "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" ) func testP2PWithConfig(t *testing.T, templateName string) *fixtures.RestClientFixture { diff --git a/test/e2e-go/features/privatenet/privatenet_test.go b/test/e2e-go/features/privatenet/privatenet_test.go index a5bbe3a542..13b71eebc4 100644 --- a/test/e2e-go/features/privatenet/privatenet_test.go +++ b/test/e2e-go/features/privatenet/privatenet_test.go @@ -20,9 +20,10 @@ package privatenet import ( "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/test/framework/fixtures" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) // TestPrivateNetworkImportKeys tests that part keys can be exported and diff --git a/test/e2e-go/features/transactions/logicsig_test.go b/test/e2e-go/features/transactions/logicsig_test.go index 4a03e928d4..fd6ac53b17 100644 --- a/test/e2e-go/features/transactions/logicsig_test.go +++ b/test/e2e-go/features/transactions/logicsig_test.go @@ -20,11 +20,12 @@ import ( "path/filepath" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/data/txntest" "github.com/algorand/go-algorand/test/framework/fixtures" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) func TestLogicSigSizeBeforePooling(t *testing.T) { diff --git a/test/e2e-go/features/transactions/proof_test.go b/test/e2e-go/features/transactions/proof_test.go index ad95f8ef35..ff8a86c358 100644 --- a/test/e2e-go/features/transactions/proof_test.go +++ b/test/e2e-go/features/transactions/proof_test.go @@ -20,13 +20,14 @@ import ( "path/filepath" "testing" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "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/features/transactions/sendReceive_test.go b/test/e2e-go/features/transactions/sendReceive_test.go index 7c38c12a88..d6e51d4715 100644 --- a/test/e2e-go/features/transactions/sendReceive_test.go +++ b/test/e2e-go/features/transactions/sendReceive_test.go @@ -24,7 +24,6 @@ import ( "github.com/stretchr/testify/require" "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated/model" - "github.com/algorand/go-algorand/test/framework/fixtures" "github.com/algorand/go-algorand/test/partitiontest" ) diff --git a/test/e2e-go/restAPI/helpers.go b/test/e2e-go/restAPI/helpers.go index 7dec672cf2..e143be2c24 100644 --- a/test/e2e-go/restAPI/helpers.go +++ b/test/e2e-go/restAPI/helpers.go @@ -22,10 +22,11 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + v2 "github.com/algorand/go-algorand/daemon/algod/api/server/v2" "github.com/algorand/go-algorand/libgoal" "github.com/algorand/go-algorand/test/framework/fixtures" - "github.com/stretchr/testify/require" ) // helper generates a random Uppercase Alphabetic ASCII char diff --git a/test/e2e-go/restAPI/other/appsRestAPI_test.go b/test/e2e-go/restAPI/other/appsRestAPI_test.go index 7cb209d9ee..cd9077a87d 100644 --- a/test/e2e-go/restAPI/other/appsRestAPI_test.go +++ b/test/e2e-go/restAPI/other/appsRestAPI_test.go @@ -26,6 +26,8 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/daemon/algod/api/client" "github.com/algorand/go-algorand/daemon/algod/api/server/v2/generated/model" @@ -33,11 +35,9 @@ import ( "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/data/transactions/logic" "github.com/algorand/go-algorand/libgoal" + helper "github.com/algorand/go-algorand/test/e2e-go/restAPI" "github.com/algorand/go-algorand/test/framework/fixtures" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" - - helper "github.com/algorand/go-algorand/test/e2e-go/restAPI" ) func TestPendingTransactionInfoInnerTxnAssetCreate(t *testing.T) { diff --git a/test/e2e-go/restAPI/other/misc_test.go b/test/e2e-go/restAPI/other/misc_test.go index aa4e72750f..6ff1e25822 100644 --- a/test/e2e-go/restAPI/other/misc_test.go +++ b/test/e2e-go/restAPI/other/misc_test.go @@ -22,12 +22,13 @@ import ( "path/filepath" "testing" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/daemon/algod/api/client" "github.com/algorand/go-algorand/test/framework/fixtures" "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/tokens" - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestDisabledAPIConfig(t *testing.T) { diff --git a/test/e2e-go/restAPI/simulate/simulateRestAPI_test.go b/test/e2e-go/restAPI/simulate/simulateRestAPI_test.go index 47903fa7b8..a752638f50 100644 --- a/test/e2e-go/restAPI/simulate/simulateRestAPI_test.go +++ b/test/e2e-go/restAPI/simulate/simulateRestAPI_test.go @@ -25,6 +25,8 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/daemon/algod/api/client" @@ -36,11 +38,9 @@ import ( "github.com/algorand/go-algorand/ledger/simulation" "github.com/algorand/go-algorand/libgoal" "github.com/algorand/go-algorand/protocol" + helper "github.com/algorand/go-algorand/test/e2e-go/restAPI" "github.com/algorand/go-algorand/test/framework/fixtures" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" - - helper "github.com/algorand/go-algorand/test/e2e-go/restAPI" ) func TestSimulateTxnTracerDevMode(t *testing.T) { diff --git a/test/e2e-go/restAPI/stateproof/stateproofRestAPI_test.go b/test/e2e-go/restAPI/stateproof/stateproofRestAPI_test.go index f86230dc16..ffc1c1c0ca 100644 --- a/test/e2e-go/restAPI/stateproof/stateproofRestAPI_test.go +++ b/test/e2e-go/restAPI/stateproof/stateproofRestAPI_test.go @@ -21,6 +21,8 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/crypto" "github.com/algorand/go-algorand/crypto/merklesignature" @@ -28,12 +30,10 @@ import ( "github.com/algorand/go-algorand/data/basics" "github.com/algorand/go-algorand/data/transactions" "github.com/algorand/go-algorand/protocol" + helper "github.com/algorand/go-algorand/test/e2e-go/restAPI" "github.com/algorand/go-algorand/test/framework/fixtures" "github.com/algorand/go-algorand/test/partitiontest" "github.com/algorand/go-algorand/util/db" - "github.com/stretchr/testify/require" - - helper "github.com/algorand/go-algorand/test/e2e-go/restAPI" ) func TestStateProofInParticipationInfo(t *testing.T) { diff --git a/test/e2e-go/upgrades/stateproof_participation_test.go b/test/e2e-go/upgrades/stateproof_participation_test.go index 0049a0bdd8..f0ec77fd50 100644 --- a/test/e2e-go/upgrades/stateproof_participation_test.go +++ b/test/e2e-go/upgrades/stateproof_participation_test.go @@ -21,6 +21,8 @@ import ( "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" @@ -28,7 +30,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" ) 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 218d82ca86..8a7f946d83 100644 --- a/test/framework/fixtures/expectFixture.go +++ b/test/framework/fixtures/expectFixture.go @@ -26,8 +26,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/fixture.go b/test/framework/fixtures/fixture.go index 025719a7f9..87d67526bb 100644 --- a/test/framework/fixtures/fixture.go +++ b/test/framework/fixtures/fixture.go @@ -19,8 +19,9 @@ package fixtures import ( "testing" - "github.com/algorand/go-algorand/protocol" "github.com/algorand/go-deadlock" + + "github.com/algorand/go-algorand/protocol" ) // TestingTB is identical to testing.TB, beside the private method. diff --git a/test/framework/fixtures/restClientFixture.go b/test/framework/fixtures/restClientFixture.go index 01ac30c8f6..8c24642f01 100644 --- a/test/framework/fixtures/restClientFixture.go +++ b/test/framework/fixtures/restClientFixture.go @@ -24,15 +24,13 @@ import ( "github.com/stretchr/testify/require" - "github.com/algorand/go-algorand/data/basics" - "github.com/algorand/go-algorand/data/bookkeeping" - "github.com/algorand/go-algorand/netdeploy" - "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/model" - + "github.com/algorand/go-algorand/data/basics" + "github.com/algorand/go-algorand/data/bookkeeping" "github.com/algorand/go-algorand/libgoal" + "github.com/algorand/go-algorand/netdeploy" "github.com/algorand/go-algorand/nodecontrol" "github.com/algorand/go-algorand/util/tokens" ) diff --git a/tools/debug/logfilter/main_test.go b/tools/debug/logfilter/main_test.go index 416351e07c..888fd2d620 100644 --- a/tools/debug/logfilter/main_test.go +++ b/tools/debug/logfilter/main_test.go @@ -24,8 +24,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/debug/transplanter/main.go b/tools/debug/transplanter/main.go index 76782d262c..e6ec587e56 100644 --- a/tools/debug/transplanter/main.go +++ b/tools/debug/transplanter/main.go @@ -34,6 +34,8 @@ import ( "github.com/golang/snappy" _ "github.com/mattn/go-sqlite3" + "github.com/algorand/go-codec/codec" + "github.com/algorand/go-algorand/agreement" "github.com/algorand/go-algorand/config" "github.com/algorand/go-algorand/config/bounds" @@ -46,7 +48,6 @@ import ( "github.com/algorand/go-algorand/logging" "github.com/algorand/go-algorand/node" "github.com/algorand/go-algorand/protocol" - "github.com/algorand/go-codec/codec" ) var dataDir = flag.String("d", "", "Data directory to track to get files from") diff --git a/tools/network/bootstrap_test.go b/tools/network/bootstrap_test.go index dee9607a7e..c027bb9aff 100644 --- a/tools/network/bootstrap_test.go +++ b/tools/network/bootstrap_test.go @@ -20,8 +20,9 @@ import ( "context" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestReadFromSRVPriority(t *testing.T) { diff --git a/tools/network/dnssec/anchor_test.go b/tools/network/dnssec/anchor_test.go index 03b01a20a0..60ea899064 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 0a785ba06b..3dee975126 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 f18886a3cb..c97060a458 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 5481766e4f..9c5960c913 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/sort_test.go b/tools/network/dnssec/sort_test.go index a3ef3bfee8..8938d75670 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/trustedchain_test.go b/tools/network/dnssec/trustedchain_test.go index 4d7e1b7dfe..3c1987883e 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 9e78fa512c..c47bb1e80b 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 3c14cc993e..2f0e688cef 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/util/condvar/timedwait_test.go b/util/condvar/timedwait_test.go index e0d9393fa5..32be7c254d 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 c368aef57d..61307621ff 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 aa3670fdab..a8baee5f7f 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/execpool/stream_test.go b/util/execpool/stream_test.go index 3c2c1cfb7f..fe7bbd227b 100644 --- a/util/execpool/stream_test.go +++ b/util/execpool/stream_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" ) // implements BatchProcessor interface for testing purposes diff --git a/util/metrics/counter_test.go b/util/metrics/counter_test.go index 51e2d44691..79f44a50fd 100644 --- a/util/metrics/counter_test.go +++ b/util/metrics/counter_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 CounterTest struct { diff --git a/util/metrics/gauge_test.go b/util/metrics/gauge_test.go index 679c613088..5556b2cc65 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/metrics_test.go b/util/metrics/metrics_test.go index c382b8e8cf..431e071c87 100644 --- a/util/metrics/metrics_test.go +++ b/util/metrics/metrics_test.go @@ -25,9 +25,11 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/test/partitiontest" - "github.com/algorand/go-deadlock" "github.com/stretchr/testify/require" + + "github.com/algorand/go-deadlock" + + "github.com/algorand/go-algorand/test/partitiontest" ) type MetricTest struct { diff --git a/util/metrics/opencensus_test.go b/util/metrics/opencensus_test.go index 849aa5f076..6b8b794f21 100644 --- a/util/metrics/opencensus_test.go +++ b/util/metrics/opencensus_test.go @@ -23,12 +23,12 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" "go.opencensus.io/stats" "go.opencensus.io/stats/view" "go.opencensus.io/tag" "github.com/algorand/go-algorand/test/partitiontest" - "github.com/stretchr/testify/require" ) // TestDHTOpenCensusMetrics ensures both count and distribution stats are properly converted to our metrics diff --git a/util/metrics/prometheus_test.go b/util/metrics/prometheus_test.go index 1eded61598..203c6d6965 100644 --- a/util/metrics/prometheus_test.go +++ b/util/metrics/prometheus_test.go @@ -24,9 +24,10 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/prometheus/client_golang/prometheus" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestPrometheusMetrics(t *testing.T) { diff --git a/util/metrics/registry_test.go b/util/metrics/registry_test.go index c8251008f6..4709844e74 100644 --- a/util/metrics/registry_test.go +++ b/util/metrics/registry_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 TestWriteAdd(t *testing.T) { diff --git a/util/metrics/reporter_test.go b/util/metrics/reporter_test.go index add4e1e781..846e90ce72 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/runtime_test.go b/util/metrics/runtime_test.go index 5949de2853..b04d789972 100644 --- a/util/metrics/runtime_test.go +++ b/util/metrics/runtime_test.go @@ -21,8 +21,9 @@ import ( "strings" "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestRuntimeMetrics(t *testing.T) { diff --git a/util/metrics/tagcounter_test.go b/util/metrics/tagcounter_test.go index 12dec38933..9cca2e966c 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/rateLimit.go b/util/rateLimit.go index 2bb13af97c..ec7775daed 100644 --- a/util/rateLimit.go +++ b/util/rateLimit.go @@ -26,8 +26,9 @@ import ( "sync" "time" - "github.com/algorand/go-algorand/util/metrics" "github.com/algorand/go-deadlock" + + "github.com/algorand/go-algorand/util/metrics" ) var errConManDropped = errors.New("congestionManager prevented client from consuming capacity") diff --git a/util/rateLimit_test.go b/util/rateLimit_test.go index 16d28ff020..c544781af0 100644 --- a/util/rateLimit_test.go +++ b/util/rateLimit_test.go @@ -20,8 +20,9 @@ import ( "testing" "time" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/assert" + + "github.com/algorand/go-algorand/test/partitiontest" ) type mockClient string diff --git a/util/s3/s3Helper_test.go b/util/s3/s3Helper_test.go index 5303f6628b..b29bddfef1 100644 --- a/util/s3/s3Helper_test.go +++ b/util/s3/s3Helper_test.go @@ -22,8 +22,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/set_test.go b/util/set_test.go index 03da2c912e..c33df9241b 100644 --- a/util/set_test.go +++ b/util/set_test.go @@ -19,8 +19,9 @@ package util import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestMakeSet(t *testing.T) { diff --git a/util/util_test.go b/util/util_test.go index 1ad4cbcd67..bfb596f5e3 100644 --- a/util/util_test.go +++ b/util/util_test.go @@ -19,8 +19,9 @@ package util import ( "testing" - "github.com/algorand/go-algorand/test/partitiontest" "github.com/stretchr/testify/require" + + "github.com/algorand/go-algorand/test/partitiontest" ) func TestGetTotalMemory(t *testing.T) {