From f0ac02e3560c1ef9c23c2654d9120ed9f2bd3d7f Mon Sep 17 00:00:00 2001 From: h5law <53987565+h5law@users.noreply.github.com> Date: Sun, 17 Dec 2023 01:51:44 +0000 Subject: [PATCH 1/3] feat: fix imports --- app/app.go | 2 -- cmd/pocketd/cmd/root.go | 4 --- e2e/tests/session_steps_test.go | 3 +- pkg/appgateserver/config/errors.go | 4 ++- pkg/appgateserver/errors.go | 4 ++- .../events/replay_client_example_test.go | 1 + pkg/client/keyring/errors.go | 4 ++- pkg/client/supplier/client_test.go | 5 +-- pkg/client/tx/client_integration_test.go | 3 +- pkg/client/tx/errors.go | 4 ++- pkg/deps/config/suppliers.go | 3 +- pkg/observable/errors.go | 4 ++- pkg/observable/interface.go | 4 ++- pkg/polylog/context.go | 4 ++- pkg/relayer/config/errors.go | 4 ++- pkg/relayer/miner/gen/template.go | 4 ++- pkg/relayer/protocol/errors.go | 4 ++- pkg/relayer/session/errors.go | 4 ++- pkg/sdk/errors.go | 4 ++- pkg/sdk/urls.go | 4 ++- pkg/signer/simple_signer.go | 4 ++- testutil/testerrors/require.go | 4 ++- testutil/yaml/yaml.go | 4 ++- tools/scripts/goimports-revisor.sh | 35 +++++++++++++++++++ x/application/client/cli/query.go | 6 +--- x/application/client/cli/tx.go | 3 +- .../client/cli/tx_undelegate_from_gateway.go | 4 +-- x/application/client/config/errors.go | 4 ++- x/application/module.go | 8 ++--- .../simulation/delegate_to_gateway.go | 6 ++-- .../simulation/undelegate_from_gateway.go | 6 ++-- .../simulation/unstake_application.go | 1 - x/application/types/key_application.go | 4 ++- .../types/message_delegate_to_gateway_test.go | 4 +-- .../message_undelegate_from_gateway_test.go | 4 +-- x/gateway/client/cli/query.go | 6 +--- x/gateway/client/cli/tx.go | 3 +- x/gateway/keeper/gateway_test.go | 8 ++--- x/gateway/module.go | 8 ++--- x/gateway/module_simulation.go | 8 ++--- x/gateway/types/genesis_test.go | 6 ++-- x/gateway/types/key_gateway.go | 4 ++- x/pocket/client/cli/query.go | 6 +--- x/pocket/client/cli/tx.go | 3 +- x/pocket/module.go | 8 ++--- x/pocket/types/codec.go | 2 -- x/pocket/types/genesis.go | 2 -- x/service/client/cli/query.go | 6 +--- x/service/client/cli/tx.go | 3 +- x/service/module.go | 8 ++--- x/service/types/codec.go | 2 -- x/service/types/genesis.go | 2 -- x/service/types/relay.go | 4 ++- x/session/client/cli/helpers_test.go | 3 +- x/session/client/cli/query.go | 6 +--- x/session/client/cli/tx.go | 3 +- x/session/types/codec.go | 2 -- x/session/types/genesis.go | 2 -- x/supplier/client/config/errors.go | 4 ++- x/supplier/module.go | 8 ++--- x/supplier/module_simulation.go | 8 ++--- x/supplier/types/genesis_test.go | 3 +- x/supplier/types/key_proof.go | 4 ++- x/supplier/types/key_supplier.go | 4 ++- x/tokenomics/client/cli/query.go | 6 +--- x/tokenomics/client/cli/tx.go | 3 +- x/tokenomics/genesis_test.go | 3 +- x/tokenomics/keeper/msg_server_test.go | 3 +- x/tokenomics/keeper/params_test.go | 3 +- x/tokenomics/keeper/query_params_test.go | 3 +- x/tokenomics/module.go | 2 -- x/tokenomics/types/codec.go | 2 -- x/tokenomics/types/genesis.go | 2 -- x/tokenomics/types/genesis_test.go | 3 +- 74 files changed, 176 insertions(+), 160 deletions(-) create mode 100755 tools/scripts/goimports-revisor.sh diff --git a/app/app.go b/app/app.go index 352038462..0503a96eb 100644 --- a/app/app.go +++ b/app/app.go @@ -7,8 +7,6 @@ import ( "os" "path/filepath" - // this line is used by starport scaffolding # stargate/app/moduleImport - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" dbm "github.com/cometbft/cometbft-db" diff --git a/cmd/pocketd/cmd/root.go b/cmd/pocketd/cmd/root.go index 55b7071fc..6708ea486 100644 --- a/cmd/pocketd/cmd/root.go +++ b/cmd/pocketd/cmd/root.go @@ -7,8 +7,6 @@ import ( "path/filepath" "strings" - // this line is used by starport scaffolding # root/moduleImport - dbm "github.com/cometbft/cometbft-db" tmcfg "github.com/cometbft/cometbft/config" tmcli "github.com/cometbft/cometbft/libs/cli" @@ -39,8 +37,6 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" - // this line is used by starport scaffolding # root/moduleImport - "github.com/pokt-network/poktroll/app" appparams "github.com/pokt-network/poktroll/app/params" appgateservercmd "github.com/pokt-network/poktroll/pkg/appgateserver/cmd" diff --git a/e2e/tests/session_steps_test.go b/e2e/tests/session_steps_test.go index 96248e243..0104bd589 100644 --- a/e2e/tests/session_steps_test.go +++ b/e2e/tests/session_steps_test.go @@ -11,13 +11,14 @@ import ( "time" abci "github.com/cometbft/cometbft/abci/types" + "github.com/stretchr/testify/require" + "github.com/pokt-network/poktroll/pkg/client/events" "github.com/pokt-network/poktroll/pkg/either" "github.com/pokt-network/poktroll/pkg/observable" "github.com/pokt-network/poktroll/pkg/observable/channel" "github.com/pokt-network/poktroll/testutil/testclient" suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" - "github.com/stretchr/testify/require" ) const ( diff --git a/pkg/appgateserver/config/errors.go b/pkg/appgateserver/config/errors.go index 3d4d6831f..bad78c42c 100644 --- a/pkg/appgateserver/config/errors.go +++ b/pkg/appgateserver/config/errors.go @@ -1,6 +1,8 @@ package config -import sdkerrors "cosmossdk.io/errors" +import ( + sdkerrors "cosmossdk.io/errors" +) var ( codespace = "appgate_config" diff --git a/pkg/appgateserver/errors.go b/pkg/appgateserver/errors.go index 17f5456d6..fb2ecf002 100644 --- a/pkg/appgateserver/errors.go +++ b/pkg/appgateserver/errors.go @@ -1,6 +1,8 @@ package appgateserver -import sdkerrors "cosmossdk.io/errors" +import ( + sdkerrors "cosmossdk.io/errors" +) var ( codespace = "appgateserver" diff --git a/pkg/client/events/replay_client_example_test.go b/pkg/client/events/replay_client_example_test.go index 69cb3a2f0..aae91ed17 100644 --- a/pkg/client/events/replay_client_example_test.go +++ b/pkg/client/events/replay_client_example_test.go @@ -6,6 +6,7 @@ import ( "fmt" "cosmossdk.io/depinject" + "github.com/pokt-network/poktroll/pkg/client/events" "github.com/pokt-network/poktroll/pkg/observable" "github.com/pokt-network/poktroll/pkg/polylog" diff --git a/pkg/client/keyring/errors.go b/pkg/client/keyring/errors.go index 7be8a677a..c078a54ed 100644 --- a/pkg/client/keyring/errors.go +++ b/pkg/client/keyring/errors.go @@ -1,6 +1,8 @@ package keyring -import "cosmossdk.io/errors" +import ( + "cosmossdk.io/errors" +) var ( // ErrEmptySigningKeyName represents an error which indicates that the diff --git a/pkg/client/supplier/client_test.go b/pkg/client/supplier/client_test.go index 4c92ef3ba..4665cb646 100644 --- a/pkg/client/supplier/client_test.go +++ b/pkg/client/supplier/client_test.go @@ -8,6 +8,9 @@ import ( "cosmossdk.io/depinject" "github.com/golang/mock/gomock" + "github.com/pokt-network/smt" + "github.com/stretchr/testify/require" + "github.com/pokt-network/poktroll/pkg/client/keyring" "github.com/pokt-network/poktroll/pkg/client/supplier" "github.com/pokt-network/poktroll/testutil/mockclient" @@ -15,8 +18,6 @@ import ( "github.com/pokt-network/poktroll/testutil/testclient/testtx" sessiontypes "github.com/pokt-network/poktroll/x/session/types" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" - "github.com/pokt-network/smt" - "github.com/stretchr/testify/require" ) const ( diff --git a/pkg/client/tx/client_integration_test.go b/pkg/client/tx/client_integration_test.go index 2716e9f64..8ee55c7f3 100644 --- a/pkg/client/tx/client_integration_test.go +++ b/pkg/client/tx/client_integration_test.go @@ -10,13 +10,12 @@ import ( "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + "github.com/pokt-network/poktroll/pkg/client" "github.com/pokt-network/poktroll/pkg/client/tx" "github.com/pokt-network/poktroll/testutil/testclient/testblock" "github.com/pokt-network/poktroll/testutil/testclient/testeventsquery" "github.com/pokt-network/poktroll/testutil/testclient/testkeyring" "github.com/pokt-network/poktroll/testutil/testclient/testtx" - - "github.com/pokt-network/poktroll/pkg/client" apptypes "github.com/pokt-network/poktroll/x/application/types" ) diff --git a/pkg/client/tx/errors.go b/pkg/client/tx/errors.go index 328d7a51d..142618399 100644 --- a/pkg/client/tx/errors.go +++ b/pkg/client/tx/errors.go @@ -1,6 +1,8 @@ package tx -import errorsmod "cosmossdk.io/errors" +import ( + errorsmod "cosmossdk.io/errors" +) var ( // ErrInvalidMsg signifies that there was an issue in validating the diff --git a/pkg/deps/config/suppliers.go b/pkg/deps/config/suppliers.go index d91dc2822..7ec63d72a 100644 --- a/pkg/deps/config/suppliers.go +++ b/pkg/deps/config/suppliers.go @@ -9,6 +9,8 @@ import ( cosmosflags "github.com/cosmos/cosmos-sdk/client/flags" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" grpc "github.com/cosmos/gogoproto/grpc" + "github.com/spf13/cobra" + "github.com/pokt-network/poktroll/pkg/client/block" "github.com/pokt-network/poktroll/pkg/client/events" "github.com/pokt-network/poktroll/pkg/client/query" @@ -17,7 +19,6 @@ import ( "github.com/pokt-network/poktroll/pkg/crypto/rings" "github.com/pokt-network/poktroll/pkg/polylog" "github.com/pokt-network/poktroll/pkg/sdk" - "github.com/spf13/cobra" ) // SupplierFn is a function that is used to supply a depinject config. diff --git a/pkg/observable/errors.go b/pkg/observable/errors.go index c34f2f7d6..47d39d088 100644 --- a/pkg/observable/errors.go +++ b/pkg/observable/errors.go @@ -1,6 +1,8 @@ package observable -import errorsmod "cosmossdk.io/errors" +import ( + errorsmod "cosmossdk.io/errors" +) var ( ErrObserverClosed = errorsmod.Register(codespace, 1, "observer is closed") diff --git a/pkg/observable/interface.go b/pkg/observable/interface.go index d86da414f..aa0becd6e 100644 --- a/pkg/observable/interface.go +++ b/pkg/observable/interface.go @@ -1,6 +1,8 @@ package observable -import "context" +import ( + "context" +) // NOTE: We explicitly decided to write a small and custom notifications package // to keep logic simple and minimal. If the needs & requirements of this library ever diff --git a/pkg/polylog/context.go b/pkg/polylog/context.go index 0e6904b64..a346bf19c 100644 --- a/pkg/polylog/context.go +++ b/pkg/polylog/context.go @@ -1,6 +1,8 @@ package polylog -import "context" +import ( + "context" +) // CtxKey is the key used to store the polylog.Logger in a context.Context. This // is **independant** of any logger-implementation-specific context key that may diff --git a/pkg/relayer/config/errors.go b/pkg/relayer/config/errors.go index cabd22e76..fed389db5 100644 --- a/pkg/relayer/config/errors.go +++ b/pkg/relayer/config/errors.go @@ -1,6 +1,8 @@ package config -import sdkerrors "cosmossdk.io/errors" +import ( + sdkerrors "cosmossdk.io/errors" +) var ( codespace = "relayminer_config" diff --git a/pkg/relayer/miner/gen/template.go b/pkg/relayer/miner/gen/template.go index c75e761a4..aaa768813 100644 --- a/pkg/relayer/miner/gen/template.go +++ b/pkg/relayer/miner/gen/template.go @@ -1,6 +1,8 @@ package main -import "text/template" +import ( + "text/template" +) var ( relayFixtureLineFmt = "\t\t\"%x\"," diff --git a/pkg/relayer/protocol/errors.go b/pkg/relayer/protocol/errors.go index f578bf8e0..36807f59c 100644 --- a/pkg/relayer/protocol/errors.go +++ b/pkg/relayer/protocol/errors.go @@ -1,6 +1,8 @@ package protocol -import errorsmod "cosmossdk.io/errors" +import ( + errorsmod "cosmossdk.io/errors" +) var ( ErrDifficulty = errorsmod.New(codespace, 1, "difficulty error") diff --git a/pkg/relayer/session/errors.go b/pkg/relayer/session/errors.go index 520c85bc1..db8b2bfea 100644 --- a/pkg/relayer/session/errors.go +++ b/pkg/relayer/session/errors.go @@ -1,6 +1,8 @@ package session -import sdkerrors "cosmossdk.io/errors" +import ( + sdkerrors "cosmossdk.io/errors" +) var ( codespace = "relayer_session" diff --git a/pkg/sdk/errors.go b/pkg/sdk/errors.go index c7d1c4cc7..d7222ffd6 100644 --- a/pkg/sdk/errors.go +++ b/pkg/sdk/errors.go @@ -1,6 +1,8 @@ package sdk -import sdkerrors "cosmossdk.io/errors" +import ( + sdkerrors "cosmossdk.io/errors" +) var ( codespace = "poktrollsdk" diff --git a/pkg/sdk/urls.go b/pkg/sdk/urls.go index de182f150..0cf6d0572 100644 --- a/pkg/sdk/urls.go +++ b/pkg/sdk/urls.go @@ -1,6 +1,8 @@ package sdk -import "fmt" +import ( + "fmt" +) // HostToWebsocketURL converts the provided host into a websocket URL that can // be used to subscribe to onchain events and query the chain via a client diff --git a/pkg/signer/simple_signer.go b/pkg/signer/simple_signer.go index 432c1c8a3..753a59144 100644 --- a/pkg/signer/simple_signer.go +++ b/pkg/signer/simple_signer.go @@ -1,6 +1,8 @@ package signer -import "github.com/cosmos/cosmos-sdk/crypto/keyring" +import ( + "github.com/cosmos/cosmos-sdk/crypto/keyring" +) var _ Signer = (*SimpleSigner)(nil) diff --git a/testutil/testerrors/require.go b/testutil/testerrors/require.go index 624cdaf6e..d6a34366f 100644 --- a/testutil/testerrors/require.go +++ b/testutil/testerrors/require.go @@ -1,6 +1,8 @@ package testerrors -import errorsmod "cosmossdk.io/errors" +import ( + errorsmod "cosmossdk.io/errors" +) var ( // ErrAsync is returned when a test assertion fails in a goroutine other than diff --git a/testutil/yaml/yaml.go b/testutil/yaml/yaml.go index 56a29cc89..875800a13 100644 --- a/testutil/yaml/yaml.go +++ b/testutil/yaml/yaml.go @@ -1,6 +1,8 @@ package yaml -import "strings" +import ( + "strings" +) // YAML is indentation sensitive, so we need to remove the extra indentation from the test cases and make sure // it is space-indented instead of tab-indented, otherwise the YAML parser will fail diff --git a/tools/scripts/goimports-revisor.sh b/tools/scripts/goimports-revisor.sh new file mode 100755 index 000000000..ba39b8a43 --- /dev/null +++ b/tools/scripts/goimports-revisor.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +FLAGS=( + -rm-unused + -use-cache + -imports-order "std,general,company,project,blanked,dotted" + -project-name "github.com/pokt-network/poktrolld" +) + +# Define a function to check for the exclusion comment and run goimports-reviser +process_file() { + local file=$1 + if ! grep -q "//go:build ignore" "$file"; then + echo "Processing $file" + goimports-reviser "${FLAGS[@]}" "$file" + fi +} + +export -f process_file + +# Find all .go files, excluding specified patterns, and process them +find . -type f -name '*.go' \ + ! -path "./vendors/*" \ + ! -path "./ts-client/*" \ + ! -path "./.git/*" \ + ! -path "./.github/*" \ + ! -path "./bin/*" \ + ! -path "./docs/*" \ + ! -path "./localnet/*" \ + ! -path "./proto/*" \ + ! -path "./tools/*" \ + ! -name "*mock.go" \ + ! -name "*pb.go" \ + -exec bash -c 'process_file "$0"' {} \; + diff --git a/x/application/client/cli/query.go b/x/application/client/cli/query.go index 86cd73b25..e73bcbcc0 100644 --- a/x/application/client/cli/query.go +++ b/x/application/client/cli/query.go @@ -2,13 +2,9 @@ package cli import ( "fmt" - // "strings" - - "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" - // sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/spf13/cobra" "github.com/pokt-network/poktroll/x/application/types" ) diff --git a/x/application/client/cli/tx.go b/x/application/client/cli/tx.go index cb09f9b3f..4df336b14 100644 --- a/x/application/client/cli/tx.go +++ b/x/application/client/cli/tx.go @@ -4,10 +4,9 @@ import ( "fmt" "time" + "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" - "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" "github.com/pokt-network/poktroll/x/application/types" ) diff --git a/x/application/client/cli/tx_undelegate_from_gateway.go b/x/application/client/cli/tx_undelegate_from_gateway.go index 50a755d8f..7a30d1b8a 100644 --- a/x/application/client/cli/tx_undelegate_from_gateway.go +++ b/x/application/client/cli/tx_undelegate_from_gateway.go @@ -3,12 +3,12 @@ package cli import ( "strconv" - "github.com/pokt-network/poktroll/x/application/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/spf13/cobra" + + "github.com/pokt-network/poktroll/x/application/types" ) var _ = strconv.Itoa(0) diff --git a/x/application/client/config/errors.go b/x/application/client/config/errors.go index fea38af57..a97fd7adb 100644 --- a/x/application/client/config/errors.go +++ b/x/application/client/config/errors.go @@ -1,6 +1,8 @@ package config -import sdkerrors "cosmossdk.io/errors" +import ( + sdkerrors "cosmossdk.io/errors" +) var ( codespace = "applicationconfig" diff --git a/x/application/module.go b/x/application/module.go index 44ba01150..472a6b6a1 100644 --- a/x/application/module.go +++ b/x/application/module.go @@ -5,18 +5,14 @@ import ( "encoding/json" "fmt" - // this line is used by starport scaffolding # 1 - - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" "github.com/pokt-network/poktroll/x/application/client/cli" "github.com/pokt-network/poktroll/x/application/keeper" diff --git a/x/application/simulation/delegate_to_gateway.go b/x/application/simulation/delegate_to_gateway.go index 37070e16e..5339bd7f4 100644 --- a/x/application/simulation/delegate_to_gateway.go +++ b/x/application/simulation/delegate_to_gateway.go @@ -3,12 +3,12 @@ package simulation import ( "math/rand" - "github.com/pokt-network/poktroll/x/application/keeper" - "github.com/pokt-network/poktroll/x/application/types" - "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + + "github.com/pokt-network/poktroll/x/application/keeper" + "github.com/pokt-network/poktroll/x/application/types" ) func SimulateMsgDelegateToGateway( diff --git a/x/application/simulation/undelegate_from_gateway.go b/x/application/simulation/undelegate_from_gateway.go index 9ada988fd..36e1f4776 100644 --- a/x/application/simulation/undelegate_from_gateway.go +++ b/x/application/simulation/undelegate_from_gateway.go @@ -3,12 +3,12 @@ package simulation import ( "math/rand" - "github.com/pokt-network/poktroll/x/application/keeper" - "github.com/pokt-network/poktroll/x/application/types" - "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + + "github.com/pokt-network/poktroll/x/application/keeper" + "github.com/pokt-network/poktroll/x/application/types" ) func SimulateMsgUndelegateFromGateway( diff --git a/x/application/simulation/unstake_application.go b/x/application/simulation/unstake_application.go index 3dcccd3b5..9c6b556ab 100644 --- a/x/application/simulation/unstake_application.go +++ b/x/application/simulation/unstake_application.go @@ -4,7 +4,6 @@ import ( "math/rand" "github.com/cosmos/cosmos-sdk/baseapp" - sdk "github.com/cosmos/cosmos-sdk/types" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" diff --git a/x/application/types/key_application.go b/x/application/types/key_application.go index 02cbefc4e..8e6d382fd 100644 --- a/x/application/types/key_application.go +++ b/x/application/types/key_application.go @@ -1,6 +1,8 @@ package types -import "encoding/binary" +import ( + "encoding/binary" +) var _ binary.ByteOrder diff --git a/x/application/types/message_delegate_to_gateway_test.go b/x/application/types/message_delegate_to_gateway_test.go index 0769d3e65..e5c4ee2d9 100644 --- a/x/application/types/message_delegate_to_gateway_test.go +++ b/x/application/types/message_delegate_to_gateway_test.go @@ -3,9 +3,9 @@ package types import ( "testing" - "github.com/pokt-network/poktroll/testutil/sample" - "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/testutil/sample" ) func TestMsgDelegateToGateway_ValidateBasic(t *testing.T) { diff --git a/x/application/types/message_undelegate_from_gateway_test.go b/x/application/types/message_undelegate_from_gateway_test.go index b40b520e9..87ad660c9 100644 --- a/x/application/types/message_undelegate_from_gateway_test.go +++ b/x/application/types/message_undelegate_from_gateway_test.go @@ -3,9 +3,9 @@ package types import ( "testing" - "github.com/pokt-network/poktroll/testutil/sample" - "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/testutil/sample" ) func TestMsgUndelegateFromGateway_ValidateBasic(t *testing.T) { diff --git a/x/gateway/client/cli/query.go b/x/gateway/client/cli/query.go index b896f7583..fcb5c60c3 100644 --- a/x/gateway/client/cli/query.go +++ b/x/gateway/client/cli/query.go @@ -2,13 +2,9 @@ package cli import ( "fmt" - // "strings" - - "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" - // sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/spf13/cobra" "github.com/pokt-network/poktroll/x/gateway/types" ) diff --git a/x/gateway/client/cli/tx.go b/x/gateway/client/cli/tx.go index 52be2fb88..8b2c441da 100644 --- a/x/gateway/client/cli/tx.go +++ b/x/gateway/client/cli/tx.go @@ -4,10 +4,9 @@ import ( "fmt" "time" + "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" - "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" "github.com/pokt-network/poktroll/x/gateway/types" ) diff --git a/x/gateway/keeper/gateway_test.go b/x/gateway/keeper/gateway_test.go index b343591a0..d20148e8d 100644 --- a/x/gateway/keeper/gateway_test.go +++ b/x/gateway/keeper/gateway_test.go @@ -4,15 +4,15 @@ import ( "strconv" "testing" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + "github.com/stretchr/testify/require" + "github.com/pokt-network/poktroll/cmd/pocketd/cmd" keepertest "github.com/pokt-network/poktroll/testutil/keeper" "github.com/pokt-network/poktroll/testutil/nullify" "github.com/pokt-network/poktroll/x/gateway/keeper" "github.com/pokt-network/poktroll/x/gateway/types" - - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/stretchr/testify/require" ) // Prevent strconv unused error diff --git a/x/gateway/module.go b/x/gateway/module.go index 86f16fb7c..1c19cfe4f 100644 --- a/x/gateway/module.go +++ b/x/gateway/module.go @@ -5,18 +5,14 @@ import ( "encoding/json" "fmt" - // this line is used by starport scaffolding # 1 - - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" "github.com/pokt-network/poktroll/x/gateway/client/cli" "github.com/pokt-network/poktroll/x/gateway/keeper" diff --git a/x/gateway/module_simulation.go b/x/gateway/module_simulation.go index 0aab36ae9..c4b468c9d 100644 --- a/x/gateway/module_simulation.go +++ b/x/gateway/module_simulation.go @@ -3,15 +3,15 @@ package gateway import ( "math/rand" - "github.com/pokt-network/poktroll/testutil/sample" - gatewaysimulation "github.com/pokt-network/poktroll/x/gateway/simulation" - "github.com/pokt-network/poktroll/x/gateway/types" - "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + + "github.com/pokt-network/poktroll/testutil/sample" + gatewaysimulation "github.com/pokt-network/poktroll/x/gateway/simulation" + "github.com/pokt-network/poktroll/x/gateway/types" ) // avoid unused import issue diff --git a/x/gateway/types/genesis_test.go b/x/gateway/types/genesis_test.go index ea1e6cdf8..34fd6434a 100644 --- a/x/gateway/types/genesis_test.go +++ b/x/gateway/types/genesis_test.go @@ -3,11 +3,11 @@ package types_test import ( "testing" - "github.com/pokt-network/poktroll/testutil/sample" - "github.com/pokt-network/poktroll/x/gateway/types" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/testutil/sample" + "github.com/pokt-network/poktroll/x/gateway/types" ) func TestGenesisState_Validate(t *testing.T) { diff --git a/x/gateway/types/key_gateway.go b/x/gateway/types/key_gateway.go index 8fe1e65f7..3a41d8ef6 100644 --- a/x/gateway/types/key_gateway.go +++ b/x/gateway/types/key_gateway.go @@ -1,6 +1,8 @@ package types -import "encoding/binary" +import ( + "encoding/binary" +) var _ binary.ByteOrder diff --git a/x/pocket/client/cli/query.go b/x/pocket/client/cli/query.go index 7fb94d626..39b9b831f 100644 --- a/x/pocket/client/cli/query.go +++ b/x/pocket/client/cli/query.go @@ -2,13 +2,9 @@ package cli import ( "fmt" - // "strings" - - "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" - // sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/spf13/cobra" "github.com/pokt-network/poktroll/x/pocket/types" ) diff --git a/x/pocket/client/cli/tx.go b/x/pocket/client/cli/tx.go index 70032b9b8..9c6589273 100644 --- a/x/pocket/client/cli/tx.go +++ b/x/pocket/client/cli/tx.go @@ -4,10 +4,9 @@ import ( "fmt" "time" + "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" - "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" "github.com/pokt-network/poktroll/x/pocket/types" ) diff --git a/x/pocket/module.go b/x/pocket/module.go index 684ea1d95..e8569ded2 100644 --- a/x/pocket/module.go +++ b/x/pocket/module.go @@ -5,18 +5,14 @@ import ( "encoding/json" "fmt" - // this line is used by starport scaffolding # 1 - - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" "github.com/pokt-network/poktroll/x/pocket/client/cli" "github.com/pokt-network/poktroll/x/pocket/keeper" diff --git a/x/pocket/types/codec.go b/x/pocket/types/codec.go index 39e7482ab..8eb43994e 100644 --- a/x/pocket/types/codec.go +++ b/x/pocket/types/codec.go @@ -1,8 +1,6 @@ package types import ( - // this line is used by starport scaffolding # 1 - "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/msgservice" diff --git a/x/pocket/types/genesis.go b/x/pocket/types/genesis.go index 0af9b4416..2c15cd92a 100644 --- a/x/pocket/types/genesis.go +++ b/x/pocket/types/genesis.go @@ -1,8 +1,6 @@ package types -import ( // this line is used by starport scaffolding # genesis/types/import -) // DefaultIndex is the default global index const DefaultIndex uint64 = 1 diff --git a/x/service/client/cli/query.go b/x/service/client/cli/query.go index f52a37c7a..19acd64ee 100644 --- a/x/service/client/cli/query.go +++ b/x/service/client/cli/query.go @@ -2,13 +2,9 @@ package cli import ( "fmt" - // "strings" - - "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" - // sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/spf13/cobra" "github.com/pokt-network/poktroll/x/service/types" ) diff --git a/x/service/client/cli/tx.go b/x/service/client/cli/tx.go index b4c63f360..6c39035c6 100644 --- a/x/service/client/cli/tx.go +++ b/x/service/client/cli/tx.go @@ -4,10 +4,9 @@ import ( "fmt" "time" + "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" - "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" "github.com/pokt-network/poktroll/x/service/types" ) diff --git a/x/service/module.go b/x/service/module.go index a7ebd35f2..d1cb2373a 100644 --- a/x/service/module.go +++ b/x/service/module.go @@ -5,18 +5,14 @@ import ( "encoding/json" "fmt" - // this line is used by starport scaffolding # 1 - - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" "github.com/pokt-network/poktroll/x/service/client/cli" "github.com/pokt-network/poktroll/x/service/keeper" diff --git a/x/service/types/codec.go b/x/service/types/codec.go index 39e7482ab..8eb43994e 100644 --- a/x/service/types/codec.go +++ b/x/service/types/codec.go @@ -1,8 +1,6 @@ package types import ( - // this line is used by starport scaffolding # 1 - "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/msgservice" diff --git a/x/service/types/genesis.go b/x/service/types/genesis.go index 0af9b4416..2c15cd92a 100644 --- a/x/service/types/genesis.go +++ b/x/service/types/genesis.go @@ -1,8 +1,6 @@ package types -import ( // this line is used by starport scaffolding # genesis/types/import -) // DefaultIndex is the default global index const DefaultIndex uint64 = 1 diff --git a/x/service/types/relay.go b/x/service/types/relay.go index 7815fc1ab..f54e4a696 100644 --- a/x/service/types/relay.go +++ b/x/service/types/relay.go @@ -1,6 +1,8 @@ package types -import "crypto/sha256" +import ( + "crypto/sha256" +) // getSignableBytes returns the bytes resulting from marshaling the relay request // A value receiver is used to avoid overwriting any pre-existing signature diff --git a/x/session/client/cli/helpers_test.go b/x/session/client/cli/helpers_test.go index 484bca4db..1308b2164 100644 --- a/x/session/client/cli/helpers_test.go +++ b/x/session/client/cli/helpers_test.go @@ -5,12 +5,13 @@ import ( "strconv" "testing" + "github.com/stretchr/testify/require" + "github.com/pokt-network/poktroll/cmd/pocketd/cmd" "github.com/pokt-network/poktroll/testutil/network" apptypes "github.com/pokt-network/poktroll/x/application/types" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" suppliertypes "github.com/pokt-network/poktroll/x/supplier/types" - "github.com/stretchr/testify/require" ) // Dummy variable to avoid unused import error. diff --git a/x/session/client/cli/query.go b/x/session/client/cli/query.go index cd6bf6f70..89842df01 100644 --- a/x/session/client/cli/query.go +++ b/x/session/client/cli/query.go @@ -2,13 +2,9 @@ package cli import ( "fmt" - // "strings" - - "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" - // sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/spf13/cobra" "github.com/pokt-network/poktroll/x/session/types" ) diff --git a/x/session/client/cli/tx.go b/x/session/client/cli/tx.go index 248ae5237..8a74db699 100644 --- a/x/session/client/cli/tx.go +++ b/x/session/client/cli/tx.go @@ -4,10 +4,9 @@ import ( "fmt" "time" + "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" - "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" "github.com/pokt-network/poktroll/x/session/types" ) diff --git a/x/session/types/codec.go b/x/session/types/codec.go index 39e7482ab..8eb43994e 100644 --- a/x/session/types/codec.go +++ b/x/session/types/codec.go @@ -1,8 +1,6 @@ package types import ( - // this line is used by starport scaffolding # 1 - "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/msgservice" diff --git a/x/session/types/genesis.go b/x/session/types/genesis.go index 0af9b4416..2c15cd92a 100644 --- a/x/session/types/genesis.go +++ b/x/session/types/genesis.go @@ -1,8 +1,6 @@ package types -import ( // this line is used by starport scaffolding # genesis/types/import -) // DefaultIndex is the default global index const DefaultIndex uint64 = 1 diff --git a/x/supplier/client/config/errors.go b/x/supplier/client/config/errors.go index 0739daf93..f72b07d2e 100644 --- a/x/supplier/client/config/errors.go +++ b/x/supplier/client/config/errors.go @@ -1,6 +1,8 @@ package config -import sdkerrors "cosmossdk.io/errors" +import ( + sdkerrors "cosmossdk.io/errors" +) var ( codespace = "supplierconfig" diff --git a/x/supplier/module.go b/x/supplier/module.go index a39dc9303..e3a34d61d 100644 --- a/x/supplier/module.go +++ b/x/supplier/module.go @@ -5,18 +5,14 @@ import ( "encoding/json" "fmt" - // this line is used by starport scaffolding # 1 - - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - abci "github.com/cometbft/cometbft/abci/types" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" "github.com/pokt-network/poktroll/x/supplier/client/cli" "github.com/pokt-network/poktroll/x/supplier/keeper" diff --git a/x/supplier/module_simulation.go b/x/supplier/module_simulation.go index eb30e7dd3..6ae9852e8 100644 --- a/x/supplier/module_simulation.go +++ b/x/supplier/module_simulation.go @@ -3,15 +3,15 @@ package supplier import ( "math/rand" - "github.com/pokt-network/poktroll/testutil/sample" - suppliersimulation "github.com/pokt-network/poktroll/x/supplier/simulation" - "github.com/pokt-network/poktroll/x/supplier/types" - "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + + "github.com/pokt-network/poktroll/testutil/sample" + suppliersimulation "github.com/pokt-network/poktroll/x/supplier/simulation" + "github.com/pokt-network/poktroll/x/supplier/types" ) // avoid unused import issue diff --git a/x/supplier/types/genesis_test.go b/x/supplier/types/genesis_test.go index 5895fd717..5625fa435 100644 --- a/x/supplier/types/genesis_test.go +++ b/x/supplier/types/genesis_test.go @@ -4,10 +4,11 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + "github.com/pokt-network/poktroll/testutil/sample" sharedtypes "github.com/pokt-network/poktroll/x/shared/types" "github.com/pokt-network/poktroll/x/supplier/types" - "github.com/stretchr/testify/require" ) func TestGenesisState_Validate(t *testing.T) { diff --git a/x/supplier/types/key_proof.go b/x/supplier/types/key_proof.go index 6307f4ccb..3d97c1fd9 100644 --- a/x/supplier/types/key_proof.go +++ b/x/supplier/types/key_proof.go @@ -1,6 +1,8 @@ package types -import "encoding/binary" +import ( + "encoding/binary" +) var _ binary.ByteOrder diff --git a/x/supplier/types/key_supplier.go b/x/supplier/types/key_supplier.go index 20f28a5c1..ebd8a50bc 100644 --- a/x/supplier/types/key_supplier.go +++ b/x/supplier/types/key_supplier.go @@ -1,6 +1,8 @@ package types -import "encoding/binary" +import ( + "encoding/binary" +) var _ binary.ByteOrder diff --git a/x/tokenomics/client/cli/query.go b/x/tokenomics/client/cli/query.go index c11674331..979ae9f5f 100644 --- a/x/tokenomics/client/cli/query.go +++ b/x/tokenomics/client/cli/query.go @@ -2,13 +2,9 @@ package cli import ( "fmt" - // "strings" - - "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" - // sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/spf13/cobra" "github.com/pokt-network/poktroll/x/tokenomics/types" ) diff --git a/x/tokenomics/client/cli/tx.go b/x/tokenomics/client/cli/tx.go index ca73e6c23..ab1079fcd 100644 --- a/x/tokenomics/client/cli/tx.go +++ b/x/tokenomics/client/cli/tx.go @@ -4,10 +4,9 @@ import ( "fmt" "time" + "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" - "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" "github.com/pokt-network/poktroll/x/tokenomics/types" ) diff --git a/x/tokenomics/genesis_test.go b/x/tokenomics/genesis_test.go index cc07aef93..24faddd65 100644 --- a/x/tokenomics/genesis_test.go +++ b/x/tokenomics/genesis_test.go @@ -3,11 +3,12 @@ package tokenomics_test import ( "testing" + "github.com/stretchr/testify/require" + keepertest "github.com/pokt-network/poktroll/testutil/keeper" "github.com/pokt-network/poktroll/testutil/nullify" "github.com/pokt-network/poktroll/x/tokenomics" "github.com/pokt-network/poktroll/x/tokenomics/types" - "github.com/stretchr/testify/require" ) func TestGenesis(t *testing.T) { diff --git a/x/tokenomics/keeper/msg_server_test.go b/x/tokenomics/keeper/msg_server_test.go index 2af3f9161..3847e8d6f 100644 --- a/x/tokenomics/keeper/msg_server_test.go +++ b/x/tokenomics/keeper/msg_server_test.go @@ -5,10 +5,11 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + keepertest "github.com/pokt-network/poktroll/testutil/keeper" "github.com/pokt-network/poktroll/x/tokenomics/keeper" "github.com/pokt-network/poktroll/x/tokenomics/types" - "github.com/stretchr/testify/require" ) func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { diff --git a/x/tokenomics/keeper/params_test.go b/x/tokenomics/keeper/params_test.go index 3fb77ea65..44d89dab7 100644 --- a/x/tokenomics/keeper/params_test.go +++ b/x/tokenomics/keeper/params_test.go @@ -3,9 +3,10 @@ package keeper_test import ( "testing" + "github.com/stretchr/testify/require" + testkeeper "github.com/pokt-network/poktroll/testutil/keeper" "github.com/pokt-network/poktroll/x/tokenomics/types" - "github.com/stretchr/testify/require" ) func TestGetParams(t *testing.T) { diff --git a/x/tokenomics/keeper/query_params_test.go b/x/tokenomics/keeper/query_params_test.go index 86fdf619c..bc037d00c 100644 --- a/x/tokenomics/keeper/query_params_test.go +++ b/x/tokenomics/keeper/query_params_test.go @@ -4,9 +4,10 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/stretchr/testify/require" + testkeeper "github.com/pokt-network/poktroll/testutil/keeper" "github.com/pokt-network/poktroll/x/tokenomics/types" - "github.com/stretchr/testify/require" ) func TestParamsQuery(t *testing.T) { diff --git a/x/tokenomics/module.go b/x/tokenomics/module.go index e88612416..e54983755 100644 --- a/x/tokenomics/module.go +++ b/x/tokenomics/module.go @@ -5,8 +5,6 @@ import ( "encoding/json" "fmt" - // this line is used by starport scaffolding # 1 - abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" diff --git a/x/tokenomics/types/codec.go b/x/tokenomics/types/codec.go index 39e7482ab..8eb43994e 100644 --- a/x/tokenomics/types/codec.go +++ b/x/tokenomics/types/codec.go @@ -1,8 +1,6 @@ package types import ( - // this line is used by starport scaffolding # 1 - "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/msgservice" diff --git a/x/tokenomics/types/genesis.go b/x/tokenomics/types/genesis.go index 0af9b4416..2c15cd92a 100644 --- a/x/tokenomics/types/genesis.go +++ b/x/tokenomics/types/genesis.go @@ -1,8 +1,6 @@ package types -import ( // this line is used by starport scaffolding # genesis/types/import -) // DefaultIndex is the default global index const DefaultIndex uint64 = 1 diff --git a/x/tokenomics/types/genesis_test.go b/x/tokenomics/types/genesis_test.go index 0f9412dab..9b48cff86 100644 --- a/x/tokenomics/types/genesis_test.go +++ b/x/tokenomics/types/genesis_test.go @@ -3,8 +3,9 @@ package types_test import ( "testing" - "github.com/pokt-network/poktroll/x/tokenomics/types" "github.com/stretchr/testify/require" + + "github.com/pokt-network/poktroll/x/tokenomics/types" ) func TestGenesisState_Validate(t *testing.T) { From 5f3d93f2283d1beb74423c40bb6cc0af7a895fa3 Mon Sep 17 00:00:00 2001 From: h5law <53987565+h5law@users.noreply.github.com> Date: Sun, 17 Dec 2023 02:05:24 +0000 Subject: [PATCH 2/3] chore: import consistency --- app/app.go | 2 ++ cmd/pocketd/cmd/root.go | 4 ++++ pkg/client/keyring/errors.go | 8 ++++---- pkg/client/tx/errors.go | 16 ++++++++-------- pkg/observable/errors.go | 4 ++-- pkg/relayer/protocol/errors.go | 4 ++-- testutil/testerrors/require.go | 4 ++-- x/gateway/module.go | 2 ++ x/pocket/module.go | 2 ++ x/pocket/types/codec.go | 2 ++ x/service/module.go | 2 ++ x/service/types/codec.go | 2 ++ x/session/types/codec.go | 2 ++ x/supplier/module.go | 2 ++ x/tokenomics/module.go | 2 ++ x/tokenomics/types/codec.go | 2 ++ 16 files changed, 42 insertions(+), 18 deletions(-) diff --git a/app/app.go b/app/app.go index 0503a96eb..352038462 100644 --- a/app/app.go +++ b/app/app.go @@ -7,6 +7,8 @@ import ( "os" "path/filepath" + // this line is used by starport scaffolding # stargate/app/moduleImport + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" dbm "github.com/cometbft/cometbft-db" diff --git a/cmd/pocketd/cmd/root.go b/cmd/pocketd/cmd/root.go index 6708ea486..55b7071fc 100644 --- a/cmd/pocketd/cmd/root.go +++ b/cmd/pocketd/cmd/root.go @@ -7,6 +7,8 @@ import ( "path/filepath" "strings" + // this line is used by starport scaffolding # root/moduleImport + dbm "github.com/cometbft/cometbft-db" tmcfg "github.com/cometbft/cometbft/config" tmcli "github.com/cometbft/cometbft/libs/cli" @@ -37,6 +39,8 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" + // this line is used by starport scaffolding # root/moduleImport + "github.com/pokt-network/poktroll/app" appparams "github.com/pokt-network/poktroll/app/params" appgateservercmd "github.com/pokt-network/poktroll/pkg/appgateserver/cmd" diff --git a/pkg/client/keyring/errors.go b/pkg/client/keyring/errors.go index c078a54ed..9718ebab5 100644 --- a/pkg/client/keyring/errors.go +++ b/pkg/client/keyring/errors.go @@ -1,21 +1,21 @@ package keyring import ( - "cosmossdk.io/errors" + sdkerrors "cosmossdk.io/errors" ) var ( // ErrEmptySigningKeyName represents an error which indicates that the // provided signing key name is empty or unspecified. - ErrEmptySigningKeyName = errors.Register(codespace, 1, "empty signing key name") + ErrEmptySigningKeyName = sdkerrors.Register(codespace, 1, "empty signing key name") // ErrNoSuchSigningKey represents an error signifying that the requested // signing key does not exist or could not be located. - ErrNoSuchSigningKey = errors.Register(codespace, 2, "signing key does not exist") + ErrNoSuchSigningKey = sdkerrors.Register(codespace, 2, "signing key does not exist") // ErrSigningKeyAddr is raised when there's a failure in retrieving the // associated address for the provided signing key. - ErrSigningKeyAddr = errors.Register(codespace, 3, "failed to get address for signing key") + ErrSigningKeyAddr = sdkerrors.Register(codespace, 3, "failed to get address for signing key") codespace = "keyring" ) diff --git a/pkg/client/tx/errors.go b/pkg/client/tx/errors.go index 142618399..26d2d3df6 100644 --- a/pkg/client/tx/errors.go +++ b/pkg/client/tx/errors.go @@ -1,43 +1,43 @@ package tx import ( - errorsmod "cosmossdk.io/errors" + sdkerrors "cosmossdk.io/errors" ) var ( // ErrInvalidMsg signifies that there was an issue in validating the // transaction message. This could be due to format, content, or other // constraints imposed on the message. - ErrInvalidMsg = errorsmod.Register(codespace, 4, "failed to validate tx message") + ErrInvalidMsg = sdkerrors.Register(codespace, 4, "failed to validate tx message") // ErrCheckTx indicates an error occurred during the ABCI check transaction // process, which verifies the transaction's integrity before it is added // to the mempool. - ErrCheckTx = errorsmod.Register(codespace, 5, "error during ABCI check tx") + ErrCheckTx = sdkerrors.Register(codespace, 5, "error during ABCI check tx") // ErrTxTimeout is raised when a transaction has taken too long to // complete, surpassing a predefined threshold. - ErrTxTimeout = errorsmod.Register(codespace, 6, "tx timed out") + ErrTxTimeout = sdkerrors.Register(codespace, 6, "tx timed out") // ErrQueryTx indicates an error occurred while trying to query for the status // of a specific transaction, likely due to issues with the query parameters // or the state of the blockchain network. - ErrQueryTx = errorsmod.Register(codespace, 7, "error encountered while querying for tx") + ErrQueryTx = sdkerrors.Register(codespace, 7, "error encountered while querying for tx") // ErrInvalidTxHash represents an error which is triggered when the // transaction hash provided does not adhere to the expected format or // constraints, implying it may be corrupted or tampered with. - ErrInvalidTxHash = errorsmod.Register(codespace, 8, "invalid tx hash") + ErrInvalidTxHash = sdkerrors.Register(codespace, 8, "invalid tx hash") // ErrNonTxEventBytes indicates an attempt to deserialize bytes that do not // correspond to a transaction event. This error is triggered when the provided // byte data isn't recognized as a valid transaction event representation. - ErrNonTxEventBytes = errorsmod.Register(codespace, 9, "attempted to deserialize non-tx event bytes") + ErrNonTxEventBytes = sdkerrors.Register(codespace, 9, "attempted to deserialize non-tx event bytes") // ErrUnmarshalTx signals a failure in the unmarshaling process of a transaction. // This error is triggered when the system encounters issues translating a set of // bytes into the corresponding Tx structure or object. - ErrUnmarshalTx = errorsmod.Register(codespace, 10, "failed to unmarshal tx") + ErrUnmarshalTx = sdkerrors.Register(codespace, 10, "failed to unmarshal tx") codespace = "tx_client" ) diff --git a/pkg/observable/errors.go b/pkg/observable/errors.go index 47d39d088..79f221fdd 100644 --- a/pkg/observable/errors.go +++ b/pkg/observable/errors.go @@ -1,10 +1,10 @@ package observable import ( - errorsmod "cosmossdk.io/errors" + sdkerrors "cosmossdk.io/errors" ) var ( - ErrObserverClosed = errorsmod.Register(codespace, 1, "observer is closed") + ErrObserverClosed = sdkerrors.Register(codespace, 1, "observer is closed") codespace = "observable" ) diff --git a/pkg/relayer/protocol/errors.go b/pkg/relayer/protocol/errors.go index 36807f59c..24f1ea5c0 100644 --- a/pkg/relayer/protocol/errors.go +++ b/pkg/relayer/protocol/errors.go @@ -1,10 +1,10 @@ package protocol import ( - errorsmod "cosmossdk.io/errors" + sdkerrors "cosmossdk.io/errors" ) var ( - ErrDifficulty = errorsmod.New(codespace, 1, "difficulty error") + ErrDifficulty = sdkerrors.New(codespace, 1, "difficulty error") codespace = "relayer/protocol" ) diff --git a/testutil/testerrors/require.go b/testutil/testerrors/require.go index d6a34366f..7ba0d48ca 100644 --- a/testutil/testerrors/require.go +++ b/testutil/testerrors/require.go @@ -1,13 +1,13 @@ package testerrors import ( - errorsmod "cosmossdk.io/errors" + sdkerrors "cosmossdk.io/errors" ) var ( // ErrAsync is returned when a test assertion fails in a goroutine other than // the main test goroutine. This is done to avoid concurrent usage of // t.Fatal() which can cause the test binary to exit before cleanup is complete. - ErrAsync = errorsmod.Register(codespace, 1, "required assertion failed") + ErrAsync = sdkerrors.Register(codespace, 1, "required assertion failed") codespace = "testerrors" ) diff --git a/x/gateway/module.go b/x/gateway/module.go index 1c19cfe4f..daab3daa2 100644 --- a/x/gateway/module.go +++ b/x/gateway/module.go @@ -5,6 +5,8 @@ import ( "encoding/json" "fmt" + // this line is used by starport scaffolding # + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" diff --git a/x/pocket/module.go b/x/pocket/module.go index e8569ded2..e429649bf 100644 --- a/x/pocket/module.go +++ b/x/pocket/module.go @@ -5,6 +5,8 @@ import ( "encoding/json" "fmt" + // this line is used by starport scaffolding # + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" diff --git a/x/pocket/types/codec.go b/x/pocket/types/codec.go index 8eb43994e..71a5e6445 100644 --- a/x/pocket/types/codec.go +++ b/x/pocket/types/codec.go @@ -1,6 +1,8 @@ package types import ( + // this line is used by starport scaffolding # 1 + "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/msgservice" diff --git a/x/service/module.go b/x/service/module.go index d1cb2373a..5cbff0d2a 100644 --- a/x/service/module.go +++ b/x/service/module.go @@ -5,6 +5,8 @@ import ( "encoding/json" "fmt" + // this line is used by starport scaffolding # + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" diff --git a/x/service/types/codec.go b/x/service/types/codec.go index 8eb43994e..39e7482ab 100644 --- a/x/service/types/codec.go +++ b/x/service/types/codec.go @@ -1,6 +1,8 @@ package types import ( + // this line is used by starport scaffolding # 1 + "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/msgservice" diff --git a/x/session/types/codec.go b/x/session/types/codec.go index 8eb43994e..39e7482ab 100644 --- a/x/session/types/codec.go +++ b/x/session/types/codec.go @@ -1,6 +1,8 @@ package types import ( + // this line is used by starport scaffolding # 1 + "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/msgservice" diff --git a/x/supplier/module.go b/x/supplier/module.go index e3a34d61d..b28280af0 100644 --- a/x/supplier/module.go +++ b/x/supplier/module.go @@ -5,6 +5,8 @@ import ( "encoding/json" "fmt" + // this line is used by starport scaffolding # + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" diff --git a/x/tokenomics/module.go b/x/tokenomics/module.go index e54983755..e88612416 100644 --- a/x/tokenomics/module.go +++ b/x/tokenomics/module.go @@ -5,6 +5,8 @@ import ( "encoding/json" "fmt" + // this line is used by starport scaffolding # 1 + abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" diff --git a/x/tokenomics/types/codec.go b/x/tokenomics/types/codec.go index 8eb43994e..39e7482ab 100644 --- a/x/tokenomics/types/codec.go +++ b/x/tokenomics/types/codec.go @@ -1,6 +1,8 @@ package types import ( + // this line is used by starport scaffolding # 1 + "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/types/msgservice" From 02f516f73a7bf998407e515694ab5c8e3a228020 Mon Sep 17 00:00:00 2001 From: h5law <53987565+h5law@users.noreply.github.com> Date: Sun, 17 Dec 2023 02:18:31 +0000 Subject: [PATCH 3/3] chore: add missing scaffolding ones --- x/gateway/module.go | 2 +- x/pocket/module.go | 2 +- x/service/module.go | 2 +- x/supplier/module.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x/gateway/module.go b/x/gateway/module.go index daab3daa2..61513b642 100644 --- a/x/gateway/module.go +++ b/x/gateway/module.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" - // this line is used by starport scaffolding # + // this line is used by starport scaffolding # 1 abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" diff --git a/x/pocket/module.go b/x/pocket/module.go index e429649bf..48b5c16eb 100644 --- a/x/pocket/module.go +++ b/x/pocket/module.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" - // this line is used by starport scaffolding # + // this line is used by starport scaffolding # 1 abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" diff --git a/x/service/module.go b/x/service/module.go index 5cbff0d2a..f8361e1bc 100644 --- a/x/service/module.go +++ b/x/service/module.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" - // this line is used by starport scaffolding # + // this line is used by starport scaffolding # 1 abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" diff --git a/x/supplier/module.go b/x/supplier/module.go index b28280af0..1783cceca 100644 --- a/x/supplier/module.go +++ b/x/supplier/module.go @@ -5,7 +5,7 @@ import ( "encoding/json" "fmt" - // this line is used by starport scaffolding # + // this line is used by starport scaffolding # 1 abci "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client"