diff --git a/.golangci.yml b/.golangci.yml index e94123a9..33b7fe29 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,5 +1,6 @@ run: timeout: 10m + linters: disable-all: true enable: @@ -23,6 +24,7 @@ linters: - exportloopref - funlen - forbidigo + - gci - gocognit - goconst - gocritic @@ -52,6 +54,20 @@ linters: - whitespace linters-settings: + gci: + sections: + - standard # Standard section: captures all standard packages. + - default # Default section: contains all imports that could not be matched to another section type. + - blank # blank imports + - dot # dot imports + - prefix(github.com/cometbft/cometbft) # comet + - prefix(cosmossdk.io) # cosmossdk.io + - prefix(github.com/cosmos/cosmos-sdk) # cosmos-sdk & cosmos org libs + - prefix(github.com/cosmos/interchain-security) # interchain-security + - prefix(github.com/cosmos/ibc-go) # ibc + - prefix( github.com/okp4/okp4d) # okp4 + custom-order: true + cyclop: max-complexity: 20 skip-tests: true @@ -71,10 +87,10 @@ issues: - source: "^//\\s*go:generate\\s" linters: - lll - - source: "(noinspection|TODO)" + - source: '(noinspection|TODO)' linters: - godot - - source: "//noinspection" + - source: '//noinspection' linters: - gocritic - source: "^\\s+if _, ok := err\\.\\([^.]+\\.InternalError\\); ok {" diff --git a/app/ante.go b/app/ante.go index 7b0eb805..58ba1c7a 100644 --- a/app/ante.go +++ b/app/ante.go @@ -1,16 +1,18 @@ package app import ( + wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types" + errorsmod "cosmossdk.io/errors" + storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/ante" + ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" "github.com/cosmos/ibc-go/v7/modules/core/keeper" - - wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" - wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types" ) // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC @@ -28,13 +30,13 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "account keeper is required for AnteHandler") } if options.BankKeeper == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler") + return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "bank keeper is required for AnteHandler") } if options.SignModeHandler == nil { return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder") } if options.WasmConfig == nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder") + return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "wasm config is required for ante builder") } if options.TXCounterStoreKey == nil { return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "tx counter key is required for ante builder") diff --git a/app/app.go b/app/app.go index 4995eca5..8cbb58d6 100644 --- a/app/app.go +++ b/app/app.go @@ -11,16 +11,34 @@ import ( "path/filepath" "strings" - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "github.com/ignite/cli/ignite/pkg/openapiconsole" + appparams "github.com/okp4/okp4d/app/params" + okp4wasm "github.com/okp4/okp4d/app/wasm" + "github.com/okp4/okp4d/docs" + logicmodule "github.com/okp4/okp4d/x/logic" + logicfs "github.com/okp4/okp4d/x/logic/fs" + logicmodulekeeper "github.com/okp4/okp4d/x/logic/keeper" + logicmoduletypes "github.com/okp4/okp4d/x/logic/types" + "github.com/okp4/okp4d/x/mint" + mintkeeper "github.com/okp4/okp4d/x/mint/keeper" + minttypes "github.com/okp4/okp4d/x/mint/types" + "github.com/okp4/okp4d/x/vesting" + vestingtypes "github.com/okp4/okp4d/x/vesting/types" + "github.com/prometheus/client_golang/prometheus" + "github.com/spf13/cast" + dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/log" tmos "github.com/cometbft/cometbft/libs/os" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + + autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node" @@ -91,6 +109,7 @@ import ( upgradeclient "github.com/cosmos/cosmos-sdk/x/upgrade/client" upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" icacontroller "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller" icacontrollerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper" @@ -114,24 +133,6 @@ import ( ibckeeper "github.com/cosmos/ibc-go/v7/modules/core/keeper" solomachine "github.com/cosmos/ibc-go/v7/modules/light-clients/06-solomachine" ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint" - okp4wasm "github.com/okp4/okp4d/app/wasm" - logicmodule "github.com/okp4/okp4d/x/logic" - logicfs "github.com/okp4/okp4d/x/logic/fs" - logicmodulekeeper "github.com/okp4/okp4d/x/logic/keeper" - logicmoduletypes "github.com/okp4/okp4d/x/logic/types" - "github.com/okp4/okp4d/x/mint" - mintkeeper "github.com/okp4/okp4d/x/mint/keeper" - minttypes "github.com/okp4/okp4d/x/mint/types" - "github.com/prometheus/client_golang/prometheus" - "github.com/spf13/cast" - - "github.com/okp4/okp4d/x/vesting" - vestingtypes "github.com/okp4/okp4d/x/vesting/types" - - "github.com/ignite/cli/ignite/pkg/openapiconsole" - appparams "github.com/okp4/okp4d/app/params" - - "github.com/okp4/okp4d/docs" ) const ( diff --git a/app/encoding.go b/app/encoding.go index 45d1eccf..20cf0cce 100644 --- a/app/encoding.go +++ b/app/encoding.go @@ -1,12 +1,12 @@ package app import ( + "github.com/okp4/okp4d/app/params" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/std" "github.com/cosmos/cosmos-sdk/x/auth/tx" - - "github.com/okp4/okp4d/app/params" ) // makeEncodingConfig creates an EncodingConfig for an amino based test configuration. diff --git a/app/upgrades.go b/app/upgrades.go index 4b735698..610bc3c4 100644 --- a/app/upgrades.go +++ b/app/upgrades.go @@ -3,11 +3,12 @@ package app import ( "fmt" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" v4 "github.com/okp4/okp4d/app/upgrades/v4" v41 "github.com/okp4/okp4d/app/upgrades/v41" v5 "github.com/okp4/okp4d/app/upgrades/v5" + + storetypes "github.com/cosmos/cosmos-sdk/store/types" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" ) func (app *App) setupUpgradeHandlers() { diff --git a/app/upgrades/v5/upgrade.go b/app/upgrades/v5/upgrade.go index 8e7eb398..51e1e8b7 100644 --- a/app/upgrades/v5/upgrade.go +++ b/app/upgrades/v5/upgrade.go @@ -2,6 +2,7 @@ package v5 import ( wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "github.com/cosmos/cosmos-sdk/baseapp" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -19,6 +20,7 @@ import ( slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" diff --git a/app/wasm/query.go b/app/wasm/query.go index 068a27ca..a2116700 100644 --- a/app/wasm/query.go +++ b/app/wasm/query.go @@ -5,10 +5,13 @@ import ( wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" logickeeper "github.com/okp4/okp4d/x/logic/keeper" logicwasm "github.com/okp4/okp4d/x/logic/wasm" + + errorsmod "cosmossdk.io/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // customQuery represents the wasm custom query structure, it is intended to allow wasm contracts to execute queries @@ -31,13 +34,13 @@ func makeCustomQuerier(logicQuerier logicwasm.LogicQuerier) wasmkeeper.CustomQue return func(ctx sdk.Context, request json.RawMessage) ([]byte, error) { var query customQuery if err := json.Unmarshal(request, &query); err != nil { - return nil, sdkerrors.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) + return nil, errorsmod.Wrap(sdkerrors.ErrJSONUnmarshal, err.Error()) } if query.Ask != nil { return logicQuerier.Ask(ctx, *query.Ask) } - return nil, sdkerrors.Wrap(wasmtypes.ErrInvalidMsg, "Unknown custom query variant") + return nil, errorsmod.Wrap(wasmtypes.ErrInvalidMsg, "Unknown custom query variant") } } diff --git a/cmd/okp4d/cmd/config.go b/cmd/okp4d/cmd/config.go index f5355706..803b620c 100644 --- a/cmd/okp4d/cmd/config.go +++ b/cmd/okp4d/cmd/config.go @@ -1,9 +1,9 @@ package cmd import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/okp4/okp4d/app" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func initSDKConfig() { diff --git a/cmd/okp4d/cmd/genaccounts.go b/cmd/okp4d/cmd/genaccounts.go index 52d4f268..98ced3f4 100644 --- a/cmd/okp4d/cmd/genaccounts.go +++ b/cmd/okp4d/cmd/genaccounts.go @@ -6,6 +6,7 @@ import ( "errors" "fmt" + authvesting "github.com/okp4/okp4d/x/vesting/types" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" @@ -17,7 +18,6 @@ import ( banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - authvesting "github.com/okp4/okp4d/x/vesting/types" ) const ( diff --git a/cmd/okp4d/cmd/root.go b/cmd/okp4d/cmd/root.go index ed4a2cbc..7c59fe50 100644 --- a/cmd/okp4d/cmd/root.go +++ b/cmd/okp4d/cmd/root.go @@ -7,11 +7,18 @@ import ( "path/filepath" "strings" + "github.com/okp4/okp4d/app" + appparams "github.com/okp4/okp4d/app/params" + "github.com/spf13/cast" + "github.com/spf13/cobra" + "github.com/spf13/pflag" + dbm "github.com/cometbft/cometbft-db" tmcfg "github.com/cometbft/cometbft/config" tmcli "github.com/cometbft/cometbft/libs/cli" "github.com/cometbft/cometbft/libs/log" tmtypes "github.com/cometbft/cometbft/types" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/config" @@ -33,14 +40,6 @@ import ( "github.com/cosmos/cosmos-sdk/x/genutil" genutilcli "github.com/cosmos/cosmos-sdk/x/genutil/client/cli" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" - "github.com/spf13/cast" - "github.com/spf13/cobra" - "github.com/spf13/pflag" - - // this line is used by starport scaffolding # root/moduleImport. - - "github.com/okp4/okp4d/app" - appparams "github.com/okp4/okp4d/app/params" ) // NewRootCmd creates a new root command for a Cosmos SDK application. diff --git a/cmd/okp4d/main.go b/cmd/okp4d/main.go index ebd976f5..85b31e36 100644 --- a/cmd/okp4d/main.go +++ b/cmd/okp4d/main.go @@ -4,11 +4,11 @@ import ( "errors" "os" - "github.com/cosmos/cosmos-sdk/server" - svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" + "github.com/okp4/okp4d/app" "github.com/okp4/okp4d/cmd/okp4d/cmd" - "github.com/okp4/okp4d/app" + "github.com/cosmos/cosmos-sdk/server" + svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" ) func main() { diff --git a/go.mod b/go.mod index ef7b4dfb..1a3a391f 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/okp4/okp4d -go 1.19 +go 1.20 require ( cosmossdk.io/api v0.3.1 diff --git a/scripts/generate_command_doc.go b/scripts/generate_command_doc.go old mode 100755 new mode 100644 index f4627901..9148341e --- a/scripts/generate_command_doc.go +++ b/scripts/generate_command_doc.go @@ -5,10 +5,10 @@ import ( "log" "os" - "github.com/cosmos/cosmos-sdk/server" + "github.com/okp4/okp4d/cmd/okp4d/cmd" "github.com/spf13/cobra/doc" - "github.com/okp4/okp4d/cmd/okp4d/cmd" + "github.com/cosmos/cosmos-sdk/server" ) func main() { diff --git a/testutil/network/network.go b/testutil/network/network.go index 87dfc5d9..20800290 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -6,9 +6,11 @@ import ( "time" "github.com/okp4/okp4d/app" + "github.com/stretchr/testify/require" tmdb "github.com/cometbft/cometbft-db" tmrand "github.com/cometbft/cometbft/libs/rand" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/crypto/hd" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -18,7 +20,6 @@ import ( simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/stretchr/testify/require" ) type ( diff --git a/x/logic/client/cli/query.go b/x/logic/client/cli/query.go index 20fe934e..7f0b40d3 100644 --- a/x/logic/client/cli/query.go +++ b/x/logic/client/cli/query.go @@ -3,11 +3,10 @@ package cli import ( "fmt" + "github.com/okp4/okp4d/x/logic/types" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" - - "github.com/okp4/okp4d/x/logic/types" ) // GetQueryCmd returns the cli query commands for this module. diff --git a/x/logic/client/cli/query_ask.go b/x/logic/client/cli/query_ask.go index b9fb1146..19c90697 100644 --- a/x/logic/client/cli/query_ask.go +++ b/x/logic/client/cli/query_ask.go @@ -6,11 +6,12 @@ import ( "io" "os" + "github.com/okp4/okp4d/x/logic/types" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/version" - "github.com/okp4/okp4d/x/logic/types" - "github.com/spf13/cobra" ) var ( diff --git a/x/logic/client/cli/query_params.go b/x/logic/client/cli/query_params.go index d4133ac7..eab8a76c 100644 --- a/x/logic/client/cli/query_params.go +++ b/x/logic/client/cli/query_params.go @@ -3,10 +3,11 @@ package cli import ( "context" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" "github.com/okp4/okp4d/x/logic/types" "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" ) func CmdQueryParams() *cobra.Command { diff --git a/x/logic/client/cli/tx.go b/x/logic/client/cli/tx.go index 0d224ff6..8c8ab4e6 100644 --- a/x/logic/client/cli/tx.go +++ b/x/logic/client/cli/tx.go @@ -4,10 +4,10 @@ import ( "fmt" "time" + "github.com/okp4/okp4d/x/logic/types" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" - "github.com/okp4/okp4d/x/logic/types" ) var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) diff --git a/x/logic/fs/filtered_fs_test.go b/x/logic/fs/filtered_fs_test.go index 8dbb3086..81526e29 100644 --- a/x/logic/fs/filtered_fs_test.go +++ b/x/logic/fs/filtered_fs_test.go @@ -11,6 +11,7 @@ import ( "github.com/okp4/okp4d/x/logic/testutil" "github.com/okp4/okp4d/x/logic/util" "github.com/samber/lo" + . "github.com/smartystreets/goconvey/convey" ) diff --git a/x/logic/fs/wasm.go b/x/logic/fs/wasm.go index 348d3e74..ca2c470b 100644 --- a/x/logic/fs/wasm.go +++ b/x/logic/fs/wasm.go @@ -9,8 +9,9 @@ import ( "net/url" "strings" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/okp4/okp4d/x/logic/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) const ( diff --git a/x/logic/fs/wasm_test.go b/x/logic/fs/wasm_test.go index 948d8c35..03b61fc7 100644 --- a/x/logic/fs/wasm_test.go +++ b/x/logic/fs/wasm_test.go @@ -8,14 +8,17 @@ import ( "net/url" "testing" + "github.com/golang/mock/gomock" + "github.com/okp4/okp4d/x/logic/testutil" + + . "github.com/smartystreets/goconvey/convey" + tmdb "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/golang/mock/gomock" - "github.com/okp4/okp4d/x/logic/testutil" - . "github.com/smartystreets/goconvey/convey" ) func TestWasmHandler(t *testing.T) { diff --git a/x/logic/genesis.go b/x/logic/genesis.go index c3045e3a..c49c4806 100644 --- a/x/logic/genesis.go +++ b/x/logic/genesis.go @@ -1,10 +1,12 @@ package logic import ( - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/okp4/okp4d/x/logic/keeper" "github.com/okp4/okp4d/x/logic/types" + + errorsmod "cosmossdk.io/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // InitGenesis initializes the module's state from a provided genesis state. diff --git a/x/logic/interpreter/interpreter.go b/x/logic/interpreter/interpreter.go index 78003483..35a89059 100644 --- a/x/logic/interpreter/interpreter.go +++ b/x/logic/interpreter/interpreter.go @@ -6,9 +6,10 @@ import ( "io" "io/fs" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ichiban/prolog" "github.com/ichiban/prolog/engine" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // Predicates is a map of predicate names to their execution costs. diff --git a/x/logic/interpreter/registry.go b/x/logic/interpreter/registry.go index 58fb040d..5d4d42dd 100644 --- a/x/logic/interpreter/registry.go +++ b/x/logic/interpreter/registry.go @@ -5,10 +5,11 @@ import ( "strconv" "strings" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ichiban/prolog" "github.com/ichiban/prolog/engine" "github.com/okp4/okp4d/x/logic/predicate" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // registry is a map from predicate names (in the form of "atom/arity") to predicates functions. diff --git a/x/logic/keeper/grpc_query_ask.go b/x/logic/keeper/grpc_query_ask.go index 82803419..e719e93a 100644 --- a/x/logic/keeper/grpc_query_ask.go +++ b/x/logic/keeper/grpc_query_ask.go @@ -3,17 +3,19 @@ package keeper import ( goctx "context" - sdkerrors "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/okp4/okp4d/x/logic/meter" "github.com/okp4/okp4d/x/logic/types" + + errorsmod "cosmossdk.io/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func (k Keeper) Ask(ctx goctx.Context, req *types.QueryServiceAskRequest) (response *types.QueryServiceAskResponse, err error) { sdkCtx := sdk.UnwrapSDKContext(ctx) if req == nil { - return nil, sdkerrors.Wrap(types.InvalidArgument, "request is nil") + return nil, errorsmod.Wrap(types.InvalidArgument, "request is nil") } limits := k.limits(ctx) @@ -25,7 +27,7 @@ func (k Keeper) Ask(ctx goctx.Context, req *types.QueryServiceAskRequest) (respo defer func() { if r := recover(); r != nil { if gasError, ok := r.(sdk.ErrorOutOfGas); ok { - response, err = nil, sdkerrors.Wrapf( + response, err = nil, errorsmod.Wrapf( types.LimitExceeded, "out of gas: %s <%s> (%d/%d)", types.ModuleName, gasError.Descriptor, sdkCtx.GasMeter().GasConsumed(), sdkCtx.GasMeter().Limit()) diff --git a/x/logic/keeper/grpc_query_ask_test.go b/x/logic/keeper/grpc_query_ask_test.go index 8f7c7cd5..88b2964f 100644 --- a/x/logic/keeper/grpc_query_ask_test.go +++ b/x/logic/keeper/grpc_query_ask_test.go @@ -6,18 +6,20 @@ import ( "io/fs" "testing" - "github.com/cosmos/cosmos-sdk/baseapp" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - "github.com/cosmos/cosmos-sdk/testutil" - moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/golang/mock/gomock" "github.com/okp4/okp4d/x/logic" "github.com/okp4/okp4d/x/logic/keeper" logictestutil "github.com/okp4/okp4d/x/logic/testutil" "github.com/okp4/okp4d/x/logic/types" + . "github.com/smartystreets/goconvey/convey" + + "github.com/cosmos/cosmos-sdk/baseapp" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/testutil" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) func TestGRPCAsk(t *testing.T) { diff --git a/x/logic/keeper/grpc_query_params.go b/x/logic/keeper/grpc_query_params.go index 294c2b7f..433d044a 100644 --- a/x/logic/keeper/grpc_query_params.go +++ b/x/logic/keeper/grpc_query_params.go @@ -3,10 +3,11 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/okp4/okp4d/x/logic/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func (k Keeper) Params(c context.Context, req *types.QueryServiceParamsRequest) (*types.QueryServiceParamsResponse, error) { diff --git a/x/logic/keeper/grpc_query_params_test.go b/x/logic/keeper/grpc_query_params_test.go index 0ef5b2a5..3562df76 100644 --- a/x/logic/keeper/grpc_query_params_test.go +++ b/x/logic/keeper/grpc_query_params_test.go @@ -6,19 +6,22 @@ import ( "io/fs" "testing" + "github.com/golang/mock/gomock" + "github.com/okp4/okp4d/x/logic" + "github.com/okp4/okp4d/x/logic/keeper" + logictestutil "github.com/okp4/okp4d/x/logic/testutil" + "github.com/okp4/okp4d/x/logic/types" + + . "github.com/smartystreets/goconvey/convey" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/baseapp" storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/cosmos/cosmos-sdk/testutil" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/golang/mock/gomock" - "github.com/okp4/okp4d/x/logic" - "github.com/okp4/okp4d/x/logic/keeper" - logictestutil "github.com/okp4/okp4d/x/logic/testutil" - "github.com/okp4/okp4d/x/logic/types" - . "github.com/smartystreets/goconvey/convey" ) func TestGRPCParams(t *testing.T) { diff --git a/x/logic/keeper/interpreter.go b/x/logic/keeper/interpreter.go index 6b57b1d6..81a10929 100644 --- a/x/logic/keeper/interpreter.go +++ b/x/logic/keeper/interpreter.go @@ -4,9 +4,6 @@ import ( goctx "context" "math" - sdkerrors "cosmossdk.io/errors" - sdkmath "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ichiban/prolog" "github.com/okp4/okp4d/x/logic/fs" "github.com/okp4/okp4d/x/logic/interpreter" @@ -15,6 +12,11 @@ import ( "github.com/okp4/okp4d/x/logic/types" "github.com/okp4/okp4d/x/logic/util" "github.com/samber/lo" + + errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" ) const ( @@ -40,15 +42,15 @@ func (k Keeper) execute(ctx goctx.Context, program, query string) (*types.QueryS i, userOutputBuffer, err := k.newInterpreter(ctx) if err != nil { - return nil, sdkerrors.Wrapf(types.Internal, "error creating interpreter: %v", err.Error()) + return nil, errorsmod.Wrapf(types.Internal, "error creating interpreter: %v", err.Error()) } if err := i.ExecContext(ctx, program); err != nil { - return nil, sdkerrors.Wrapf(types.InvalidArgument, "error compiling query: %v", err.Error()) + return nil, errorsmod.Wrapf(types.InvalidArgument, "error compiling query: %v", err.Error()) } sols, err := i.QueryContext(ctx, query) if err != nil { - return nil, sdkerrors.Wrapf(types.InvalidArgument, "error executing query: %v", err.Error()) + return nil, errorsmod.Wrapf(types.InvalidArgument, "error executing query: %v", err.Error()) } defer func() { _ = sols.Close() @@ -63,7 +65,7 @@ func (k Keeper) execute(ctx goctx.Context, program, query string) (*types.QueryS m := types.TermResults{} if err := sols.Scan(m); err != nil { - return nil, sdkerrors.Wrapf(types.Internal, "error scanning solution: %v", err.Error()) + return nil, errorsmod.Wrapf(types.Internal, "error scanning solution: %v", err.Error()) } if nb.IsZero() { variables = m.ToVariables() @@ -76,7 +78,7 @@ func (k Keeper) execute(ctx goctx.Context, program, query string) (*types.QueryS if sdkCtx.GasMeter().IsOutOfGas() { panic(sdk.ErrorOutOfGas{Descriptor: "Prolog interpreter execution"}) } - return nil, sdkerrors.Wrapf(types.InvalidArgument, "error interpreting solutions: %v", err.Error()) + return nil, errorsmod.Wrapf(types.InvalidArgument, "error interpreting solutions: %v", err.Error()) } var userOutput string @@ -101,7 +103,7 @@ func checkLimits(request *types.QueryServiceAskRequest, limits types.Limits) err size := sdkmath.NewUint(uint64(len(request.GetQuery()))) limit := util.DerefOrDefault(limits.MaxSize, sdkmath.NewUint(math.MaxInt64)) if size.GT(limit) { - return sdkerrors.Wrapf(types.LimitExceeded, "query: %d > MaxSize: %d", size, limit) + return errorsmod.Wrapf(types.LimitExceeded, "query: %d > MaxSize: %d", size, limit) } return nil diff --git a/x/logic/keeper/keeper.go b/x/logic/keeper/keeper.go index d8204651..8f50c7b9 100644 --- a/x/logic/keeper/keeper.go +++ b/x/logic/keeper/keeper.go @@ -5,11 +5,13 @@ import ( "fmt" "io/fs" + "github.com/okp4/okp4d/x/logic/types" + "github.com/cometbft/cometbft/libs/log" + "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/okp4/okp4d/x/logic/types" ) type FSProvider = func(ctx goctx.Context) fs.FS diff --git a/x/logic/keeper/migrations.go b/x/logic/keeper/migrations.go index 40d77537..3491603f 100644 --- a/x/logic/keeper/migrations.go +++ b/x/logic/keeper/migrations.go @@ -1,10 +1,11 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/okp4/okp4d/x/logic/exported" v2 "github.com/okp4/okp4d/x/logic/migrations/v2" v3 "github.com/okp4/okp4d/x/logic/migrations/v3" + + sdk "github.com/cosmos/cosmos-sdk/types" ) type Migrator struct { diff --git a/x/logic/keeper/msg_server.go b/x/logic/keeper/msg_server.go index 56256fa4..2ea2c4fd 100644 --- a/x/logic/keeper/msg_server.go +++ b/x/logic/keeper/msg_server.go @@ -3,10 +3,12 @@ package keeper import ( "context" + "github.com/okp4/okp4d/x/logic/types" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/okp4/okp4d/x/logic/types" ) type msgServer struct { diff --git a/x/logic/keeper/msg_server_test.go b/x/logic/keeper/msg_server_test.go index 233130ca..eceba57a 100644 --- a/x/logic/keeper/msg_server_test.go +++ b/x/logic/keeper/msg_server_test.go @@ -6,17 +6,19 @@ import ( "io/fs" "testing" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - "github.com/cosmos/cosmos-sdk/testutil" - moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" "github.com/golang/mock/gomock" "github.com/okp4/okp4d/x/logic" "github.com/okp4/okp4d/x/logic/keeper" logictestutil "github.com/okp4/okp4d/x/logic/testutil" "github.com/okp4/okp4d/x/logic/types" + . "github.com/smartystreets/goconvey/convey" + + storetypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/testutil" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" ) func TestUpdateParams(t *testing.T) { diff --git a/x/logic/keeper/params.go b/x/logic/keeper/params.go index ad994872..73e7cdca 100644 --- a/x/logic/keeper/params.go +++ b/x/logic/keeper/params.go @@ -1,8 +1,9 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/okp4/okp4d/x/logic/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // GetParams get all parameters as types.Params. diff --git a/x/logic/meter/weighted_test.go b/x/logic/meter/weighted_test.go index fed7e80a..3e8d5fa9 100644 --- a/x/logic/meter/weighted_test.go +++ b/x/logic/meter/weighted_test.go @@ -7,6 +7,7 @@ import ( "github.com/golang/mock/gomock" "github.com/okp4/okp4d/x/logic/testutil" + . "github.com/smartystreets/goconvey/convey" ) diff --git a/x/logic/migrations/v2/migrations.go b/x/logic/migrations/v2/migrations.go index 6a68b15b..12ffde26 100644 --- a/x/logic/migrations/v2/migrations.go +++ b/x/logic/migrations/v2/migrations.go @@ -1,10 +1,11 @@ package v2 import ( - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/okp4/okp4d/x/logic/exported" "github.com/okp4/okp4d/x/logic/types" + + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" ) func MigrateStore(ctx sdk.Context, legacySubspace exported.Subspace, cdc codec.BinaryCodec) error { diff --git a/x/logic/migrations/v3/migrations.go b/x/logic/migrations/v3/migrations.go index ee85ffd0..2fdc5713 100644 --- a/x/logic/migrations/v3/migrations.go +++ b/x/logic/migrations/v3/migrations.go @@ -1,13 +1,14 @@ package v2 import ( + "github.com/okp4/okp4d/x/logic/exported" + v2types "github.com/okp4/okp4d/x/logic/migrations/v2/types" + "github.com/okp4/okp4d/x/logic/types" + "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/okp4/okp4d/x/logic/exported" - v2types "github.com/okp4/okp4d/x/logic/migrations/v2/types" - "github.com/okp4/okp4d/x/logic/types" ) func v2ParamKeyTable() paramtypes.KeyTable { diff --git a/x/logic/module.go b/x/logic/module.go index 1edb8345..7a59fa7f 100644 --- a/x/logic/module.go +++ b/x/logic/module.go @@ -6,7 +6,10 @@ import ( "fmt" "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/okp4/okp4d/x/logic/client/cli" "github.com/okp4/okp4d/x/logic/exported" + "github.com/okp4/okp4d/x/logic/keeper" + "github.com/okp4/okp4d/x/logic/types" "github.com/spf13/cobra" abci "github.com/cometbft/cometbft/abci/types" @@ -16,9 +19,6 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/okp4/okp4d/x/logic/client/cli" - "github.com/okp4/okp4d/x/logic/keeper" - "github.com/okp4/okp4d/x/logic/types" ) var ( diff --git a/x/logic/predicate/address.go b/x/logic/predicate/address.go index f82f60da..48ca4b73 100644 --- a/x/logic/predicate/address.go +++ b/x/logic/predicate/address.go @@ -4,9 +4,10 @@ import ( "context" "fmt" - bech322 "github.com/cosmos/cosmos-sdk/types/bech32" "github.com/ichiban/prolog/engine" "github.com/okp4/okp4d/x/logic/util" + + bech322 "github.com/cosmos/cosmos-sdk/types/bech32" ) // Bech32Address is a predicate that convert a bech32 encoded string into base64 bytes and give the address prefix, or diff --git a/x/logic/predicate/address_test.go b/x/logic/predicate/address_test.go index bb7e64e9..1ecc3ce1 100644 --- a/x/logic/predicate/address_test.go +++ b/x/logic/predicate/address_test.go @@ -5,15 +5,18 @@ import ( "fmt" "testing" + "github.com/ichiban/prolog/engine" + "github.com/okp4/okp4d/x/logic/testutil" + "github.com/okp4/okp4d/x/logic/types" + + . "github.com/smartystreets/goconvey/convey" + tmdb "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ichiban/prolog/engine" - "github.com/okp4/okp4d/x/logic/testutil" - "github.com/okp4/okp4d/x/logic/types" - . "github.com/smartystreets/goconvey/convey" ) func TestBech32(t *testing.T) { diff --git a/x/logic/predicate/bank.go b/x/logic/predicate/bank.go index 39c937bc..4a8bfb36 100644 --- a/x/logic/predicate/bank.go +++ b/x/logic/predicate/bank.go @@ -4,10 +4,11 @@ import ( "context" "fmt" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ichiban/prolog/engine" "github.com/okp4/okp4d/x/logic/types" "github.com/okp4/okp4d/x/logic/util" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // BankBalances is a predicate which unifies the given terms with the list of balances (coins) of the given account. diff --git a/x/logic/predicate/bank_test.go b/x/logic/predicate/bank_test.go index fd059d68..d5017ed7 100644 --- a/x/logic/predicate/bank_test.go +++ b/x/logic/predicate/bank_test.go @@ -5,17 +5,20 @@ import ( "fmt" "testing" + "github.com/golang/mock/gomock" + "github.com/ichiban/prolog/engine" + "github.com/okp4/okp4d/x/logic/testutil" + "github.com/okp4/okp4d/x/logic/types" + + . "github.com/smartystreets/goconvey/convey" + tmdb "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" bank "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/golang/mock/gomock" - "github.com/ichiban/prolog/engine" - "github.com/okp4/okp4d/x/logic/testutil" - "github.com/okp4/okp4d/x/logic/types" - . "github.com/smartystreets/goconvey/convey" ) func TestBank(t *testing.T) { diff --git a/x/logic/predicate/block_test.go b/x/logic/predicate/block_test.go index 9bebe14b..532a3f6a 100644 --- a/x/logic/predicate/block_test.go +++ b/x/logic/predicate/block_test.go @@ -5,14 +5,17 @@ import ( "testing" "time" + "github.com/ichiban/prolog/engine" + "github.com/okp4/okp4d/x/logic/testutil" + + . "github.com/smartystreets/goconvey/convey" + tmdb "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ichiban/prolog/engine" - "github.com/okp4/okp4d/x/logic/testutil" - . "github.com/smartystreets/goconvey/convey" ) func TestBlock(t *testing.T) { diff --git a/x/logic/predicate/builtin_test.go b/x/logic/predicate/builtin_test.go index 3c59b5f3..002b7119 100644 --- a/x/logic/predicate/builtin_test.go +++ b/x/logic/predicate/builtin_test.go @@ -4,17 +4,20 @@ import ( "fmt" "testing" - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/store" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/golang/mock/gomock" "github.com/ichiban/prolog/engine" "github.com/okp4/okp4d/x/logic/testutil" "github.com/okp4/okp4d/x/logic/types" "github.com/okp4/okp4d/x/logic/util" + . "github.com/smartystreets/goconvey/convey" + + tmdb "github.com/cometbft/cometbft-db" + "github.com/cometbft/cometbft/libs/log" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/store" + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestWrite(t *testing.T) { diff --git a/x/logic/predicate/chain_test.go b/x/logic/predicate/chain_test.go index 24c76dc3..0b913519 100644 --- a/x/logic/predicate/chain_test.go +++ b/x/logic/predicate/chain_test.go @@ -4,14 +4,17 @@ import ( "fmt" "testing" + "github.com/ichiban/prolog/engine" + "github.com/okp4/okp4d/x/logic/testutil" + + . "github.com/smartystreets/goconvey/convey" + tmdb "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ichiban/prolog/engine" - "github.com/okp4/okp4d/x/logic/testutil" - . "github.com/smartystreets/goconvey/convey" ) func TestChainID(t *testing.T) { diff --git a/x/logic/predicate/crypto.go b/x/logic/predicate/crypto.go index 71037bc1..c0185e80 100644 --- a/x/logic/predicate/crypto.go +++ b/x/logic/predicate/crypto.go @@ -5,9 +5,10 @@ import ( "encoding/hex" "fmt" - "github.com/cometbft/cometbft/crypto" "github.com/ichiban/prolog/engine" "github.com/okp4/okp4d/x/logic/util" + + "github.com/cometbft/cometbft/crypto" ) // SHAHash is a predicate that computes the Hash of the given Data. The signature is as follow: diff --git a/x/logic/predicate/crypto_test.go b/x/logic/predicate/crypto_test.go index 55033d0b..3fa230d4 100644 --- a/x/logic/predicate/crypto_test.go +++ b/x/logic/predicate/crypto_test.go @@ -5,15 +5,18 @@ import ( "fmt" "testing" + "github.com/ichiban/prolog/engine" + "github.com/okp4/okp4d/x/logic/testutil" + "github.com/okp4/okp4d/x/logic/types" + + . "github.com/smartystreets/goconvey/convey" + tmdb "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ichiban/prolog/engine" - "github.com/okp4/okp4d/x/logic/testutil" - "github.com/okp4/okp4d/x/logic/types" - . "github.com/smartystreets/goconvey/convey" ) func TestCryptoHash(t *testing.T) { diff --git a/x/logic/predicate/did_test.go b/x/logic/predicate/did_test.go index 67dcc4f7..84d6febd 100644 --- a/x/logic/predicate/did_test.go +++ b/x/logic/predicate/did_test.go @@ -5,15 +5,18 @@ import ( "fmt" "testing" + "github.com/ichiban/prolog/engine" + "github.com/okp4/okp4d/x/logic/testutil" + "github.com/okp4/okp4d/x/logic/types" + + . "github.com/smartystreets/goconvey/convey" + tmdb "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ichiban/prolog/engine" - "github.com/okp4/okp4d/x/logic/testutil" - "github.com/okp4/okp4d/x/logic/types" - . "github.com/smartystreets/goconvey/convey" ) func TestDID(t *testing.T) { diff --git a/x/logic/predicate/file_test.go b/x/logic/predicate/file_test.go index 79ffe174..17165623 100644 --- a/x/logic/predicate/file_test.go +++ b/x/logic/predicate/file_test.go @@ -8,18 +8,21 @@ import ( "testing" "time" - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/store" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/golang/mock/gomock" "github.com/ichiban/prolog" "github.com/ichiban/prolog/engine" "github.com/okp4/okp4d/x/logic/fs" "github.com/okp4/okp4d/x/logic/testutil" "github.com/okp4/okp4d/x/logic/types" + . "github.com/smartystreets/goconvey/convey" + + tmdb "github.com/cometbft/cometbft-db" + "github.com/cometbft/cometbft/libs/log" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/store" + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestSourceFile(t *testing.T) { diff --git a/x/logic/predicate/json.go b/x/logic/predicate/json.go index 3fbffc07..c01118ef 100644 --- a/x/logic/predicate/json.go +++ b/x/logic/predicate/json.go @@ -7,11 +7,13 @@ import ( "sort" "strings" - "cosmossdk.io/math" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ichiban/prolog/engine" "github.com/okp4/okp4d/x/logic/util" "github.com/samber/lo" + + "cosmossdk.io/math" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // AtomJSON is a term which represents a json as a compound term `json([Pair])`. diff --git a/x/logic/predicate/json_test.go b/x/logic/predicate/json_test.go index 19c13334..5ede9894 100644 --- a/x/logic/predicate/json_test.go +++ b/x/logic/predicate/json_test.go @@ -5,15 +5,18 @@ import ( "fmt" "testing" + "github.com/ichiban/prolog/engine" + "github.com/okp4/okp4d/x/logic/testutil" + "github.com/okp4/okp4d/x/logic/types" + + . "github.com/smartystreets/goconvey/convey" + tmdb "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/store" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ichiban/prolog/engine" - "github.com/okp4/okp4d/x/logic/testutil" - "github.com/okp4/okp4d/x/logic/types" - . "github.com/smartystreets/goconvey/convey" ) func TestJsonProlog(t *testing.T) { diff --git a/x/logic/predicate/uri_test.go b/x/logic/predicate/uri_test.go index cdc7df29..b7f245c8 100644 --- a/x/logic/predicate/uri_test.go +++ b/x/logic/predicate/uri_test.go @@ -5,16 +5,18 @@ import ( "fmt" "testing" - tmdb "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/store" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ichiban/prolog/engine" "github.com/okp4/okp4d/x/logic/testutil" "github.com/okp4/okp4d/x/logic/types" . "github.com/smartystreets/goconvey/convey" + + tmdb "github.com/cometbft/cometbft-db" + "github.com/cometbft/cometbft/libs/log" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + + "github.com/cosmos/cosmos-sdk/store" + sdk "github.com/cosmos/cosmos-sdk/types" ) func TestURIEncoded(t *testing.T) { diff --git a/x/logic/predicate/util.go b/x/logic/predicate/util.go index 415397df..46fac845 100644 --- a/x/logic/predicate/util.go +++ b/x/logic/predicate/util.go @@ -4,9 +4,10 @@ import ( "fmt" "sort" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/ichiban/prolog/engine" "github.com/okp4/okp4d/x/logic/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // SortBalances by coin denomination. diff --git a/x/logic/predicate/util_test.go b/x/logic/predicate/util_test.go index 598bd5ea..b975fc3a 100644 --- a/x/logic/predicate/util_test.go +++ b/x/logic/predicate/util_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/ichiban/prolog/engine" + . "github.com/smartystreets/goconvey/convey" ) diff --git a/x/logic/types/codec.go b/x/logic/types/codec.go index 052bcd0a..850f60b7 100644 --- a/x/logic/types/codec.go +++ b/x/logic/types/codec.go @@ -4,7 +4,6 @@ import ( "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/msgservice" ) diff --git a/x/logic/types/errors.go b/x/logic/types/errors.go index a6592439..b4260b8d 100644 --- a/x/logic/types/errors.go +++ b/x/logic/types/errors.go @@ -1,8 +1,9 @@ package types import ( - sdkerrors "cosmossdk.io/errors" "google.golang.org/grpc/codes" + + sdkerrors "cosmossdk.io/errors" ) var ( diff --git a/x/logic/types/msg.go b/x/logic/types/msg.go index 13b56771..1e67aff1 100644 --- a/x/logic/types/msg.go +++ b/x/logic/types/msg.go @@ -2,6 +2,7 @@ package types import ( errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/logic/types/params_test.go b/x/logic/types/params_test.go index 15d883fe..df52ed04 100644 --- a/x/logic/types/params_test.go +++ b/x/logic/types/params_test.go @@ -4,9 +4,11 @@ import ( "fmt" "testing" - "cosmossdk.io/math" "github.com/okp4/okp4d/x/logic/types" + . "github.com/smartystreets/goconvey/convey" + + "cosmossdk.io/math" ) func TestValidateParams(t *testing.T) { diff --git a/x/logic/util/func_test.go b/x/logic/util/func_test.go index 21f2b293..df953a1d 100644 --- a/x/logic/util/func_test.go +++ b/x/logic/util/func_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/samber/lo" + . "github.com/smartystreets/goconvey/convey" ) diff --git a/x/logic/wasm/query.go b/x/logic/wasm/query.go index 01c801c6..80a12a58 100644 --- a/x/logic/wasm/query.go +++ b/x/logic/wasm/query.go @@ -3,9 +3,10 @@ package wasm import ( "encoding/json" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/okp4/okp4d/x/logic/keeper" "github.com/okp4/okp4d/x/logic/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // LogicQuerier ease the bridge between the logic module with the wasm CustomQuerier to allow wasm contracts to query diff --git a/x/mint/abci.go b/x/mint/abci.go index 2d97b3b7..2ce28032 100644 --- a/x/mint/abci.go +++ b/x/mint/abci.go @@ -3,10 +3,11 @@ package mint import ( "time" - "github.com/cosmos/cosmos-sdk/telemetry" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/okp4/okp4d/x/mint/keeper" "github.com/okp4/okp4d/x/mint/types" + + "github.com/cosmos/cosmos-sdk/telemetry" + sdk "github.com/cosmos/cosmos-sdk/types" ) // BeginBlocker mints new tokens for the previous block. diff --git a/x/mint/client/cli/query.go b/x/mint/client/cli/query.go index c8de4f05..2b505dee 100644 --- a/x/mint/client/cli/query.go +++ b/x/mint/client/cli/query.go @@ -3,11 +3,11 @@ package cli import ( "fmt" + "github.com/okp4/okp4d/x/mint/types" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/okp4/okp4d/x/mint/types" ) // GetQueryCmd returns the cli query commands for the minting module. diff --git a/x/mint/client/cli/query_test.go b/x/mint/client/cli/query_test.go index 3a098271..db144e14 100644 --- a/x/mint/client/cli/query_test.go +++ b/x/mint/client/cli/query_test.go @@ -7,18 +7,18 @@ import ( "strings" "testing" - rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" + "github.com/okp4/okp4d/x/mint" + mintcli "github.com/okp4/okp4d/x/mint/client/cli" "github.com/stretchr/testify/require" + rpcclientmock "github.com/cometbft/cometbft/rpc/client/mock" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/crypto/keyring" svrcmd "github.com/cosmos/cosmos-sdk/server/cmd" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" - - "github.com/cosmos/cosmos-sdk/crypto/keyring" testutilmod "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/okp4/okp4d/x/mint" - mintcli "github.com/okp4/okp4d/x/mint/client/cli" ) func TestGetCmdQueryParams(t *testing.T) { diff --git a/x/mint/keeper/genesis.go b/x/mint/keeper/genesis.go index 261e3278..6f86df8a 100644 --- a/x/mint/keeper/genesis.go +++ b/x/mint/keeper/genesis.go @@ -1,9 +1,11 @@ package keeper import ( + "github.com/okp4/okp4d/x/mint/types" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/okp4/okp4d/x/mint/types" ) // InitGenesis new mint genesis. diff --git a/x/mint/keeper/genesis_test.go b/x/mint/keeper/genesis_test.go index ea951877..6d194bca 100644 --- a/x/mint/keeper/genesis_test.go +++ b/x/mint/keeper/genesis_test.go @@ -3,20 +3,21 @@ package keeper_test import ( "testing" - "cosmossdk.io/math" "github.com/golang/mock/gomock" + "github.com/okp4/okp4d/x/mint" + "github.com/okp4/okp4d/x/mint/keeper" + minttestutil "github.com/okp4/okp4d/x/mint/testutil" + "github.com/okp4/okp4d/x/mint/types" "github.com/stretchr/testify/suite" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/okp4/okp4d/x/mint" - "github.com/okp4/okp4d/x/mint/keeper" - minttestutil "github.com/okp4/okp4d/x/mint/testutil" - "github.com/okp4/okp4d/x/mint/types" ) var minterAcc = authtypes.NewEmptyModuleAccount(types.ModuleName, authtypes.Minter) diff --git a/x/mint/keeper/grpc_query.go b/x/mint/keeper/grpc_query.go index f17b766e..f7e9f82d 100644 --- a/x/mint/keeper/grpc_query.go +++ b/x/mint/keeper/grpc_query.go @@ -3,8 +3,9 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/okp4/okp4d/x/mint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) var _ types.QueryServer = Keeper{} diff --git a/x/mint/keeper/grpc_query_test.go b/x/mint/keeper/grpc_query_test.go index d1404fa8..f32fe51d 100644 --- a/x/mint/keeper/grpc_query_test.go +++ b/x/mint/keeper/grpc_query_test.go @@ -5,6 +5,10 @@ import ( "testing" "github.com/golang/mock/gomock" + "github.com/okp4/okp4d/x/mint" + "github.com/okp4/okp4d/x/mint/keeper" + minttestutil "github.com/okp4/okp4d/x/mint/testutil" + "github.com/okp4/okp4d/x/mint/types" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/baseapp" @@ -13,10 +17,6 @@ import ( moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/okp4/okp4d/x/mint" - "github.com/okp4/okp4d/x/mint/keeper" - minttestutil "github.com/okp4/okp4d/x/mint/testutil" - "github.com/okp4/okp4d/x/mint/types" ) type MintTestSuite struct { diff --git a/x/mint/keeper/keeper.go b/x/mint/keeper/keeper.go index 95de9033..2cf1017a 100644 --- a/x/mint/keeper/keeper.go +++ b/x/mint/keeper/keeper.go @@ -1,14 +1,15 @@ package keeper import ( - "cosmossdk.io/math" + "github.com/okp4/okp4d/x/mint/types" "github.com/cometbft/cometbft/libs/log" + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/okp4/okp4d/x/mint/types" ) // Keeper of the mint store. diff --git a/x/mint/keeper/keeper_test.go b/x/mint/keeper/keeper_test.go index bc3267d7..91c84a3a 100644 --- a/x/mint/keeper/keeper_test.go +++ b/x/mint/keeper/keeper_test.go @@ -4,6 +4,10 @@ import ( "testing" "github.com/golang/mock/gomock" + "github.com/okp4/okp4d/x/mint" + "github.com/okp4/okp4d/x/mint/keeper" + minttestutil "github.com/okp4/okp4d/x/mint/testutil" + "github.com/okp4/okp4d/x/mint/types" "github.com/stretchr/testify/suite" "github.com/cosmos/cosmos-sdk/testutil" @@ -11,10 +15,6 @@ import ( moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/okp4/okp4d/x/mint" - "github.com/okp4/okp4d/x/mint/keeper" - minttestutil "github.com/okp4/okp4d/x/mint/testutil" - "github.com/okp4/okp4d/x/mint/types" ) type IntegrationTestSuite struct { diff --git a/x/mint/keeper/migrations.go b/x/mint/keeper/migrations.go index d4e7bed9..50bdc66a 100644 --- a/x/mint/keeper/migrations.go +++ b/x/mint/keeper/migrations.go @@ -1,9 +1,10 @@ package keeper import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/okp4/okp4d/x/mint/exported" v2 "github.com/okp4/okp4d/x/mint/migrations/v2" + + sdk "github.com/cosmos/cosmos-sdk/types" ) type Migrator struct { diff --git a/x/mint/keeper/msg_server.go b/x/mint/keeper/msg_server.go index d132da47..6d0c39d6 100644 --- a/x/mint/keeper/msg_server.go +++ b/x/mint/keeper/msg_server.go @@ -3,10 +3,12 @@ package keeper import ( "context" + "github.com/okp4/okp4d/x/mint/types" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/okp4/okp4d/x/mint/types" ) var _ types.MsgServer = msgServer{} diff --git a/x/mint/keeper/msg_server_test.go b/x/mint/keeper/msg_server_test.go index c3b056eb..148d49e1 100644 --- a/x/mint/keeper/msg_server_test.go +++ b/x/mint/keeper/msg_server_test.go @@ -1,8 +1,9 @@ package keeper_test import ( - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/okp4/okp4d/x/mint/types" + + sdk "github.com/cosmos/cosmos-sdk/types" ) func (s *IntegrationTestSuite) TestUpdateParams() { diff --git a/x/mint/migrations/v2/migrations.go b/x/mint/migrations/v2/migrations.go index fa618907..1d16199e 100644 --- a/x/mint/migrations/v2/migrations.go +++ b/x/mint/migrations/v2/migrations.go @@ -1,11 +1,12 @@ package v2 import ( + "github.com/okp4/okp4d/x/mint/exported" + "github.com/okp4/okp4d/x/mint/types" + "github.com/cosmos/cosmos-sdk/codec" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/okp4/okp4d/x/mint/exported" - "github.com/okp4/okp4d/x/mint/types" ) // MigrateStore migrates the x/mint module state from the consensus version 1 to diff --git a/x/mint/module.go b/x/mint/module.go index 1bce09c0..dd4f613e 100644 --- a/x/mint/module.go +++ b/x/mint/module.go @@ -5,21 +5,22 @@ import ( "encoding/json" "fmt" - abci "github.com/cometbft/cometbft/abci/types" "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/okp4/okp4d/x/mint/client/cli" "github.com/okp4/okp4d/x/mint/exported" + "github.com/okp4/okp4d/x/mint/keeper" + "github.com/okp4/okp4d/x/mint/simulation" + "github.com/okp4/okp4d/x/mint/types" "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" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/okp4/okp4d/x/mint/client/cli" - "github.com/okp4/okp4d/x/mint/keeper" - "github.com/okp4/okp4d/x/mint/simulation" - "github.com/okp4/okp4d/x/mint/types" ) var ( diff --git a/x/mint/module_test.go b/x/mint/module_test.go index ed4f510b..a692efa7 100644 --- a/x/mint/module_test.go +++ b/x/mint/module_test.go @@ -3,9 +3,10 @@ package mint_test import ( "testing" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/stretchr/testify/require" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" diff --git a/x/mint/simulation/decoder.go b/x/mint/simulation/decoder.go index f55c814d..7cde6773 100644 --- a/x/mint/simulation/decoder.go +++ b/x/mint/simulation/decoder.go @@ -4,9 +4,10 @@ import ( "bytes" "fmt" + "github.com/okp4/okp4d/x/mint/types" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types/kv" - "github.com/okp4/okp4d/x/mint/types" ) // NewDecodeStore returns a decoder function closure that unmarshals the KVPair's diff --git a/x/mint/simulation/decoder_test.go b/x/mint/simulation/decoder_test.go index 29581fd0..f14cbb8c 100644 --- a/x/mint/simulation/decoder_test.go +++ b/x/mint/simulation/decoder_test.go @@ -5,13 +5,13 @@ import ( "testing" "github.com/okp4/okp4d/x/mint" + "github.com/okp4/okp4d/x/mint/simulation" + "github.com/okp4/okp4d/x/mint/types" "github.com/stretchr/testify/require" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/okp4/okp4d/x/mint/simulation" - "github.com/okp4/okp4d/x/mint/types" ) func TestDecodeStore(t *testing.T) { diff --git a/x/mint/simulation/genesis.go b/x/mint/simulation/genesis.go index 70cdc78b..f1e49c8e 100644 --- a/x/mint/simulation/genesis.go +++ b/x/mint/simulation/genesis.go @@ -7,9 +7,10 @@ import ( "fmt" "math/rand" + "github.com/okp4/okp4d/x/mint/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/okp4/okp4d/x/mint/types" ) // Simulation parameter constants. diff --git a/x/mint/simulation/genesis_test.go b/x/mint/simulation/genesis_test.go index f9d9489c..6756aae5 100644 --- a/x/mint/simulation/genesis_test.go +++ b/x/mint/simulation/genesis_test.go @@ -6,16 +6,17 @@ import ( "math/rand" "testing" + "github.com/okp4/okp4d/x/mint/simulation" + "github.com/okp4/okp4d/x/mint/types" "github.com/stretchr/testify/require" sdkmath "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/okp4/okp4d/x/mint/simulation" - "github.com/okp4/okp4d/x/mint/types" ) // TestRandomizedGenState tests the normal scenario of applying RandomizedGenState. diff --git a/x/mint/simulation/proposals.go b/x/mint/simulation/proposals.go index 1a66fdad..a248d7fa 100644 --- a/x/mint/simulation/proposals.go +++ b/x/mint/simulation/proposals.go @@ -3,11 +3,12 @@ package simulation import ( "math/rand" + "github.com/okp4/okp4d/x/mint/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" - "github.com/okp4/okp4d/x/mint/types" ) // Simulation operation weights constants. diff --git a/x/mint/simulation/proposals_test.go b/x/mint/simulation/proposals_test.go index af110bae..a936875d 100644 --- a/x/mint/simulation/proposals_test.go +++ b/x/mint/simulation/proposals_test.go @@ -4,14 +4,15 @@ import ( "math/rand" "testing" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/okp4/okp4d/x/mint/simulation" + "github.com/okp4/okp4d/x/mint/types" "gotest.tools/v3/assert" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" - "github.com/okp4/okp4d/x/mint/simulation" - "github.com/okp4/okp4d/x/mint/types" ) func TestProposalMsgs(t *testing.T) { diff --git a/x/mint/types/expected_keepers.go b/x/mint/types/expected_keepers.go index d44783cf..919a6841 100644 --- a/x/mint/types/expected_keepers.go +++ b/x/mint/types/expected_keepers.go @@ -2,6 +2,7 @@ package types // noalias import ( "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/types" ) diff --git a/x/mint/types/minter.go b/x/mint/types/minter.go index c13a15a0..8f64015b 100644 --- a/x/mint/types/minter.go +++ b/x/mint/types/minter.go @@ -4,6 +4,7 @@ import ( "fmt" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/mint/types/minter_test.go b/x/mint/types/minter_test.go index 1951b910..e93b6844 100644 --- a/x/mint/types/minter_test.go +++ b/x/mint/types/minter_test.go @@ -5,9 +5,10 @@ import ( "math/rand" "testing" - "cosmossdk.io/math" "github.com/stretchr/testify/require" + "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/mint/types/msg.go b/x/mint/types/msg.go index 13b56771..1e67aff1 100644 --- a/x/mint/types/msg.go +++ b/x/mint/types/msg.go @@ -2,6 +2,7 @@ package types import ( errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" ) diff --git a/x/vesting/client/cli/tx.go b/x/vesting/client/cli/tx.go index ed98efa6..cc7d5410 100644 --- a/x/vesting/client/cli/tx.go +++ b/x/vesting/client/cli/tx.go @@ -6,13 +6,13 @@ import ( "os" "strconv" + "github.com/okp4/okp4d/x/vesting/types" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/okp4/okp4d/x/vesting/types" ) // FlagDelayed Transaction command flags. diff --git a/x/vesting/exported/exported.go b/x/vesting/exported/exported.go index 858e53ed..835ea59c 100644 --- a/x/vesting/exported/exported.go +++ b/x/vesting/exported/exported.go @@ -3,9 +3,8 @@ package exported import ( "time" - "github.com/cosmos/cosmos-sdk/x/auth/types" - sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/auth/types" ) // VestingAccount defines an account type that vests coins via a vesting schedule. diff --git a/x/vesting/module.go b/x/vesting/module.go index e0fc66b4..eff5306f 100644 --- a/x/vesting/module.go +++ b/x/vesting/module.go @@ -3,18 +3,19 @@ package vesting import ( "encoding/json" - abci "github.com/cometbft/cometbft/abci/types" "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/okp4/okp4d/x/vesting/client/cli" + "github.com/okp4/okp4d/x/vesting/types" "github.com/spf13/cobra" + abci "github.com/cometbft/cometbft/abci/types" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/auth/keeper" - "github.com/okp4/okp4d/x/vesting/client/cli" - "github.com/okp4/okp4d/x/vesting/types" ) var ( diff --git a/x/vesting/msg_server.go b/x/vesting/msg_server.go index 08f30ea5..70dfbc53 100644 --- a/x/vesting/msg_server.go +++ b/x/vesting/msg_server.go @@ -4,13 +4,15 @@ import ( "context" "github.com/armon/go-metrics" + "github.com/okp4/okp4d/x/vesting/types" + + errorsmod "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/okp4/okp4d/x/vesting/types" ) type msgServer struct { @@ -47,11 +49,11 @@ func (s msgServer) CreateVestingAccount(goCtx context.Context, } if bk.BlockedAddr(to) { - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", msg.ToAddress) + return nil, errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", msg.ToAddress) } if acc := ak.GetAccount(ctx, to); acc != nil { - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "account %s already exists", msg.ToAddress) + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "account %s already exists", msg.ToAddress) } baseAccount := authtypes.NewBaseAccountWithAddress(to) @@ -110,11 +112,11 @@ func (s msgServer) CreatePermanentLockedAccount(goCtx context.Context, } if bk.BlockedAddr(to) { - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", msg.ToAddress) + return nil, errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", msg.ToAddress) } if acc := ak.GetAccount(ctx, to); acc != nil { - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "account %s already exists", msg.ToAddress) + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "account %s already exists", msg.ToAddress) } baseAccount := authtypes.NewBaseAccountWithAddress(to) @@ -163,7 +165,7 @@ func (s msgServer) CreatePeriodicVestingAccount(goCtx context.Context, } if acc := ak.GetAccount(ctx, to); acc != nil { - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "account %s already exists", msg.ToAddress) + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "account %s already exists", msg.ToAddress) } var totalCoins sdk.Coins @@ -225,11 +227,11 @@ func (s msgServer) CreateCliffVestingAccount(goCtx context.Context, } if bk.BlockedAddr(to) { - return nil, sdkerrors.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", msg.ToAddress) + return nil, errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", msg.ToAddress) } if acc := ak.GetAccount(ctx, to); acc != nil { - return nil, sdkerrors.Wrapf(sdkerrors.ErrInvalidRequest, "account %s already exists", msg.ToAddress) + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "account %s already exists", msg.ToAddress) } baseAccount := authtypes.NewBaseAccountWithAddress(to) diff --git a/x/vesting/msg_server_test.go b/x/vesting/msg_server_test.go index a9f15a59..36dd8527 100644 --- a/x/vesting/msg_server_test.go +++ b/x/vesting/msg_server_test.go @@ -4,19 +4,20 @@ import ( "testing" "time" - tmproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtime "github.com/cometbft/cometbft/types/time" "github.com/golang/mock/gomock" + "github.com/okp4/okp4d/x/vesting" + vestingtestutil "github.com/okp4/okp4d/x/vesting/testutil" + vestingtypes "github.com/okp4/okp4d/x/vesting/types" "github.com/stretchr/testify/suite" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" + "github.com/cosmos/cosmos-sdk/testutil" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" authkeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/okp4/okp4d/x/vesting" - vestingtestutil "github.com/okp4/okp4d/x/vesting/testutil" - vestingtypes "github.com/okp4/okp4d/x/vesting/types" ) var ( diff --git a/x/vesting/types/codec.go b/x/vesting/types/codec.go index 582a8add..a1d498c7 100644 --- a/x/vesting/types/codec.go +++ b/x/vesting/types/codec.go @@ -1,6 +1,8 @@ package types import ( + "github.com/okp4/okp4d/x/vesting/exported" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" "github.com/cosmos/cosmos-sdk/codec/types" @@ -8,7 +10,6 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/msgservice" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/okp4/okp4d/x/vesting/exported" ) // RegisterLegacyAminoCodec registers the vesting interfaces and concrete types on the diff --git a/x/vesting/types/msgs.go b/x/vesting/types/msgs.go index 74a6b029..c8606cc6 100644 --- a/x/vesting/types/msgs.go +++ b/x/vesting/types/msgs.go @@ -3,6 +3,8 @@ package types import ( "fmt" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -61,15 +63,15 @@ func (msg MsgCreateVestingAccount) ValidateBasic() error { } if !msg.Amount.IsValid() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) + return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) } if !msg.Amount.IsAllPositive() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) + return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) } if msg.EndTime <= 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid end time") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "invalid end time") } return nil @@ -184,11 +186,11 @@ func (msg MsgCreatePeriodicVestingAccount) ValidateBasic() error { return err } if err := sdk.VerifyAddressFormat(from); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address: %s", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid sender address: %s", err) } if err := sdk.VerifyAddressFormat(to); err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid recipient address: %s", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid recipient address: %s", err) } if msg.StartTime < 1 { @@ -237,23 +239,23 @@ func (msg MsgCreateCliffVestingAccount) ValidateBasic() error { } if !msg.Amount.IsValid() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) + return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) } if !msg.Amount.IsAllPositive() { - return sdkerrors.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) + return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, msg.Amount.String()) } if msg.EndTime <= 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid end time") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "invalid end time") } if msg.CliffTime <= 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid cliff time") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "invalid cliff time") } if msg.CliffTime > msg.EndTime { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "cliff time should be before end time") + return errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "cliff time should be before end time") } return nil diff --git a/x/vesting/types/vesting_account.go b/x/vesting/types/vesting_account.go index a23f6e62..39e5c247 100644 --- a/x/vesting/types/vesting_account.go +++ b/x/vesting/types/vesting_account.go @@ -4,12 +4,12 @@ import ( "errors" "time" + vestexported "github.com/okp4/okp4d/x/vesting/exported" "sigs.k8s.io/yaml" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - vestexported "github.com/okp4/okp4d/x/vesting/exported" ) // Compile-time type assertions. diff --git a/x/vesting/types/vesting_account_test.go b/x/vesting/types/vesting_account_test.go index 2f303c08..96617211 100644 --- a/x/vesting/types/vesting_account_test.go +++ b/x/vesting/types/vesting_account_test.go @@ -4,21 +4,22 @@ import ( "testing" "time" - cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - tmtime "github.com/cometbft/cometbft/types/time" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - "github.com/cosmos/cosmos-sdk/testutil" - moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - "github.com/cosmos/cosmos-sdk/x/auth/keeper" "github.com/okp4/okp4d/x/vesting" + "github.com/okp4/okp4d/x/vesting/types" "github.com/stretchr/testify/require" "github.com/stretchr/testify/suite" + cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" + tmtime "github.com/cometbft/cometbft/types/time" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + storetypes "github.com/cosmos/cosmos-sdk/store/types" + "github.com/cosmos/cosmos-sdk/testutil" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" + moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" + "github.com/cosmos/cosmos-sdk/x/auth/keeper" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - "github.com/okp4/okp4d/x/vesting/types" ) var (