From 9989e21b68f59a864b79d7125aa5ecd0a534805e Mon Sep 17 00:00:00 2001 From: Fynn Date: Thu, 3 Aug 2023 13:27:19 +0800 Subject: [PATCH] fix format --- app/export_test.go | 5 +++-- e2e/tests/permission_test.go | 9 +++++---- internal/sequence/sequence.go | 4 ++-- x/bridge/client/cli/tx_test.go | 4 ++-- x/challenge/client/cli/query_test.go | 2 +- x/payment/client/cli/query_test.go | 2 +- x/permission/client/cli/query_test.go | 2 +- x/permission/keeper/keeper.go | 9 +++++---- x/sp/client/cli/query_test.go | 2 +- x/storage/client/cli/query_test.go | 2 +- x/storage/keeper/keeper_test.go | 4 +++- x/virtualgroup/client/cli/query_test.go | 2 +- 12 files changed, 26 insertions(+), 21 deletions(-) diff --git a/app/export_test.go b/app/export_test.go index a9c3cd26a..6982c7fab 100644 --- a/app/export_test.go +++ b/app/export_test.go @@ -3,11 +3,12 @@ package app_test import ( "testing" - "github.com/bnb-chain/greenfield/sdk/client/test" - "github.com/bnb-chain/greenfield/testutil" dbm "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + + "github.com/bnb-chain/greenfield/sdk/client/test" + "github.com/bnb-chain/greenfield/testutil" ) func TestExportAppStateAndValidators(t *testing.T) { diff --git a/e2e/tests/permission_test.go b/e2e/tests/permission_test.go index 8b48b38cb..1b551c9b1 100644 --- a/e2e/tests/permission_test.go +++ b/e2e/tests/permission_test.go @@ -9,6 +9,11 @@ import ( "time" sdkmath "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" + govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" + sdktype "github.com/bnb-chain/greenfield/sdk/types" storageutil "github.com/bnb-chain/greenfield/testutil/storage" types2 "github.com/bnb-chain/greenfield/types" @@ -16,10 +21,6 @@ import ( "github.com/bnb-chain/greenfield/types/resource" "github.com/bnb-chain/greenfield/x/permission/types" storagetypes "github.com/bnb-chain/greenfield/x/storage/types" - sdk "github.com/cosmos/cosmos-sdk/types" - authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" - govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" - govtypesv1 "github.com/cosmos/cosmos-sdk/x/gov/types/v1" ) func (s *StorageTestSuite) TestDeleteBucketPermission() { diff --git a/internal/sequence/sequence.go b/internal/sequence/sequence.go index 7cd406e58..28d3f0d49 100644 --- a/internal/sequence/sequence.go +++ b/internal/sequence/sequence.go @@ -16,11 +16,11 @@ type Number interface { uint32 | math.Uint } -type Sequence[T Number] struct { +type Sequence struct { storeKey []byte } -func NewSequence[T Number](prefix []byte) Sequence[T] { +func NewSequence(prefix []byte) Sequence[T] { return Sequence[T]{ storeKey: prefix, } diff --git a/x/bridge/client/cli/tx_test.go b/x/bridge/client/cli/tx_test.go index 3f04f8dfb..09124a371 100644 --- a/x/bridge/client/cli/tx_test.go +++ b/x/bridge/client/cli/tx_test.go @@ -9,7 +9,9 @@ import ( abci "github.com/cometbft/cometbft/abci/types" 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" + "github.com/cosmos/cosmos-sdk/testutil" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/suite" @@ -19,8 +21,6 @@ import ( "github.com/bnb-chain/greenfield/sdk/client/test" "github.com/bnb-chain/greenfield/testutil/sample" "github.com/bnb-chain/greenfield/x/bridge/client/cli" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/testutil" ) type CLITestSuite struct { diff --git a/x/challenge/client/cli/query_test.go b/x/challenge/client/cli/query_test.go index cfb109862..1ac6147f3 100644 --- a/x/challenge/client/cli/query_test.go +++ b/x/challenge/client/cli/query_test.go @@ -3,12 +3,12 @@ package cli_test import ( "fmt" + "github.com/cosmos/cosmos-sdk/client/flags" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/gogoproto/proto" "github.com/bnb-chain/greenfield/x/challenge/client/cli" "github.com/bnb-chain/greenfield/x/challenge/types" - "github.com/cosmos/cosmos-sdk/client/flags" ) func (s *CLITestSuite) TestQueryCmd() { diff --git a/x/payment/client/cli/query_test.go b/x/payment/client/cli/query_test.go index 3428869ee..39f830e6e 100644 --- a/x/payment/client/cli/query_test.go +++ b/x/payment/client/cli/query_test.go @@ -3,13 +3,13 @@ package cli_test import ( "fmt" + "github.com/cosmos/cosmos-sdk/client/flags" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/gogoproto/proto" "github.com/bnb-chain/greenfield/testutil/sample" "github.com/bnb-chain/greenfield/x/payment/client/cli" "github.com/bnb-chain/greenfield/x/payment/types" - "github.com/cosmos/cosmos-sdk/client/flags" ) func (s *CLITestSuite) TestQueryCmd() { diff --git a/x/permission/client/cli/query_test.go b/x/permission/client/cli/query_test.go index 44d63f5c6..5ffb5532b 100644 --- a/x/permission/client/cli/query_test.go +++ b/x/permission/client/cli/query_test.go @@ -3,12 +3,12 @@ package cli_test import ( "fmt" + "github.com/cosmos/cosmos-sdk/client/flags" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/gogoproto/proto" "github.com/bnb-chain/greenfield/x/payment/client/cli" "github.com/bnb-chain/greenfield/x/payment/types" - "github.com/cosmos/cosmos-sdk/client/flags" ) func (s *CLITestSuite) TestQueryCmd() { diff --git a/x/permission/keeper/keeper.go b/x/permission/keeper/keeper.go index 7e90077bb..ae3c1aaea 100644 --- a/x/permission/keeper/keeper.go +++ b/x/permission/keeper/keeper.go @@ -4,15 +4,16 @@ import ( "fmt" "cosmossdk.io/math" - "github.com/bnb-chain/greenfield/internal/sequence" - "github.com/bnb-chain/greenfield/types/resource" - "github.com/bnb-chain/greenfield/x/permission/types" - storagetypes "github.com/bnb-chain/greenfield/x/storage/types" "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/store/prefix" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/bnb-chain/greenfield/internal/sequence" + "github.com/bnb-chain/greenfield/types/resource" + "github.com/bnb-chain/greenfield/x/permission/types" + storagetypes "github.com/bnb-chain/greenfield/x/storage/types" ) type ( diff --git a/x/sp/client/cli/query_test.go b/x/sp/client/cli/query_test.go index f7dbf1a80..7c59b700b 100644 --- a/x/sp/client/cli/query_test.go +++ b/x/sp/client/cli/query_test.go @@ -3,13 +3,13 @@ package cli_test import ( "fmt" + "github.com/cosmos/cosmos-sdk/client/flags" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/gogoproto/proto" "github.com/bnb-chain/greenfield/testutil/sample" "github.com/bnb-chain/greenfield/x/sp/client/cli" "github.com/bnb-chain/greenfield/x/sp/types" - "github.com/cosmos/cosmos-sdk/client/flags" ) func (s *CLITestSuite) TestQueryCmd() { diff --git a/x/storage/client/cli/query_test.go b/x/storage/client/cli/query_test.go index ff984294c..14aaa57fd 100644 --- a/x/storage/client/cli/query_test.go +++ b/x/storage/client/cli/query_test.go @@ -3,13 +3,13 @@ package cli_test import ( "fmt" + "github.com/cosmos/cosmos-sdk/client/flags" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/gogoproto/proto" "github.com/bnb-chain/greenfield/testutil/sample" "github.com/bnb-chain/greenfield/x/storage/client/cli" "github.com/bnb-chain/greenfield/x/storage/types" - "github.com/cosmos/cosmos-sdk/client/flags" ) func (s *CLITestSuite) TestQueryCmd() { diff --git a/x/storage/keeper/keeper_test.go b/x/storage/keeper/keeper_test.go index 5c0c44b2c..6188eddba 100644 --- a/x/storage/keeper/keeper_test.go +++ b/x/storage/keeper/keeper_test.go @@ -1,6 +1,8 @@ package keeper_test -import "github.com/bnb-chain/greenfield/testutil/sample" +import ( + "github.com/bnb-chain/greenfield/testutil/sample" +) func (s *TestSuite) TestClearDiscontinueBucketCount() { acc1 := sample.RandAccAddress() diff --git a/x/virtualgroup/client/cli/query_test.go b/x/virtualgroup/client/cli/query_test.go index 51838ba12..b8299e5d7 100644 --- a/x/virtualgroup/client/cli/query_test.go +++ b/x/virtualgroup/client/cli/query_test.go @@ -3,12 +3,12 @@ package cli_test import ( "fmt" + "github.com/cosmos/cosmos-sdk/client/flags" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/cosmos/gogoproto/proto" "github.com/bnb-chain/greenfield/x/virtualgroup/client/cli" "github.com/bnb-chain/greenfield/x/virtualgroup/types" - "github.com/cosmos/cosmos-sdk/client/flags" ) func (s *CLITestSuite) TestQueryCmd() {