From 90f8c0122a28d93921ce314f69187d765be3d6a6 Mon Sep 17 00:00:00 2001 From: foxytanuki Date: Tue, 19 Dec 2023 13:15:59 +0900 Subject: [PATCH 01/17] Run `make format` --- app/app.go | 1 - cmd/myceld/dns/dns.go | 1 - cmd/myceld/docs/docs.go | 2 +- x/epochs/client/cli/tx.go | 4 +--- x/epochs/keeper/epoch_info.go | 2 -- x/epochs/keeper/epoch_info_test.go | 1 + x/epochs/keeper/hooks_test.go | 2 -- x/epochs/keeper/keeper.go | 1 - x/epochs/keeper/query_epoch_info.go | 1 - x/furnace/client/cli/tx.go | 4 +--- x/furnace/keeper/burn_amount.go | 2 -- x/furnace/keeper/burn_amount_test.go | 1 + x/furnace/keeper/hooks.go | 3 +-- x/furnace/keeper/hooks_test.go | 4 ---- x/furnace/keeper/query_burn_amount.go | 1 - x/furnace/types/genesis_test.go | 1 - x/registry/client/cli/tx.go | 4 +--- x/registry/keeper/domain_ownership.go | 2 -- x/registry/keeper/domain_ownership_test.go | 1 + ...tend_top_level_domain_expiration_date_test.go | 1 - ...g_server_register_second_level_domain_test.go | 2 -- .../msg_server_register_top_level_domain_test.go | 1 - .../keeper/msg_server_update_dns_record_test.go | 2 -- .../keeper/msg_server_update_text_record_test.go | 2 -- .../msg_server_update_wallet_record_test.go | 2 -- x/registry/keeper/query_domain_ownership.go | 1 - x/registry/keeper/query_role_test.go | 1 - x/registry/keeper/query_second_level_domain.go | 1 - x/registry/keeper/query_top_level_domain.go | 1 - x/registry/keeper/second_level_domain.go | 2 -- x/registry/keeper/second_level_domain_test.go | 1 + x/registry/keeper/setup_test.go | 1 - x/registry/keeper/top_level_domain.go | 2 -- x/registry/keeper/top_level_domain_test.go | 2 +- x/registry/types/genesis_test.go | 1 - x/registry/types/secend_level_domain.go | 2 -- x/registry/types/second_level_domain_test.go | 16 ++++++++++------ x/registry/types/top_level_domain_test.go | 15 ++++++++++----- x/registry/types/validate_second_level_domain.go | 1 - x/registry/types/validate_top_level_domain.go | 1 - x/registry/types/wallet_record.go | 1 - x/resolver/client/cli/query_all_records.go | 1 - x/resolver/client/cli/query_dns_record.go | 1 - x/resolver/client/cli/query_text_record.go | 1 - x/resolver/client/cli/query_wallet_record.go | 1 - x/resolver/client/cli/tx.go | 4 +--- 46 files changed, 31 insertions(+), 74 deletions(-) diff --git a/app/app.go b/app/app.go index a0d2a041..9e5831ef 100644 --- a/app/app.go +++ b/app/app.go @@ -350,7 +350,6 @@ func NewApp( appOpts servertypes.AppOptions, wasmOpts []wasmkeeper.Option, baseAppOptions ...func(*baseapp.BaseApp), - ) *App { appCodec := encodingConfig.Marshaler cdc := encodingConfig.Amino diff --git a/cmd/myceld/dns/dns.go b/cmd/myceld/dns/dns.go index 6c79df76..afd1fb5b 100644 --- a/cmd/myceld/dns/dns.go +++ b/cmd/myceld/dns/dns.go @@ -21,7 +21,6 @@ type grpcService struct { type DnsRecord interface{} func (s *grpcService) QueryDnsToMycelResolver(domain string, recordType string) (dnsRecord DnsRecord) { - domain = strings.Trim(domain, ".") division := strings.Index(domain, ".") diff --git a/cmd/myceld/docs/docs.go b/cmd/myceld/docs/docs.go index 832d08a1..ab3efbd2 100644 --- a/cmd/myceld/docs/docs.go +++ b/cmd/myceld/docs/docs.go @@ -15,7 +15,7 @@ func DocsCommand(rootCmd *cobra.Command) *cobra.Command { RunE: func(cmd *cobra.Command, _ []string) (err error) { path := "docs/static/cmd" - if err := os.MkdirAll(path, os.FileMode(0644)); err != nil { + if err := os.MkdirAll(path, os.FileMode(0o644)); err != nil { fmt.Println(err) os.Exit(1) } diff --git a/x/epochs/client/cli/tx.go b/x/epochs/client/cli/tx.go index d2c14f57..a375795c 100644 --- a/x/epochs/client/cli/tx.go +++ b/x/epochs/client/cli/tx.go @@ -11,9 +11,7 @@ import ( "github.com/mycel-domain/mycel/x/epochs/types" ) -var ( - DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) -) +var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) const ( flagPacketTimeoutTimestamp = "packet-timeout-timestamp" diff --git a/x/epochs/keeper/epoch_info.go b/x/epochs/keeper/epoch_info.go index 345e4f8c..285daaf5 100644 --- a/x/epochs/keeper/epoch_info.go +++ b/x/epochs/keeper/epoch_info.go @@ -20,7 +20,6 @@ func (k Keeper) SetEpochInfo(ctx sdk.Context, epochInfo types.EpochInfo) { func (k Keeper) GetEpochInfo( ctx sdk.Context, identifier string, - ) (val types.EpochInfo, found bool) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.EpochInfoKeyPrefix)) @@ -39,7 +38,6 @@ func (k Keeper) GetEpochInfo( func (k Keeper) RemoveEpochInfo( ctx sdk.Context, identifier string, - ) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.EpochInfoKeyPrefix)) store.Delete(types.EpochInfoKey( diff --git a/x/epochs/keeper/epoch_info_test.go b/x/epochs/keeper/epoch_info_test.go index ef599b1e..6365976b 100644 --- a/x/epochs/keeper/epoch_info_test.go +++ b/x/epochs/keeper/epoch_info_test.go @@ -40,6 +40,7 @@ func TestEpochInfoGet(t *testing.T) { ) } } + func TestEpochInfoRemove(t *testing.T) { keeper, ctx := keepertest.EpochsKeeper(t) items := createNEpochInfo(keeper, ctx, 10) diff --git a/x/epochs/keeper/hooks_test.go b/x/epochs/keeper/hooks_test.go index 693453fe..0c68a46a 100644 --- a/x/epochs/keeper/hooks_test.go +++ b/x/epochs/keeper/hooks_test.go @@ -159,8 +159,6 @@ func (suite *KeeperTestSuite) TestAfterEpochHooks() { } } - }) } - } diff --git a/x/epochs/keeper/keeper.go b/x/epochs/keeper/keeper.go index 7c711c82..219b3650 100644 --- a/x/epochs/keeper/keeper.go +++ b/x/epochs/keeper/keeper.go @@ -27,7 +27,6 @@ func NewKeeper( storeKey, memKey storetypes.StoreKey, ps paramtypes.Subspace, - ) *Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { diff --git a/x/epochs/keeper/query_epoch_info.go b/x/epochs/keeper/query_epoch_info.go index 661b8ae7..065908bf 100644 --- a/x/epochs/keeper/query_epoch_info.go +++ b/x/epochs/keeper/query_epoch_info.go @@ -32,7 +32,6 @@ func (k Keeper) EpochInfoAll(goCtx context.Context, req *types.QueryAllEpochInfo epochInfos = append(epochInfos, epochInfo) return nil }) - if err != nil { return nil, status.Error(codes.Internal, err.Error()) } diff --git a/x/furnace/client/cli/tx.go b/x/furnace/client/cli/tx.go index 524e6d26..9bb1237d 100644 --- a/x/furnace/client/cli/tx.go +++ b/x/furnace/client/cli/tx.go @@ -11,9 +11,7 @@ import ( "github.com/mycel-domain/mycel/x/furnace/types" ) -var ( - DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) -) +var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) const ( flagPacketTimeoutTimestamp = "packet-timeout-timestamp" diff --git a/x/furnace/keeper/burn_amount.go b/x/furnace/keeper/burn_amount.go index ed48e2f3..03663fe7 100644 --- a/x/furnace/keeper/burn_amount.go +++ b/x/furnace/keeper/burn_amount.go @@ -22,7 +22,6 @@ func (k Keeper) SetBurnAmount(ctx sdk.Context, burnAmount types.BurnAmount) { func (k Keeper) GetBurnAmount( ctx sdk.Context, index uint64, - ) (val types.BurnAmount, found bool) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BurnAmountKeyPrefix)) @@ -41,7 +40,6 @@ func (k Keeper) GetBurnAmount( func (k Keeper) RemoveBurnAmount( ctx sdk.Context, index uint64, - ) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.BurnAmountKeyPrefix)) store.Delete(types.BurnAmountKey( diff --git a/x/furnace/keeper/burn_amount_test.go b/x/furnace/keeper/burn_amount_test.go index 77b859d7..cad058ba 100644 --- a/x/furnace/keeper/burn_amount_test.go +++ b/x/furnace/keeper/burn_amount_test.go @@ -42,6 +42,7 @@ func TestBurnAmountGet(t *testing.T) { ) } } + func TestBurnAmountRemove(t *testing.T) { keeper, ctx := keepertest.FurnaceKeeper(t) items := createNBurnAmount(keeper, ctx, 10) diff --git a/x/furnace/keeper/hooks.go b/x/furnace/keeper/hooks.go index af33d67e..6521952b 100644 --- a/x/furnace/keeper/hooks.go +++ b/x/furnace/keeper/hooks.go @@ -13,7 +13,7 @@ func (k Keeper) BeforeEpochStart(ctx sdk.Context, epochIdentifier string, epochN // AfterEpochEnd is the epoch end hook. func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumber int64) { - var burnt = sdk.NewCoin(params.DefaultBondDenom, sdk.NewInt(0)) + burnt := sdk.NewCoin(params.DefaultBondDenom, sdk.NewInt(0)) config, found := k.GetEpochBurnConfig(ctx) if !found { @@ -63,7 +63,6 @@ func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumb // Emit event EmitEpochBurnEvent(ctx, epochIdentifier, epochNumber, &burnAmount, burnt) - } // ___________________________________________________________________________________________________ diff --git a/x/furnace/keeper/hooks_test.go b/x/furnace/keeper/hooks_test.go index 1543627f..67ae5fac 100644 --- a/x/furnace/keeper/hooks_test.go +++ b/x/furnace/keeper/hooks_test.go @@ -85,14 +85,11 @@ func (suite *KeeperTestSuite) TestAfterEpochEndCreateBurnAmount() { for i, event := range events { suite.Require().Equal(tc.expectedEvents[i].BurnAmountIndex, event.Attributes[0].Value) } - }) } - } func (suite *KeeperTestSuite) TestAfterEpochEnd() { - testCases := []struct { totalBurnAmounts []int64 expectedEvents []ExpBurnEvent @@ -262,5 +259,4 @@ func (suite *KeeperTestSuite) TestAfterEpochEnd() { } }) } - } diff --git a/x/furnace/keeper/query_burn_amount.go b/x/furnace/keeper/query_burn_amount.go index 01e97889..0fa282c2 100644 --- a/x/furnace/keeper/query_burn_amount.go +++ b/x/furnace/keeper/query_burn_amount.go @@ -32,7 +32,6 @@ func (k Keeper) BurnAmountAll(goCtx context.Context, req *types.QueryAllBurnAmou burnAmounts = append(burnAmounts, burnAmount) return nil }) - if err != nil { return nil, status.Error(codes.Internal, err.Error()) } diff --git a/x/furnace/types/genesis_test.go b/x/furnace/types/genesis_test.go index 229c6bd1..f662045e 100644 --- a/x/furnace/types/genesis_test.go +++ b/x/furnace/types/genesis_test.go @@ -22,7 +22,6 @@ func TestGenesisState_Validate(t *testing.T) { { desc: "valid genesis state", genState: &types.GenesisState{ - EpochBurnConfig: types.EpochBurnConfig{ EpochIdentifier: "35", }, diff --git a/x/registry/client/cli/tx.go b/x/registry/client/cli/tx.go index 55dd3a54..7a5eec55 100644 --- a/x/registry/client/cli/tx.go +++ b/x/registry/client/cli/tx.go @@ -11,9 +11,7 @@ import ( "github.com/mycel-domain/mycel/x/registry/types" ) -var ( - DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) -) +var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) const ( flagPacketTimeoutTimestamp = "packet-timeout-timestamp" diff --git a/x/registry/keeper/domain_ownership.go b/x/registry/keeper/domain_ownership.go index 297cabf5..ac8d54bc 100644 --- a/x/registry/keeper/domain_ownership.go +++ b/x/registry/keeper/domain_ownership.go @@ -20,7 +20,6 @@ func (k Keeper) SetDomainOwnership(ctx sdk.Context, domainOwnership types.Domain func (k Keeper) GetDomainOwnership( ctx sdk.Context, owner string, - ) (val types.DomainOwnership, found bool) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.DomainOwnershipKeyPrefix)) @@ -39,7 +38,6 @@ func (k Keeper) GetDomainOwnership( func (k Keeper) RemoveDomainOwnership( ctx sdk.Context, owner string, - ) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.DomainOwnershipKeyPrefix)) store.Delete(types.DomainOwnershipKey( diff --git a/x/registry/keeper/domain_ownership_test.go b/x/registry/keeper/domain_ownership_test.go index b340fdd2..70317482 100644 --- a/x/registry/keeper/domain_ownership_test.go +++ b/x/registry/keeper/domain_ownership_test.go @@ -40,6 +40,7 @@ func TestDomainOwnershipGet(t *testing.T) { ) } } + func TestDomainOwnershipRemove(t *testing.T) { keeper, ctx := keepertest.RegistryKeeper(t) items := createNDomainOwnership(keeper, ctx, 10) diff --git a/x/registry/keeper/msg_server_extend_top_level_domain_expiration_date_test.go b/x/registry/keeper/msg_server_extend_top_level_domain_expiration_date_test.go index 896f3f07..e1819fa4 100644 --- a/x/registry/keeper/msg_server_extend_top_level_domain_expiration_date_test.go +++ b/x/registry/keeper/msg_server_extend_top_level_domain_expiration_date_test.go @@ -99,7 +99,6 @@ func (suite *KeeperTestSuite) TestExtendTopLevelDomain() { // Check if the total is equal to the sum of toBurn and toTreasury if total.Len() == 1 { suite.Require().Equal(total, sdk.NewCoins(toBurn.Add(toTreasury))) - } else { suite.Require().Equal(total, sdk.NewCoins(toBurn, toTreasury)) } diff --git a/x/registry/keeper/msg_server_register_second_level_domain_test.go b/x/registry/keeper/msg_server_register_second_level_domain_test.go index 08fd609a..ca96e940 100644 --- a/x/registry/keeper/msg_server_register_second_level_domain_test.go +++ b/x/registry/keeper/msg_server_register_second_level_domain_test.go @@ -149,8 +149,6 @@ func (suite *KeeperTestSuite) TestRegisterSecondLevelDomain() { _, err := suite.msgServer.RegisterSecondLevelDomain(suite.ctx, registerMsg) suite.Require().EqualError(err, tc.expErr.Error()) } - }) } - } diff --git a/x/registry/keeper/msg_server_register_top_level_domain_test.go b/x/registry/keeper/msg_server_register_top_level_domain_test.go index 9a88862c..c8e26151 100644 --- a/x/registry/keeper/msg_server_register_top_level_domain_test.go +++ b/x/registry/keeper/msg_server_register_top_level_domain_test.go @@ -112,7 +112,6 @@ func (suite *KeeperTestSuite) TestRegisterTopLevelDomain() { // Check if the total is equal to the sum of toBurn and toTreasury if total.Len() == 1 { suite.Require().Equal(total, sdk.NewCoins(toBurn.Add(toTreasury))) - } else { suite.Require().Equal(total, sdk.NewCoins(toBurn, toTreasury)) } diff --git a/x/registry/keeper/msg_server_update_dns_record_test.go b/x/registry/keeper/msg_server_update_dns_record_test.go index 9b645ba5..66bba229 100644 --- a/x/registry/keeper/msg_server_update_dns_record_test.go +++ b/x/registry/keeper/msg_server_update_dns_record_test.go @@ -109,8 +109,6 @@ func (suite *KeeperTestSuite) TestUpdateDnsRecord() { } else { suite.Require().EqualError(err, tc.expErr.Error()) } - }) } - } diff --git a/x/registry/keeper/msg_server_update_text_record_test.go b/x/registry/keeper/msg_server_update_text_record_test.go index ed5183a9..11c2d3a5 100644 --- a/x/registry/keeper/msg_server_update_text_record_test.go +++ b/x/registry/keeper/msg_server_update_text_record_test.go @@ -100,8 +100,6 @@ func (suite *KeeperTestSuite) TestUpdateTextRecord() { } else { suite.Require().EqualError(err, tc.expErr.Error()) } - }) } - } diff --git a/x/registry/keeper/msg_server_update_wallet_record_test.go b/x/registry/keeper/msg_server_update_wallet_record_test.go index 72f5b24d..6fb741de 100644 --- a/x/registry/keeper/msg_server_update_wallet_record_test.go +++ b/x/registry/keeper/msg_server_update_wallet_record_test.go @@ -128,8 +128,6 @@ func (suite *KeeperTestSuite) TestUpdateWalletRecord() { } else { suite.Require().EqualError(err, tc.expErr.Error()) } - }) } - } diff --git a/x/registry/keeper/query_domain_ownership.go b/x/registry/keeper/query_domain_ownership.go index da634540..f24d96db 100644 --- a/x/registry/keeper/query_domain_ownership.go +++ b/x/registry/keeper/query_domain_ownership.go @@ -32,7 +32,6 @@ func (k Keeper) DomainOwnershipAll(goCtx context.Context, req *types.QueryAllDom domainOwnerships = append(domainOwnerships, domainOwnership) return nil }) - if err != nil { return nil, status.Error(codes.Internal, err.Error()) } diff --git a/x/registry/keeper/query_role_test.go b/x/registry/keeper/query_role_test.go index 149ce92c..f8e6b737 100644 --- a/x/registry/keeper/query_role_test.go +++ b/x/registry/keeper/query_role_test.go @@ -88,7 +88,6 @@ func (suite *KeeperTestSuite) TestRole() { for i, tc := range tcs { suite.Run(fmt.Sprintf("Case %d", i), func() { - // Get valid domain resp, err := k.Role(ctx, tc.request) if tc.err == nil { diff --git a/x/registry/keeper/query_second_level_domain.go b/x/registry/keeper/query_second_level_domain.go index 1a7a0f40..07a1b67a 100644 --- a/x/registry/keeper/query_second_level_domain.go +++ b/x/registry/keeper/query_second_level_domain.go @@ -37,7 +37,6 @@ func (k Keeper) SecondLevelDomainAll(goCtx context.Context, req *types.QueryAllS secondLevelDomains = append(secondLevelDomains, secondLevelDomainResponse) return nil }) - if err != nil { return nil, status.Error(codes.Internal, err.Error()) } diff --git a/x/registry/keeper/query_top_level_domain.go b/x/registry/keeper/query_top_level_domain.go index b6bfd7a0..781c0807 100644 --- a/x/registry/keeper/query_top_level_domain.go +++ b/x/registry/keeper/query_top_level_domain.go @@ -32,7 +32,6 @@ func (k Keeper) TopLevelDomainAll(goCtx context.Context, req *types.QueryAllTopL topLevelDomains = append(topLevelDomains, topLevelDomain) return nil }) - if err != nil { return nil, status.Error(codes.Internal, err.Error()) } diff --git a/x/registry/keeper/second_level_domain.go b/x/registry/keeper/second_level_domain.go index 2c9c5c45..d4c4c400 100644 --- a/x/registry/keeper/second_level_domain.go +++ b/x/registry/keeper/second_level_domain.go @@ -25,7 +25,6 @@ func (k Keeper) GetSecondLevelDomain( ctx sdk.Context, name string, parent string, - ) (val types.SecondLevelDomain, found bool) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.SecondLevelDomainKeyPrefix)) @@ -46,7 +45,6 @@ func (k Keeper) RemoveSecondLevelDomain( ctx sdk.Context, name string, parent string, - ) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.SecondLevelDomainKeyPrefix)) store.Delete(types.SecondLevelDomainKey( diff --git a/x/registry/keeper/second_level_domain_test.go b/x/registry/keeper/second_level_domain_test.go index 648ff5cf..337b183c 100644 --- a/x/registry/keeper/second_level_domain_test.go +++ b/x/registry/keeper/second_level_domain_test.go @@ -89,6 +89,7 @@ func TestSecondLevelDomainGet(t *testing.T) { ) } } + func TestSecondLevelDomainRemove(t *testing.T) { keeper, ctx := keepertest.RegistryKeeper(t) items := createNSecondLevelDomain(keeper, ctx, 10) diff --git a/x/registry/keeper/setup_test.go b/x/registry/keeper/setup_test.go index c468a8d1..cf116850 100644 --- a/x/registry/keeper/setup_test.go +++ b/x/registry/keeper/setup_test.go @@ -49,7 +49,6 @@ func (suite *KeeperTestSuite) SetupTest() { // Init bank keeper suite.app.BankKeeper.InitGenesis(suite.ctx, getBankGenesis()) - } func makeBalance(address string, balance int64) banktypes.Balance { diff --git a/x/registry/keeper/top_level_domain.go b/x/registry/keeper/top_level_domain.go index 951a5b68..a8c90e74 100644 --- a/x/registry/keeper/top_level_domain.go +++ b/x/registry/keeper/top_level_domain.go @@ -25,7 +25,6 @@ func (k Keeper) SetTopLevelDomain(ctx sdk.Context, topLevelDomain types.TopLevel func (k Keeper) GetTopLevelDomain( ctx sdk.Context, name string, - ) (val types.TopLevelDomain, found bool) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TopLevelDomainKeyPrefix)) @@ -44,7 +43,6 @@ func (k Keeper) GetTopLevelDomain( func (k Keeper) RemoveTopLevelDomain( ctx sdk.Context, name string, - ) { store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.TopLevelDomainKeyPrefix)) store.Delete(types.TopLevelDomainKey( diff --git a/x/registry/keeper/top_level_domain_test.go b/x/registry/keeper/top_level_domain_test.go index 76bc138c..b6b6453c 100644 --- a/x/registry/keeper/top_level_domain_test.go +++ b/x/registry/keeper/top_level_domain_test.go @@ -62,6 +62,7 @@ func TestTopLevelDomainGet(t *testing.T) { ) } } + func TestTopLevelDomainRemove(t *testing.T) { keeper, ctx := keepertest.RegistryKeeper(t) items := createNTopLevelDomain(keeper, ctx, 10) @@ -130,7 +131,6 @@ func (suite *KeeperTestSuite) TestGetValidTopLevelDomain() { } }) } - } func (suite *KeeperTestSuite) TestGetTopLevelDomainRole() { diff --git a/x/registry/types/genesis_test.go b/x/registry/types/genesis_test.go index 4c597359..0a65d615 100644 --- a/x/registry/types/genesis_test.go +++ b/x/registry/types/genesis_test.go @@ -22,7 +22,6 @@ func TestGenesisState_Validate(t *testing.T) { { desc: "valid genesis state", genState: &types.GenesisState{ - TopLevelDomains: []types.TopLevelDomain{ { Name: "0", diff --git a/x/registry/types/secend_level_domain.go b/x/registry/types/secend_level_domain.go index 9b063560..19b7a118 100644 --- a/x/registry/types/secend_level_domain.go +++ b/x/registry/types/secend_level_domain.go @@ -61,7 +61,6 @@ func GetWalletAddressFormat(walletRecordType string) (walletAddressFormat string } func (secondLevelDomain *SecondLevelDomain) UpdateWalletRecord(walletRecordType string, address string) (err error) { - // Get wallet address format from wallet record type walletAddressFormat, err := GetWalletAddressFormat(walletRecordType) if err != nil { @@ -111,7 +110,6 @@ func GetDnsRecordValueFormat(dnsRecordType string) (dnsRecordTypeFormat string, } func (secondLevelDomain *SecondLevelDomain) UpdateDnsRecord(dnsRecordType string, value string) (err error) { - // Get wallet address format from dns record type dnsRecordFormat, err := GetDnsRecordValueFormat(dnsRecordType) if err != nil { diff --git a/x/registry/types/second_level_domain_test.go b/x/registry/types/second_level_domain_test.go index 02b8687b..23ebbcb1 100644 --- a/x/registry/types/second_level_domain_test.go +++ b/x/registry/types/second_level_domain_test.go @@ -36,19 +36,24 @@ func TestDomainValidate(t *testing.T) { expDomainParent: TopLevelDomain{Name: "myc"}, }, // Invalid name - {domain: SecondLevelDomain{Name: ".foo", Parent: "myc"}, + { + domain: SecondLevelDomain{Name: ".foo", Parent: "myc"}, expErr: errorsmod.Wrapf(ErrInvalidSecondLevelDomainName, ".foo"), }, - {domain: SecondLevelDomain{Name: "", Parent: "myc"}, + { + domain: SecondLevelDomain{Name: "", Parent: "myc"}, expErr: errorsmod.Wrapf(ErrInvalidSecondLevelDomainName, ""), }, - {domain: SecondLevelDomain{Name: "bar.foo", Parent: "myc"}, + { + domain: SecondLevelDomain{Name: "bar.foo", Parent: "myc"}, expErr: errorsmod.Wrapf(ErrInvalidSecondLevelDomainName, "bar.foo"), }, - {domain: SecondLevelDomain{Name: ".", Parent: "myc"}, + { + domain: SecondLevelDomain{Name: ".", Parent: "myc"}, expErr: errorsmod.Wrapf(ErrInvalidSecondLevelDomainName, "."), }, - {domain: SecondLevelDomain{Name: "##", Parent: "myc"}, + { + domain: SecondLevelDomain{Name: "##", Parent: "myc"}, expErr: errorsmod.Wrapf(ErrInvalidSecondLevelDomainName, "##"), }, // Invalid parent @@ -83,7 +88,6 @@ func TestDomainValidate(t *testing.T) { } } - } func TestDomainUpdateWalletRecord(t *testing.T) { diff --git a/x/registry/types/top_level_domain_test.go b/x/registry/types/top_level_domain_test.go index ae1a837f..43d56ae5 100644 --- a/x/registry/types/top_level_domain_test.go +++ b/x/registry/types/top_level_domain_test.go @@ -21,19 +21,24 @@ func TestTopLevelDomainValidate(t *testing.T) { domain: TopLevelDomain{Name: "myc"}, }, // Invalid name - {domain: TopLevelDomain{Name: ".foo"}, + { + domain: TopLevelDomain{Name: ".foo"}, expErr: errorsmod.Wrapf(ErrInvalidTopLevelDomainName, ".foo"), }, - {domain: TopLevelDomain{Name: ""}, + { + domain: TopLevelDomain{Name: ""}, expErr: errorsmod.Wrapf(ErrInvalidTopLevelDomainName, ""), }, - {domain: TopLevelDomain{Name: "bar.foo"}, + { + domain: TopLevelDomain{Name: "bar.foo"}, expErr: errorsmod.Wrapf(ErrInvalidTopLevelDomainName, "bar.foo"), }, - {domain: TopLevelDomain{Name: "."}, + { + domain: TopLevelDomain{Name: "."}, expErr: errorsmod.Wrapf(ErrInvalidTopLevelDomainName, "."), }, - {domain: TopLevelDomain{Name: "##"}, + { + domain: TopLevelDomain{Name: "##"}, expErr: errorsmod.Wrapf(ErrInvalidTopLevelDomainName, "##"), }, } diff --git a/x/registry/types/validate_second_level_domain.go b/x/registry/types/validate_second_level_domain.go index 33994e95..aec03cc6 100644 --- a/x/registry/types/validate_second_level_domain.go +++ b/x/registry/types/validate_second_level_domain.go @@ -30,7 +30,6 @@ func ValidateSecondLevelDomainParent(parent string) (err error) { err = errorsmod.Wrapf(ErrInvalidSecondLevelDomainParent, "%s", parent) } return err - } func (secondLevelDomain SecondLevelDomain) ValidateParent() (err error) { diff --git a/x/registry/types/validate_top_level_domain.go b/x/registry/types/validate_top_level_domain.go index f0c49be3..f9641f2b 100644 --- a/x/registry/types/validate_top_level_domain.go +++ b/x/registry/types/validate_top_level_domain.go @@ -17,7 +17,6 @@ func ValidateTopLevelDomainName(name string) (err error) { err = errorsmod.Wrapf(ErrInvalidTopLevelDomainName, "%s", name) } return err - } func (topLevelDomain TopLevelDomain) ValidateName() (err error) { diff --git a/x/registry/types/wallet_record.go b/x/registry/types/wallet_record.go index 9213632b..c5142050 100644 --- a/x/registry/types/wallet_record.go +++ b/x/registry/types/wallet_record.go @@ -83,7 +83,6 @@ func ValidateWalletAddressWithRegex(walletAddressFormat string, address string) err = errorsmod.Wrapf(ErrInvalidWalletAddress, "%s %s", walletAddressFormat, address) } return err - } func ValidateWalletAddress(walletAddressFormat string, address string) (err error) { diff --git a/x/resolver/client/cli/query_all_records.go b/x/resolver/client/cli/query_all_records.go index 0920a4de..64f0d5cd 100644 --- a/x/resolver/client/cli/query_all_records.go +++ b/x/resolver/client/cli/query_all_records.go @@ -29,7 +29,6 @@ func CmdAllRecord() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) params := &types.QueryAllRecordsRequest{ - DomainName: reqName, DomainParent: reqParent, } diff --git a/x/resolver/client/cli/query_dns_record.go b/x/resolver/client/cli/query_dns_record.go index 4e7340bb..24f77be9 100644 --- a/x/resolver/client/cli/query_dns_record.go +++ b/x/resolver/client/cli/query_dns_record.go @@ -30,7 +30,6 @@ func CmdDnsRecord() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) params := &types.QueryDnsRecordRequest{ - DomainName: reqDomainName, DomainParent: reqDomainParent, DnsRecordType: reqDnsRecordType, diff --git a/x/resolver/client/cli/query_text_record.go b/x/resolver/client/cli/query_text_record.go index 97c6a665..3cfba301 100644 --- a/x/resolver/client/cli/query_text_record.go +++ b/x/resolver/client/cli/query_text_record.go @@ -30,7 +30,6 @@ func CmdTextRecord() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) params := &types.QueryTextRecordRequest{ - DomainName: reqDomainName, DomainParent: reqDomainParent, Key: reqKey, diff --git a/x/resolver/client/cli/query_wallet_record.go b/x/resolver/client/cli/query_wallet_record.go index 03e535c0..7c7bfa39 100644 --- a/x/resolver/client/cli/query_wallet_record.go +++ b/x/resolver/client/cli/query_wallet_record.go @@ -30,7 +30,6 @@ func CmdQueryWalletRecord() *cobra.Command { queryClient := types.NewQueryClient(clientCtx) params := &types.QueryWalletRecordRequest{ - DomainName: reqDomainName, DomainParent: reqDomainParent, WalletRecordType: reqWalletRecordType, diff --git a/x/resolver/client/cli/tx.go b/x/resolver/client/cli/tx.go index 7252f95e..06140423 100644 --- a/x/resolver/client/cli/tx.go +++ b/x/resolver/client/cli/tx.go @@ -11,9 +11,7 @@ import ( "github.com/mycel-domain/mycel/x/resolver/types" ) -var ( - DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) -) +var DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) const ( flagPacketTimeoutTimestamp = "packet-timeout-timestamp" From 51090d5dbb09a84cc5ea6f60b51caf9ed0f83ee7 Mon Sep 17 00:00:00 2001 From: foxytanuki Date: Tue, 19 Dec 2023 13:46:34 +0900 Subject: [PATCH 02/17] Copy .golangci.yml from github.com/cosmos/gaia --- .golangci.yml | 121 ++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 98 insertions(+), 23 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 7bddf558..9627f2c5 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,29 +6,104 @@ run: linters: disable-all: true enable: - - errcheck - - misspell - - gosimple - - govet - - gci - + - dogsled + - errcheck + - exportloopref + - gci + - goconst + - gocritic + - gofumpt + - gosec + - gosimple + - govet + - ineffassign + - misspell + - nakedret + - nolintlint + - revive + - staticcheck + - stylecheck + - typecheck + - thelper + - unconvert + - unparam + - unused + +issues: + exclude-rules: + - text: 'Use of weak random number generator' + linters: + - gosec + - text: 'comment on exported var' + linters: + - golint + - text: "don't use an underscore in package name" + linters: + - golint + - text: 'ST1003:' + linters: + - stylecheck + # FIXME: Disabled until golangci-lint updates stylecheck with this fix: + # https://github.com/dominikh/go-tools/issues/389 + - text: 'ST1016:' + linters: + - stylecheck + - path: 'migrations' + text: 'SA1019:' + linters: + - staticcheck + + max-issues-per-linter: 10000 + max-same-issues: 10000 + linters-settings: gci: - # Section configuration to compare against. - # Section names are case-insensitive and may contain parameters in (). - # The default order of sections is `standard > default > custom > blank > dot`, - # If `custom-order` is `true`, it follows the order of `sections` option. - # Default: ["standard", "default"] - sections: - - standard # Standard section: captures all standard packages. - - default # Default section: contains all imports that could not be matched to another section type. - - prefix(github.com/mycel-domain/mycel) # Custom section: groups all imports with the specified Prefix. - - blank # Blank section: contains all blank imports. This section is not present unless explicitly enabled. - - dot # Dot section: contains all dot imports. This section is not present unless explicitly enabled. - # Skip generated files. - # Default: true - skip-generated: false - # Enable custom order of sections. - # If `true`, make the section order the same as the order of `sections`. - # Default: false custom-order: true + 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(github.com/cosmos) # cosmos org + - prefix(cosmossdk.io) # new modules + - prefix(github.com/cosmos/cosmos-sdk) # cosmos sdk + - prefix(github.com/cosmos/gaia) # Gaia + dogsled: + max-blank-identifiers: 3 + maligned: + # print struct with more effective memory layout or not, false by default + suggest-new: true + nolintlint: + allow-unused: false + # allow-leading-space: true + require-explanation: false + require-specific: false + revive: + ignore-generated-header: true + severity: warning + rules: + - name: unused-parameter + disabled: true + - name: blank-imports + - name: context-as-argument + - name: context-keys-type + - name: dot-imports + - name: error-return + - name: error-strings + - name: error-naming + - name: exported + - name: if-return + - name: increment-decrement + - name: var-naming + - name: var-declaration + - name: range + - name: receiver-naming + - name: time-naming + - name: unexported-return + - name: indent-error-flow + - name: errorf + - name: empty-block + - name: superfluous-else + - name: unreachable-code + - name: redefines-builtin-id From 47f4327b7cb751cc6927ae8f8ef71ef8b7c94fc1 Mon Sep 17 00:00:00 2001 From: foxytanuki Date: Tue, 19 Dec 2023 13:47:45 +0900 Subject: [PATCH 03/17] Add mycel to custom-order sections --- .golangci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.golangci.yml b/.golangci.yml index 9627f2c5..c2274921 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -69,6 +69,7 @@ linters-settings: - prefix(cosmossdk.io) # new modules - prefix(github.com/cosmos/cosmos-sdk) # cosmos sdk - prefix(github.com/cosmos/gaia) # Gaia + - prefix(github.com/mycel-domain/mycel) # Mycel dogsled: max-blank-identifiers: 3 maligned: From f93099539a305d6c67f8e14a0c3a61be08448e36 Mon Sep 17 00:00:00 2001 From: foxytanuki Date: Tue, 19 Dec 2023 13:54:07 +0900 Subject: [PATCH 04/17] Run `make lint-fix` --- app/ante.go | 9 ++-- app/app.go | 48 ++++++++++--------- app/export.go | 1 + app/params/config.go | 1 + app/simulation_test.go | 4 +- app/test_helpers.go | 7 ++- cmd/myceld/cmd/genaccounts.go | 3 +- cmd/myceld/cmd/root.go | 10 ++-- testutil/keeper/epochs.go | 4 +- testutil/keeper/furnace.go | 4 +- testutil/keeper/registry.go | 4 +- testutil/keeper/resolver.go | 4 +- testutil/network/network.go | 4 +- x/epochs/client/cli/query.go | 3 +- x/epochs/client/cli/query_epoch_info.go | 3 +- x/epochs/client/cli/query_epoch_info_test.go | 8 ++-- x/epochs/client/cli/query_params.go | 3 +- x/epochs/client/cli/tx.go | 3 +- x/epochs/keeper/epoch_info_test.go | 3 +- x/epochs/keeper/keeper.go | 1 + x/epochs/keeper/query_epoch_info.go | 5 +- x/epochs/keeper/query_epoch_info_test.go | 5 +- x/epochs/keeper/query_params.go | 3 +- x/epochs/keeper/query_params_test.go | 3 +- x/epochs/keeper/setup_test.go | 4 +- x/epochs/module.go | 6 ++- x/epochs/types/params.go | 3 +- x/furnace/client/cli/query.go | 3 +- x/furnace/client/cli/query_burn_amount.go | 5 +- .../client/cli/query_burn_amount_test.go | 8 ++-- .../client/cli/query_epoch_burn_config.go | 3 +- .../cli/query_epoch_burn_config_test.go | 6 ++- x/furnace/client/cli/query_params.go | 3 +- x/furnace/client/cli/tx.go | 3 +- x/furnace/keeper/burn_amount.go | 1 + x/furnace/keeper/burn_amount_test.go | 3 +- x/furnace/keeper/epoch_burn_config_test.go | 3 +- x/furnace/keeper/keeper.go | 1 + x/furnace/keeper/msg_server_test.go | 3 +- x/furnace/keeper/query_burn_amount.go | 5 +- x/furnace/keeper/query_burn_amount_test.go | 5 +- x/furnace/keeper/query_epoch_burn_config.go | 3 +- .../keeper/query_epoch_burn_config_test.go | 3 +- x/furnace/keeper/query_params.go | 3 +- x/furnace/keeper/query_params_test.go | 3 +- x/furnace/keeper/setup_test.go | 4 +- x/furnace/module.go | 6 ++- x/furnace/types/params.go | 3 +- x/registry/client/cli/query.go | 3 +- .../client/cli/query_domain_ownership.go | 3 +- .../client/cli/query_domain_ownership_test.go | 8 ++-- .../cli/query_domain_registration_fee.go | 5 +- x/registry/client/cli/query_params.go | 3 +- x/registry/client/cli/query_role.go | 3 +- .../client/cli/query_second_level_domain.go | 3 +- .../cli/query_second_level_domain_test.go | 8 ++-- .../client/cli/query_top_level_domain.go | 3 +- .../client/cli/query_top_level_domain_test.go | 8 ++-- x/registry/client/cli/tx.go | 3 +- ...extend_top_level_domain_expiration_date.go | 5 +- .../cli/tx_register_second_level_domain.go | 5 +- .../cli/tx_register_top_level_domain.go | 5 +- x/registry/client/cli/tx_update_dns_record.go | 3 +- .../client/cli/tx_update_text_record.go | 3 +- .../client/cli/tx_update_wallet_record.go | 3 +- .../cli/tx_withdraw_registration_fee.go | 3 +- x/registry/keeper/domain_ownership_test.go | 3 +- x/registry/keeper/keeper.go | 1 + ...d_top_level_domain_expiration_date_test.go | 1 + ...erver_register_second_level_domain_test.go | 1 + .../msg_server_register_top_level_domain.go | 1 + ...g_server_register_top_level_domain_test.go | 1 + .../keeper/msg_server_update_dns_record.go | 1 + .../keeper/msg_server_update_text_record.go | 1 + .../keeper/msg_server_update_wallet_record.go | 1 + .../msg_server_withdraw_registration_fee.go | 1 + ...g_server_withdraw_registration_fee_test.go | 1 + x/registry/keeper/query_domain_ownership.go | 5 +- .../keeper/query_domain_ownership_test.go | 5 +- .../keeper/query_domain_registration_fee.go | 3 +- x/registry/keeper/query_params.go | 3 +- x/registry/keeper/query_params_test.go | 3 +- x/registry/keeper/query_role.go | 1 + x/registry/keeper/query_role_test.go | 1 + .../keeper/query_second_level_domain.go | 5 +- .../keeper/query_second_level_domain_test.go | 5 +- x/registry/keeper/query_top_level_domain.go | 5 +- .../keeper/query_top_level_domain_test.go | 5 +- x/registry/keeper/second_level_domain.go | 1 + x/registry/keeper/second_level_domain_test.go | 4 +- x/registry/keeper/setup_test.go | 4 +- x/registry/keeper/top_level_domain.go | 1 + x/registry/keeper/top_level_domain_fee.go | 1 + x/registry/keeper/top_level_domain_test.go | 4 +- x/registry/module.go | 6 ++- x/registry/types/expected_keepers.go | 1 + ...d_top_level_domain_expiration_date_test.go | 3 +- .../message_register_second_level_domain.go | 1 + ...ssage_register_second_level_domain_test.go | 3 +- .../message_register_top_level_domain.go | 1 + .../message_register_top_level_domain_test.go | 3 +- x/registry/types/message_update_dns_record.go | 1 + .../types/message_update_dns_record_test.go | 3 +- .../types/message_update_text_record_test.go | 3 +- .../types/message_update_wallet_record.go | 1 + .../message_update_wallet_record_test.go | 3 +- .../message_withdraw_registration_fee.go | 1 + .../message_withdraw_registration_fee_test.go | 3 +- x/registry/types/params.go | 3 +- x/registry/types/second_level_domain_test.go | 4 +- x/registry/types/subdomain_config.go | 1 + x/registry/types/top_level_domain.go | 1 + x/registry/types/top_level_domain_test.go | 3 +- x/registry/types/wallet_record.go | 3 +- x/resolver/client/cli/query.go | 3 +- x/resolver/client/cli/query_all_records.go | 3 +- x/resolver/client/cli/query_dns_record.go | 3 +- x/resolver/client/cli/query_params.go | 3 +- x/resolver/client/cli/query_text_record.go | 3 +- x/resolver/client/cli/query_wallet_record.go | 3 +- x/resolver/client/cli/tx.go | 3 +- x/resolver/keeper/keeper.go | 1 + x/resolver/keeper/msg_server_test.go | 3 +- x/resolver/keeper/query_all_records.go | 3 +- x/resolver/keeper/query_dns_record.go | 3 +- x/resolver/keeper/query_params.go | 3 +- x/resolver/keeper/query_params_test.go | 3 +- x/resolver/keeper/query_text_record.go | 3 +- x/resolver/keeper/query_wallet_record.go | 3 +- x/resolver/keeper/setup_test.go | 4 +- x/resolver/module.go | 6 ++- x/resolver/types/params.go | 3 +- 132 files changed, 323 insertions(+), 160 deletions(-) diff --git a/app/ante.go b/app/ante.go index b134d7e0..b34f70fc 100644 --- a/app/ante.go +++ b/app/ante.go @@ -1,15 +1,18 @@ package app import ( - errorsmod "cosmossdk.io/errors" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmTypes "github.com/CosmWasm/wasmd/x/wasm/types" + + ibcante "github.com/cosmos/ibc-go/v7/modules/core/ante" + "github.com/cosmos/ibc-go/v7/modules/core/keeper" + + 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" ) // HandlerOptions extend the SDK's AnteHandler options by requiring the IBC diff --git a/app/app.go b/app/app.go index 9e5831ef..f23f8b73 100644 --- a/app/app.go +++ b/app/app.go @@ -8,16 +8,40 @@ import ( "path/filepath" "strings" - autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" // CosmWasm "github.com/CosmWasm/wasmd/x/wasm" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types" + "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" + + ica "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts" + icacontrollerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper" + icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" + icahost "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host" + icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper" + icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" + icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" + "github.com/cosmos/ibc-go/v7/modules/apps/transfer" + ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" + ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v7/modules/core" + ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client" + ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client" + ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" + ibcporttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" + ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" + 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" + + 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" @@ -94,26 +118,6 @@ 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" - icacontrollerkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/keeper" - icacontrollertypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/controller/types" - icahost "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host" - icahostkeeper "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/keeper" - icahosttypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/host/types" - icatypes "github.com/cosmos/ibc-go/v7/modules/apps/27-interchain-accounts/types" - "github.com/cosmos/ibc-go/v7/modules/apps/transfer" - ibctransferkeeper "github.com/cosmos/ibc-go/v7/modules/apps/transfer/keeper" - ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types" - ibc "github.com/cosmos/ibc-go/v7/modules/core" - ibcclient "github.com/cosmos/ibc-go/v7/modules/core/02-client" - ibcclientclient "github.com/cosmos/ibc-go/v7/modules/core/02-client/client" - ibcclienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types" - ibcporttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types" - ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported" - 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" - "github.com/spf13/cast" appparams "github.com/mycel-domain/mycel/app/params" "github.com/mycel-domain/mycel/docs" diff --git a/app/export.go b/app/export.go index db240d2b..3c220663 100644 --- a/app/export.go +++ b/app/export.go @@ -6,6 +6,7 @@ import ( "log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" diff --git a/app/params/config.go b/app/params/config.go index e11accda..61ceac67 100644 --- a/app/params/config.go +++ b/app/params/config.go @@ -2,6 +2,7 @@ package params import ( errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/address" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" diff --git a/app/simulation_test.go b/app/simulation_test.go index b159f8ea..6e03b787 100644 --- a/app/simulation_test.go +++ b/app/simulation_test.go @@ -11,10 +11,13 @@ import ( "time" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + "github.com/stretchr/testify/require" + dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/server" @@ -35,7 +38,6 @@ import ( simcli "github.com/cosmos/cosmos-sdk/x/simulation/client/cli" slashingtypes "github.com/cosmos/cosmos-sdk/x/slashing/types" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" - "github.com/stretchr/testify/require" "github.com/mycel-domain/mycel/app" ) diff --git a/app/test_helpers.go b/app/test_helpers.go index 89c88e1e..ec6a80ef 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -4,13 +4,17 @@ import ( "encoding/json" "testing" - "cosmossdk.io/math" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + "github.com/stretchr/testify/require" + dbm "github.com/cometbft/cometbft-db" abci "github.com/cometbft/cometbft/abci/types" "github.com/cometbft/cometbft/libs/log" tmproto "github.com/cometbft/cometbft/proto/tendermint/types" tmtypes "github.com/cometbft/cometbft/types" + + "cosmossdk.io/math" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/cosmos/cosmos-sdk/server" @@ -21,7 +25,6 @@ import ( authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" - "github.com/stretchr/testify/require" ) // SetupOptions defines arguments that are passed into `Simapp` constructor. diff --git a/cmd/myceld/cmd/genaccounts.go b/cmd/myceld/cmd/genaccounts.go index d5ec6533..2298e213 100644 --- a/cmd/myceld/cmd/genaccounts.go +++ b/cmd/myceld/cmd/genaccounts.go @@ -6,6 +6,8 @@ import ( "errors" "fmt" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/crypto/keyring" @@ -16,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" - "github.com/spf13/cobra" ) const ( diff --git a/cmd/myceld/cmd/root.go b/cmd/myceld/cmd/root.go index 18f749c2..51be9550 100644 --- a/cmd/myceld/cmd/root.go +++ b/cmd/myceld/cmd/root.go @@ -11,11 +11,17 @@ import ( // CosmWasm wasmcli "github.com/CosmWasm/wasmd/x/wasm/client/cli" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + "github.com/prometheus/client_golang/prometheus" + "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" tmlog "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" @@ -37,10 +43,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/prometheus/client_golang/prometheus" - "github.com/spf13/cast" - "github.com/spf13/cobra" - "github.com/spf13/pflag" "github.com/mycel-domain/mycel/app" appparams "github.com/mycel-domain/mycel/app/params" diff --git a/testutil/keeper/epochs.go b/testutil/keeper/epochs.go index 90eb8894..41ae986d 100644 --- a/testutil/keeper/epochs.go +++ b/testutil/keeper/epochs.go @@ -3,16 +3,18 @@ package keeper import ( "testing" + "github.com/stretchr/testify/require" + 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/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/store" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/stretchr/testify/require" "github.com/mycel-domain/mycel/x/epochs/keeper" "github.com/mycel-domain/mycel/x/epochs/types" diff --git a/testutil/keeper/furnace.go b/testutil/keeper/furnace.go index fbfd1195..f0450b3f 100644 --- a/testutil/keeper/furnace.go +++ b/testutil/keeper/furnace.go @@ -3,16 +3,18 @@ package keeper import ( "testing" + "github.com/stretchr/testify/require" + 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/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/store" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/stretchr/testify/require" "github.com/mycel-domain/mycel/x/furnace/keeper" "github.com/mycel-domain/mycel/x/furnace/types" diff --git a/testutil/keeper/registry.go b/testutil/keeper/registry.go index 45014df1..9b6c20c3 100644 --- a/testutil/keeper/registry.go +++ b/testutil/keeper/registry.go @@ -3,16 +3,18 @@ package keeper import ( "testing" + "github.com/stretchr/testify/require" + 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/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/store" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/stretchr/testify/require" "github.com/mycel-domain/mycel/x/registry/keeper" "github.com/mycel-domain/mycel/x/registry/types" diff --git a/testutil/keeper/resolver.go b/testutil/keeper/resolver.go index 2684c477..4df79898 100644 --- a/testutil/keeper/resolver.go +++ b/testutil/keeper/resolver.go @@ -3,16 +3,18 @@ package keeper import ( "testing" + "github.com/stretchr/testify/require" + 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/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/store" storetypes "github.com/cosmos/cosmos-sdk/store/types" sdk "github.com/cosmos/cosmos-sdk/types" typesparams "github.com/cosmos/cosmos-sdk/x/params/types" - "github.com/stretchr/testify/require" "github.com/mycel-domain/mycel/x/resolver/keeper" "github.com/mycel-domain/mycel/x/resolver/types" diff --git a/testutil/network/network.go b/testutil/network/network.go index cd3cafa0..bbcf9e68 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -6,8 +6,11 @@ import ( "time" wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper" + "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" @@ -17,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" "github.com/mycel-domain/mycel/app" ) diff --git a/x/epochs/client/cli/query.go b/x/epochs/client/cli/query.go index a22c8504..ec3f5d77 100644 --- a/x/epochs/client/cli/query.go +++ b/x/epochs/client/cli/query.go @@ -3,9 +3,10 @@ package cli import ( "fmt" - "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" + "github.com/mycel-domain/mycel/x/epochs/types" ) diff --git a/x/epochs/client/cli/query_epoch_info.go b/x/epochs/client/cli/query_epoch_info.go index 5cd5741b..b9564b14 100644 --- a/x/epochs/client/cli/query_epoch_info.go +++ b/x/epochs/client/cli/query_epoch_info.go @@ -3,9 +3,10 @@ package cli import ( "context" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" "github.com/mycel-domain/mycel/x/epochs/types" ) diff --git a/x/epochs/client/cli/query_epoch_info_test.go b/x/epochs/client/cli/query_epoch_info_test.go index da22d13a..53f01645 100644 --- a/x/epochs/client/cli/query_epoch_info_test.go +++ b/x/epochs/client/cli/query_epoch_info_test.go @@ -5,13 +5,15 @@ import ( "strconv" "testing" - tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + tmcli "github.com/cometbft/cometbft/libs/cli" + + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/mycel-domain/mycel/testutil/network" "github.com/mycel-domain/mycel/testutil/nullify" "github.com/mycel-domain/mycel/x/epochs/client/cli" diff --git a/x/epochs/client/cli/query_params.go b/x/epochs/client/cli/query_params.go index fab7b415..b4d1fecb 100644 --- a/x/epochs/client/cli/query_params.go +++ b/x/epochs/client/cli/query_params.go @@ -3,9 +3,10 @@ package cli import ( "context" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" "github.com/mycel-domain/mycel/x/epochs/types" ) diff --git a/x/epochs/client/cli/tx.go b/x/epochs/client/cli/tx.go index a375795c..ef801452 100644 --- a/x/epochs/client/cli/tx.go +++ b/x/epochs/client/cli/tx.go @@ -4,9 +4,10 @@ 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/mycel-domain/mycel/x/epochs/types" ) diff --git a/x/epochs/keeper/epoch_info_test.go b/x/epochs/keeper/epoch_info_test.go index 6365976b..980d99df 100644 --- a/x/epochs/keeper/epoch_info_test.go +++ b/x/epochs/keeper/epoch_info_test.go @@ -4,9 +4,10 @@ import ( "strconv" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + keepertest "github.com/mycel-domain/mycel/testutil/keeper" "github.com/mycel-domain/mycel/testutil/nullify" "github.com/mycel-domain/mycel/x/epochs/keeper" diff --git a/x/epochs/keeper/keeper.go b/x/epochs/keeper/keeper.go index 219b3650..daaf7d75 100644 --- a/x/epochs/keeper/keeper.go +++ b/x/epochs/keeper/keeper.go @@ -4,6 +4,7 @@ import ( "fmt" "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" diff --git a/x/epochs/keeper/query_epoch_info.go b/x/epochs/keeper/query_epoch_info.go index 065908bf..b62d48f4 100644 --- a/x/epochs/keeper/query_epoch_info.go +++ b/x/epochs/keeper/query_epoch_info.go @@ -3,11 +3,12 @@ package keeper import ( "context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" "github.com/mycel-domain/mycel/x/epochs/types" ) diff --git a/x/epochs/keeper/query_epoch_info_test.go b/x/epochs/keeper/query_epoch_info_test.go index 41385a54..4ef91cbf 100644 --- a/x/epochs/keeper/query_epoch_info_test.go +++ b/x/epochs/keeper/query_epoch_info_test.go @@ -4,12 +4,13 @@ import ( "strconv" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + keepertest "github.com/mycel-domain/mycel/testutil/keeper" "github.com/mycel-domain/mycel/testutil/nullify" "github.com/mycel-domain/mycel/x/epochs/types" diff --git a/x/epochs/keeper/query_params.go b/x/epochs/keeper/query_params.go index 0476a9d3..f7c439c1 100644 --- a/x/epochs/keeper/query_params.go +++ b/x/epochs/keeper/query_params.go @@ -3,10 +3,11 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/mycel-domain/mycel/x/epochs/types" ) diff --git a/x/epochs/keeper/query_params_test.go b/x/epochs/keeper/query_params_test.go index d11e9860..9e0f9d67 100644 --- a/x/epochs/keeper/query_params_test.go +++ b/x/epochs/keeper/query_params_test.go @@ -3,9 +3,10 @@ package keeper_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + testkeeper "github.com/mycel-domain/mycel/testutil/keeper" "github.com/mycel-domain/mycel/x/epochs/types" ) diff --git a/x/epochs/keeper/setup_test.go b/x/epochs/keeper/setup_test.go index 2a4c1f9a..6e8e2a48 100644 --- a/x/epochs/keeper/setup_test.go +++ b/x/epochs/keeper/setup_test.go @@ -4,10 +4,12 @@ import ( "testing" "time" + "github.com/stretchr/testify/suite" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/suite" mycelapp "github.com/mycel-domain/mycel/app" "github.com/mycel-domain/mycel/x/epochs/types" diff --git a/x/epochs/module.go b/x/epochs/module.go index e7eee1f3..d3f2e02d 100644 --- a/x/epochs/module.go +++ b/x/epochs/module.go @@ -6,14 +6,16 @@ import ( "fmt" "log" + "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/mycel-domain/mycel/x/epochs/client/cli" "github.com/mycel-domain/mycel/x/epochs/keeper" diff --git a/x/epochs/types/params.go b/x/epochs/types/params.go index 357196ad..cc90a6d8 100644 --- a/x/epochs/types/params.go +++ b/x/epochs/types/params.go @@ -1,8 +1,9 @@ package types import ( - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "gopkg.in/yaml.v2" + + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) var _ paramtypes.ParamSet = (*Params)(nil) diff --git a/x/furnace/client/cli/query.go b/x/furnace/client/cli/query.go index 403ba8d8..280e5faa 100644 --- a/x/furnace/client/cli/query.go +++ b/x/furnace/client/cli/query.go @@ -3,9 +3,10 @@ package cli import ( "fmt" - "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" + "github.com/mycel-domain/mycel/x/furnace/types" ) diff --git a/x/furnace/client/cli/query_burn_amount.go b/x/furnace/client/cli/query_burn_amount.go index 8194a649..b0755568 100644 --- a/x/furnace/client/cli/query_burn_amount.go +++ b/x/furnace/client/cli/query_burn_amount.go @@ -1,11 +1,12 @@ package cli import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cast" "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/mycel-domain/mycel/x/furnace/types" ) diff --git a/x/furnace/client/cli/query_burn_amount_test.go b/x/furnace/client/cli/query_burn_amount_test.go index 62a20632..fc4a7071 100644 --- a/x/furnace/client/cli/query_burn_amount_test.go +++ b/x/furnace/client/cli/query_burn_amount_test.go @@ -5,13 +5,15 @@ import ( "strconv" "testing" - tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + tmcli "github.com/cometbft/cometbft/libs/cli" + + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/mycel-domain/mycel/testutil/network" "github.com/mycel-domain/mycel/testutil/nullify" "github.com/mycel-domain/mycel/x/furnace/client/cli" diff --git a/x/furnace/client/cli/query_epoch_burn_config.go b/x/furnace/client/cli/query_epoch_burn_config.go index 061e0fa8..4d3eb764 100644 --- a/x/furnace/client/cli/query_epoch_burn_config.go +++ b/x/furnace/client/cli/query_epoch_burn_config.go @@ -1,9 +1,10 @@ package cli import ( + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" "github.com/mycel-domain/mycel/x/furnace/types" ) diff --git a/x/furnace/client/cli/query_epoch_burn_config_test.go b/x/furnace/client/cli/query_epoch_burn_config_test.go index 56c92940..7ebfda45 100644 --- a/x/furnace/client/cli/query_epoch_burn_config_test.go +++ b/x/furnace/client/cli/query_epoch_burn_config_test.go @@ -4,11 +4,13 @@ import ( "fmt" "testing" - tmcli "github.com/cometbft/cometbft/libs/cli" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/stretchr/testify/require" "google.golang.org/grpc/status" + tmcli "github.com/cometbft/cometbft/libs/cli" + + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/mycel-domain/mycel/testutil/network" "github.com/mycel-domain/mycel/testutil/nullify" "github.com/mycel-domain/mycel/x/furnace/client/cli" diff --git a/x/furnace/client/cli/query_params.go b/x/furnace/client/cli/query_params.go index da6f62e8..f862d25e 100644 --- a/x/furnace/client/cli/query_params.go +++ b/x/furnace/client/cli/query_params.go @@ -1,9 +1,10 @@ package cli import ( + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" "github.com/mycel-domain/mycel/x/furnace/types" ) diff --git a/x/furnace/client/cli/tx.go b/x/furnace/client/cli/tx.go index 9bb1237d..8c2a0d84 100644 --- a/x/furnace/client/cli/tx.go +++ b/x/furnace/client/cli/tx.go @@ -4,9 +4,10 @@ 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/mycel-domain/mycel/x/furnace/types" ) diff --git a/x/furnace/keeper/burn_amount.go b/x/furnace/keeper/burn_amount.go index 03663fe7..b38019c5 100644 --- a/x/furnace/keeper/burn_amount.go +++ b/x/furnace/keeper/burn_amount.go @@ -2,6 +2,7 @@ package keeper import ( errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/furnace/keeper/burn_amount_test.go b/x/furnace/keeper/burn_amount_test.go index cad058ba..1d599f61 100644 --- a/x/furnace/keeper/burn_amount_test.go +++ b/x/furnace/keeper/burn_amount_test.go @@ -5,9 +5,10 @@ import ( "strconv" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/mycel-domain/mycel/app/params" keepertest "github.com/mycel-domain/mycel/testutil/keeper" "github.com/mycel-domain/mycel/testutil/nullify" diff --git a/x/furnace/keeper/epoch_burn_config_test.go b/x/furnace/keeper/epoch_burn_config_test.go index 562f1a30..2a2db14d 100644 --- a/x/furnace/keeper/epoch_burn_config_test.go +++ b/x/furnace/keeper/epoch_burn_config_test.go @@ -3,9 +3,10 @@ package keeper_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + keepertest "github.com/mycel-domain/mycel/testutil/keeper" "github.com/mycel-domain/mycel/testutil/nullify" "github.com/mycel-domain/mycel/x/furnace/keeper" diff --git a/x/furnace/keeper/keeper.go b/x/furnace/keeper/keeper.go index 3ee1f4a0..2a362524 100644 --- a/x/furnace/keeper/keeper.go +++ b/x/furnace/keeper/keeper.go @@ -4,6 +4,7 @@ import ( "fmt" "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" diff --git a/x/furnace/keeper/msg_server_test.go b/x/furnace/keeper/msg_server_test.go index eb5ab65a..222a4b76 100644 --- a/x/furnace/keeper/msg_server_test.go +++ b/x/furnace/keeper/msg_server_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + keepertest "github.com/mycel-domain/mycel/testutil/keeper" "github.com/mycel-domain/mycel/x/furnace/keeper" "github.com/mycel-domain/mycel/x/furnace/types" diff --git a/x/furnace/keeper/query_burn_amount.go b/x/furnace/keeper/query_burn_amount.go index 0fa282c2..3a4252dd 100644 --- a/x/furnace/keeper/query_burn_amount.go +++ b/x/furnace/keeper/query_burn_amount.go @@ -3,11 +3,12 @@ package keeper import ( "context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" "github.com/mycel-domain/mycel/x/furnace/types" ) diff --git a/x/furnace/keeper/query_burn_amount_test.go b/x/furnace/keeper/query_burn_amount_test.go index 2a422b4b..c4036695 100644 --- a/x/furnace/keeper/query_burn_amount_test.go +++ b/x/furnace/keeper/query_burn_amount_test.go @@ -4,12 +4,13 @@ import ( "strconv" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + keepertest "github.com/mycel-domain/mycel/testutil/keeper" "github.com/mycel-domain/mycel/testutil/nullify" "github.com/mycel-domain/mycel/x/furnace/types" diff --git a/x/furnace/keeper/query_epoch_burn_config.go b/x/furnace/keeper/query_epoch_burn_config.go index e130f2de..dfdb35f8 100644 --- a/x/furnace/keeper/query_epoch_burn_config.go +++ b/x/furnace/keeper/query_epoch_burn_config.go @@ -3,10 +3,11 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/mycel-domain/mycel/x/furnace/types" ) diff --git a/x/furnace/keeper/query_epoch_burn_config_test.go b/x/furnace/keeper/query_epoch_burn_config_test.go index 6a00bb5e..72f62698 100644 --- a/x/furnace/keeper/query_epoch_burn_config_test.go +++ b/x/furnace/keeper/query_epoch_burn_config_test.go @@ -3,11 +3,12 @@ package keeper_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdk "github.com/cosmos/cosmos-sdk/types" + keepertest "github.com/mycel-domain/mycel/testutil/keeper" "github.com/mycel-domain/mycel/testutil/nullify" "github.com/mycel-domain/mycel/x/furnace/types" diff --git a/x/furnace/keeper/query_params.go b/x/furnace/keeper/query_params.go index 9041b7a2..e3535724 100644 --- a/x/furnace/keeper/query_params.go +++ b/x/furnace/keeper/query_params.go @@ -3,10 +3,11 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/mycel-domain/mycel/x/furnace/types" ) diff --git a/x/furnace/keeper/query_params_test.go b/x/furnace/keeper/query_params_test.go index 0d9552b0..69cd8257 100644 --- a/x/furnace/keeper/query_params_test.go +++ b/x/furnace/keeper/query_params_test.go @@ -3,9 +3,10 @@ package keeper_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + testkeeper "github.com/mycel-domain/mycel/testutil/keeper" "github.com/mycel-domain/mycel/x/furnace/types" ) diff --git a/x/furnace/keeper/setup_test.go b/x/furnace/keeper/setup_test.go index 2a4c1f9a..6e8e2a48 100644 --- a/x/furnace/keeper/setup_test.go +++ b/x/furnace/keeper/setup_test.go @@ -4,10 +4,12 @@ import ( "testing" "time" + "github.com/stretchr/testify/suite" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/suite" mycelapp "github.com/mycel-domain/mycel/app" "github.com/mycel-domain/mycel/x/epochs/types" diff --git a/x/furnace/module.go b/x/furnace/module.go index c31ab825..f6ef028c 100644 --- a/x/furnace/module.go +++ b/x/furnace/module.go @@ -6,14 +6,16 @@ import ( "fmt" "log" + "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/mycel-domain/mycel/x/furnace/client/cli" "github.com/mycel-domain/mycel/x/furnace/keeper" diff --git a/x/furnace/types/params.go b/x/furnace/types/params.go index 357196ad..cc90a6d8 100644 --- a/x/furnace/types/params.go +++ b/x/furnace/types/params.go @@ -1,8 +1,9 @@ package types import ( - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "gopkg.in/yaml.v2" + + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) var _ paramtypes.ParamSet = (*Params)(nil) diff --git a/x/registry/client/cli/query.go b/x/registry/client/cli/query.go index 4328f727..30110aa7 100644 --- a/x/registry/client/cli/query.go +++ b/x/registry/client/cli/query.go @@ -3,9 +3,10 @@ package cli import ( "fmt" - "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" + "github.com/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/client/cli/query_domain_ownership.go b/x/registry/client/cli/query_domain_ownership.go index d8fd674c..7a698330 100644 --- a/x/registry/client/cli/query_domain_ownership.go +++ b/x/registry/client/cli/query_domain_ownership.go @@ -3,9 +3,10 @@ package cli import ( "context" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" "github.com/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/client/cli/query_domain_ownership_test.go b/x/registry/client/cli/query_domain_ownership_test.go index adcde451..746c7066 100644 --- a/x/registry/client/cli/query_domain_ownership_test.go +++ b/x/registry/client/cli/query_domain_ownership_test.go @@ -5,13 +5,15 @@ import ( "strconv" "testing" - tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + tmcli "github.com/cometbft/cometbft/libs/cli" + + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/mycel-domain/mycel/testutil/network" "github.com/mycel-domain/mycel/testutil/nullify" "github.com/mycel-domain/mycel/x/registry/client/cli" diff --git a/x/registry/client/cli/query_domain_registration_fee.go b/x/registry/client/cli/query_domain_registration_fee.go index a1d9af04..24a0e085 100644 --- a/x/registry/client/cli/query_domain_registration_fee.go +++ b/x/registry/client/cli/query_domain_registration_fee.go @@ -3,11 +3,12 @@ package cli import ( "strconv" - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" "github.com/spf13/cast" "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/client/cli/query_params.go b/x/registry/client/cli/query_params.go index 0afa9bb1..6bdc8b6c 100644 --- a/x/registry/client/cli/query_params.go +++ b/x/registry/client/cli/query_params.go @@ -3,9 +3,10 @@ package cli import ( "context" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" "github.com/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/client/cli/query_role.go b/x/registry/client/cli/query_role.go index 8e8f5d18..72e767b8 100644 --- a/x/registry/client/cli/query_role.go +++ b/x/registry/client/cli/query_role.go @@ -3,9 +3,10 @@ package cli import ( "strconv" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" "github.com/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/client/cli/query_second_level_domain.go b/x/registry/client/cli/query_second_level_domain.go index 924bd89b..16648d51 100644 --- a/x/registry/client/cli/query_second_level_domain.go +++ b/x/registry/client/cli/query_second_level_domain.go @@ -3,9 +3,10 @@ package cli import ( "context" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" "github.com/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/client/cli/query_second_level_domain_test.go b/x/registry/client/cli/query_second_level_domain_test.go index 64f9ca22..da652aac 100644 --- a/x/registry/client/cli/query_second_level_domain_test.go +++ b/x/registry/client/cli/query_second_level_domain_test.go @@ -5,13 +5,15 @@ import ( "strconv" "testing" - tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + tmcli "github.com/cometbft/cometbft/libs/cli" + + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/mycel-domain/mycel/testutil/network" "github.com/mycel-domain/mycel/testutil/nullify" "github.com/mycel-domain/mycel/x/registry/client/cli" diff --git a/x/registry/client/cli/query_top_level_domain.go b/x/registry/client/cli/query_top_level_domain.go index 3e48e6dc..699fc61a 100644 --- a/x/registry/client/cli/query_top_level_domain.go +++ b/x/registry/client/cli/query_top_level_domain.go @@ -1,9 +1,10 @@ package cli import ( + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" "github.com/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/client/cli/query_top_level_domain_test.go b/x/registry/client/cli/query_top_level_domain_test.go index bb655e41..2ca72ded 100644 --- a/x/registry/client/cli/query_top_level_domain_test.go +++ b/x/registry/client/cli/query_top_level_domain_test.go @@ -5,13 +5,15 @@ import ( "strconv" "testing" - tmcli "github.com/cometbft/cometbft/libs/cli" - "github.com/cosmos/cosmos-sdk/client/flags" - clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + tmcli "github.com/cometbft/cometbft/libs/cli" + + "github.com/cosmos/cosmos-sdk/client/flags" + clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" + "github.com/mycel-domain/mycel/testutil/network" "github.com/mycel-domain/mycel/testutil/nullify" "github.com/mycel-domain/mycel/x/registry/client/cli" diff --git a/x/registry/client/cli/tx.go b/x/registry/client/cli/tx.go index 7a5eec55..c51bdfac 100644 --- a/x/registry/client/cli/tx.go +++ b/x/registry/client/cli/tx.go @@ -4,9 +4,10 @@ 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/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/client/cli/tx_extend_top_level_domain_expiration_date.go b/x/registry/client/cli/tx_extend_top_level_domain_expiration_date.go index c67e2650..18dbe681 100644 --- a/x/registry/client/cli/tx_extend_top_level_domain_expiration_date.go +++ b/x/registry/client/cli/tx_extend_top_level_domain_expiration_date.go @@ -3,11 +3,12 @@ package cli import ( "strconv" + "github.com/spf13/cast" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/spf13/cast" - "github.com/spf13/cobra" "github.com/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/client/cli/tx_register_second_level_domain.go b/x/registry/client/cli/tx_register_second_level_domain.go index d791c2d5..52cbfc97 100644 --- a/x/registry/client/cli/tx_register_second_level_domain.go +++ b/x/registry/client/cli/tx_register_second_level_domain.go @@ -3,11 +3,12 @@ package cli import ( "strconv" + "github.com/spf13/cast" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/spf13/cast" - "github.com/spf13/cobra" "github.com/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/client/cli/tx_register_top_level_domain.go b/x/registry/client/cli/tx_register_top_level_domain.go index 7bd74e36..61d80be9 100644 --- a/x/registry/client/cli/tx_register_top_level_domain.go +++ b/x/registry/client/cli/tx_register_top_level_domain.go @@ -3,11 +3,12 @@ package cli import ( "strconv" + "github.com/spf13/cast" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/spf13/cast" - "github.com/spf13/cobra" "github.com/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/client/cli/tx_update_dns_record.go b/x/registry/client/cli/tx_update_dns_record.go index 916e89cc..a9f50c2b 100644 --- a/x/registry/client/cli/tx_update_dns_record.go +++ b/x/registry/client/cli/tx_update_dns_record.go @@ -3,10 +3,11 @@ package cli import ( "strconv" + "github.com/spf13/cobra" + "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/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/client/cli/tx_update_text_record.go b/x/registry/client/cli/tx_update_text_record.go index 05388993..d7f7edc2 100644 --- a/x/registry/client/cli/tx_update_text_record.go +++ b/x/registry/client/cli/tx_update_text_record.go @@ -3,10 +3,11 @@ package cli import ( "strconv" + "github.com/spf13/cobra" + "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/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/client/cli/tx_update_wallet_record.go b/x/registry/client/cli/tx_update_wallet_record.go index fa9fc3c7..52054d9f 100644 --- a/x/registry/client/cli/tx_update_wallet_record.go +++ b/x/registry/client/cli/tx_update_wallet_record.go @@ -3,10 +3,11 @@ package cli import ( "strconv" + "github.com/spf13/cobra" + "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/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/client/cli/tx_withdraw_registration_fee.go b/x/registry/client/cli/tx_withdraw_registration_fee.go index 3de32139..11094ba6 100644 --- a/x/registry/client/cli/tx_withdraw_registration_fee.go +++ b/x/registry/client/cli/tx_withdraw_registration_fee.go @@ -3,10 +3,11 @@ package cli import ( "strconv" + "github.com/spf13/cobra" + "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/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/keeper/domain_ownership_test.go b/x/registry/keeper/domain_ownership_test.go index 70317482..4cce29dc 100644 --- a/x/registry/keeper/domain_ownership_test.go +++ b/x/registry/keeper/domain_ownership_test.go @@ -4,9 +4,10 @@ import ( "strconv" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + keepertest "github.com/mycel-domain/mycel/testutil/keeper" "github.com/mycel-domain/mycel/testutil/nullify" "github.com/mycel-domain/mycel/x/registry/keeper" diff --git a/x/registry/keeper/keeper.go b/x/registry/keeper/keeper.go index dc6ed31f..2a5025c0 100644 --- a/x/registry/keeper/keeper.go +++ b/x/registry/keeper/keeper.go @@ -4,6 +4,7 @@ import ( "fmt" "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" diff --git a/x/registry/keeper/msg_server_extend_top_level_domain_expiration_date_test.go b/x/registry/keeper/msg_server_extend_top_level_domain_expiration_date_test.go index e1819fa4..e8c0434e 100644 --- a/x/registry/keeper/msg_server_extend_top_level_domain_expiration_date_test.go +++ b/x/registry/keeper/msg_server_extend_top_level_domain_expiration_date_test.go @@ -4,6 +4,7 @@ import ( "fmt" errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" diff --git a/x/registry/keeper/msg_server_register_second_level_domain_test.go b/x/registry/keeper/msg_server_register_second_level_domain_test.go index ca96e940..102a3ba1 100644 --- a/x/registry/keeper/msg_server_register_second_level_domain_test.go +++ b/x/registry/keeper/msg_server_register_second_level_domain_test.go @@ -4,6 +4,7 @@ import ( "fmt" errorsmod "cosmossdk.io/errors" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" "github.com/mycel-domain/mycel/app/params" diff --git a/x/registry/keeper/msg_server_register_top_level_domain.go b/x/registry/keeper/msg_server_register_top_level_domain.go index bbc25b59..e3f45f6f 100644 --- a/x/registry/keeper/msg_server_register_top_level_domain.go +++ b/x/registry/keeper/msg_server_register_top_level_domain.go @@ -4,6 +4,7 @@ import ( "context" errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/mycel-domain/mycel/x/registry/types" diff --git a/x/registry/keeper/msg_server_register_top_level_domain_test.go b/x/registry/keeper/msg_server_register_top_level_domain_test.go index c8e26151..97592b53 100644 --- a/x/registry/keeper/msg_server_register_top_level_domain_test.go +++ b/x/registry/keeper/msg_server_register_top_level_domain_test.go @@ -4,6 +4,7 @@ import ( "fmt" errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" diff --git a/x/registry/keeper/msg_server_update_dns_record.go b/x/registry/keeper/msg_server_update_dns_record.go index 9e77d90c..01c6a460 100644 --- a/x/registry/keeper/msg_server_update_dns_record.go +++ b/x/registry/keeper/msg_server_update_dns_record.go @@ -4,6 +4,7 @@ import ( "context" errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/mycel-domain/mycel/x/registry/types" diff --git a/x/registry/keeper/msg_server_update_text_record.go b/x/registry/keeper/msg_server_update_text_record.go index ac1a8930..efa12065 100644 --- a/x/registry/keeper/msg_server_update_text_record.go +++ b/x/registry/keeper/msg_server_update_text_record.go @@ -4,6 +4,7 @@ import ( "context" errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/mycel-domain/mycel/x/registry/types" diff --git a/x/registry/keeper/msg_server_update_wallet_record.go b/x/registry/keeper/msg_server_update_wallet_record.go index e661c873..fcef122b 100644 --- a/x/registry/keeper/msg_server_update_wallet_record.go +++ b/x/registry/keeper/msg_server_update_wallet_record.go @@ -4,6 +4,7 @@ import ( "context" errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/mycel-domain/mycel/x/registry/types" diff --git a/x/registry/keeper/msg_server_withdraw_registration_fee.go b/x/registry/keeper/msg_server_withdraw_registration_fee.go index 699a4f16..311f0d33 100644 --- a/x/registry/keeper/msg_server_withdraw_registration_fee.go +++ b/x/registry/keeper/msg_server_withdraw_registration_fee.go @@ -4,6 +4,7 @@ import ( "context" errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/mycel-domain/mycel/x/registry/types" diff --git a/x/registry/keeper/msg_server_withdraw_registration_fee_test.go b/x/registry/keeper/msg_server_withdraw_registration_fee_test.go index c71f2f95..35bfaaaa 100644 --- a/x/registry/keeper/msg_server_withdraw_registration_fee_test.go +++ b/x/registry/keeper/msg_server_withdraw_registration_fee_test.go @@ -4,6 +4,7 @@ import ( "fmt" errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" diff --git a/x/registry/keeper/query_domain_ownership.go b/x/registry/keeper/query_domain_ownership.go index f24d96db..da5fb4d4 100644 --- a/x/registry/keeper/query_domain_ownership.go +++ b/x/registry/keeper/query_domain_ownership.go @@ -3,11 +3,12 @@ package keeper import ( "context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" "github.com/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/keeper/query_domain_ownership_test.go b/x/registry/keeper/query_domain_ownership_test.go index b3e3de61..1a93ba07 100644 --- a/x/registry/keeper/query_domain_ownership_test.go +++ b/x/registry/keeper/query_domain_ownership_test.go @@ -4,12 +4,13 @@ import ( "strconv" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + keepertest "github.com/mycel-domain/mycel/testutil/keeper" "github.com/mycel-domain/mycel/testutil/nullify" "github.com/mycel-domain/mycel/x/registry/types" diff --git a/x/registry/keeper/query_domain_registration_fee.go b/x/registry/keeper/query_domain_registration_fee.go index 93667304..a6fd8774 100644 --- a/x/registry/keeper/query_domain_registration_fee.go +++ b/x/registry/keeper/query_domain_registration_fee.go @@ -3,10 +3,11 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/keeper/query_params.go b/x/registry/keeper/query_params.go index 80e68c20..25f58b67 100644 --- a/x/registry/keeper/query_params.go +++ b/x/registry/keeper/query_params.go @@ -3,10 +3,11 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/keeper/query_params_test.go b/x/registry/keeper/query_params_test.go index 1d641a6f..c8d63583 100644 --- a/x/registry/keeper/query_params_test.go +++ b/x/registry/keeper/query_params_test.go @@ -3,9 +3,10 @@ package keeper_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + testkeeper "github.com/mycel-domain/mycel/testutil/keeper" "github.com/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/keeper/query_role.go b/x/registry/keeper/query_role.go index d7f9d17a..0c69ca4c 100644 --- a/x/registry/keeper/query_role.go +++ b/x/registry/keeper/query_role.go @@ -5,6 +5,7 @@ import ( "strings" errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" diff --git a/x/registry/keeper/query_role_test.go b/x/registry/keeper/query_role_test.go index f8e6b737..47d52b25 100644 --- a/x/registry/keeper/query_role_test.go +++ b/x/registry/keeper/query_role_test.go @@ -4,6 +4,7 @@ import ( "fmt" errorsmod "cosmossdk.io/errors" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/mycel-domain/mycel/testutil" diff --git a/x/registry/keeper/query_second_level_domain.go b/x/registry/keeper/query_second_level_domain.go index 07a1b67a..0f466c14 100644 --- a/x/registry/keeper/query_second_level_domain.go +++ b/x/registry/keeper/query_second_level_domain.go @@ -3,11 +3,12 @@ package keeper import ( "context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" "github.com/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/keeper/query_second_level_domain_test.go b/x/registry/keeper/query_second_level_domain_test.go index a4d0504e..8035efa7 100644 --- a/x/registry/keeper/query_second_level_domain_test.go +++ b/x/registry/keeper/query_second_level_domain_test.go @@ -4,12 +4,13 @@ import ( "strconv" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + keepertest "github.com/mycel-domain/mycel/testutil/keeper" "github.com/mycel-domain/mycel/testutil/nullify" "github.com/mycel-domain/mycel/x/registry/types" diff --git a/x/registry/keeper/query_top_level_domain.go b/x/registry/keeper/query_top_level_domain.go index 781c0807..2edc88e8 100644 --- a/x/registry/keeper/query_top_level_domain.go +++ b/x/registry/keeper/query_top_level_domain.go @@ -3,11 +3,12 @@ package keeper import ( "context" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" + "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/query" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" "github.com/mycel-domain/mycel/x/registry/types" ) diff --git a/x/registry/keeper/query_top_level_domain_test.go b/x/registry/keeper/query_top_level_domain_test.go index 2bf2370f..72293270 100644 --- a/x/registry/keeper/query_top_level_domain_test.go +++ b/x/registry/keeper/query_top_level_domain_test.go @@ -4,12 +4,13 @@ import ( "strconv" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/query" "github.com/stretchr/testify/require" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + keepertest "github.com/mycel-domain/mycel/testutil/keeper" "github.com/mycel-domain/mycel/testutil/nullify" "github.com/mycel-domain/mycel/x/registry/types" diff --git a/x/registry/keeper/second_level_domain.go b/x/registry/keeper/second_level_domain.go index d4c4c400..16c22611 100644 --- a/x/registry/keeper/second_level_domain.go +++ b/x/registry/keeper/second_level_domain.go @@ -4,6 +4,7 @@ import ( "time" errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/registry/keeper/second_level_domain_test.go b/x/registry/keeper/second_level_domain_test.go index 337b183c..838953eb 100644 --- a/x/registry/keeper/second_level_domain_test.go +++ b/x/registry/keeper/second_level_domain_test.go @@ -6,9 +6,11 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" "github.com/mycel-domain/mycel/testutil" keepertest "github.com/mycel-domain/mycel/testutil/keeper" diff --git a/x/registry/keeper/setup_test.go b/x/registry/keeper/setup_test.go index cf116850..45f6fc8d 100644 --- a/x/registry/keeper/setup_test.go +++ b/x/registry/keeper/setup_test.go @@ -4,11 +4,13 @@ import ( "testing" "time" + "github.com/stretchr/testify/suite" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/stretchr/testify/suite" mycelapp "github.com/mycel-domain/mycel/app" "github.com/mycel-domain/mycel/app/params" diff --git a/x/registry/keeper/top_level_domain.go b/x/registry/keeper/top_level_domain.go index a8c90e74..f6af0c94 100644 --- a/x/registry/keeper/top_level_domain.go +++ b/x/registry/keeper/top_level_domain.go @@ -4,6 +4,7 @@ import ( "time" errorsmod "cosmossdk.io/errors" + "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" diff --git a/x/registry/keeper/top_level_domain_fee.go b/x/registry/keeper/top_level_domain_fee.go index 5ab09778..1cddcc70 100644 --- a/x/registry/keeper/top_level_domain_fee.go +++ b/x/registry/keeper/top_level_domain_fee.go @@ -4,6 +4,7 @@ import ( "fmt" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/mycel-domain/mycel/app/params" diff --git a/x/registry/keeper/top_level_domain_test.go b/x/registry/keeper/top_level_domain_test.go index b6b6453c..460275ae 100644 --- a/x/registry/keeper/top_level_domain_test.go +++ b/x/registry/keeper/top_level_domain_test.go @@ -6,9 +6,11 @@ import ( "testing" "time" + "github.com/stretchr/testify/require" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" "github.com/mycel-domain/mycel/testutil" keepertest "github.com/mycel-domain/mycel/testutil/keeper" diff --git a/x/registry/module.go b/x/registry/module.go index e85238c5..e74294a0 100644 --- a/x/registry/module.go +++ b/x/registry/module.go @@ -6,14 +6,16 @@ import ( "fmt" "log" + "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/mycel-domain/mycel/x/registry/client/cli" "github.com/mycel-domain/mycel/x/registry/keeper" diff --git a/x/registry/types/expected_keepers.go b/x/registry/types/expected_keepers.go index 85a8b12d..aa26d0c8 100644 --- a/x/registry/types/expected_keepers.go +++ b/x/registry/types/expected_keepers.go @@ -2,6 +2,7 @@ package types import ( "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" minttypes "github.com/cosmos/cosmos-sdk/x/mint/types" diff --git a/x/registry/types/message_extend_top_level_domain_expiration_date_test.go b/x/registry/types/message_extend_top_level_domain_expiration_date_test.go index 94505c5f..b42c1937 100644 --- a/x/registry/types/message_extend_top_level_domain_expiration_date_test.go +++ b/x/registry/types/message_extend_top_level_domain_expiration_date_test.go @@ -3,9 +3,10 @@ package types import ( "testing" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/mycel-domain/mycel/testutil/sample" ) diff --git a/x/registry/types/message_register_second_level_domain.go b/x/registry/types/message_register_second_level_domain.go index b85c67e1..cbc7bb68 100644 --- a/x/registry/types/message_register_second_level_domain.go +++ b/x/registry/types/message_register_second_level_domain.go @@ -2,6 +2,7 @@ package types import ( errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) diff --git a/x/registry/types/message_register_second_level_domain_test.go b/x/registry/types/message_register_second_level_domain_test.go index ea6b41c4..11a7c2bf 100644 --- a/x/registry/types/message_register_second_level_domain_test.go +++ b/x/registry/types/message_register_second_level_domain_test.go @@ -3,9 +3,10 @@ package types import ( "testing" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/mycel-domain/mycel/testutil/sample" ) diff --git a/x/registry/types/message_register_top_level_domain.go b/x/registry/types/message_register_top_level_domain.go index 855c066b..27374434 100644 --- a/x/registry/types/message_register_top_level_domain.go +++ b/x/registry/types/message_register_top_level_domain.go @@ -2,6 +2,7 @@ package types import ( errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) diff --git a/x/registry/types/message_register_top_level_domain_test.go b/x/registry/types/message_register_top_level_domain_test.go index ac9d3df8..fff0b0ad 100644 --- a/x/registry/types/message_register_top_level_domain_test.go +++ b/x/registry/types/message_register_top_level_domain_test.go @@ -3,9 +3,10 @@ package types import ( "testing" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/mycel-domain/mycel/testutil/sample" ) diff --git a/x/registry/types/message_update_dns_record.go b/x/registry/types/message_update_dns_record.go index 1262938a..f144d858 100644 --- a/x/registry/types/message_update_dns_record.go +++ b/x/registry/types/message_update_dns_record.go @@ -2,6 +2,7 @@ package types import ( errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) diff --git a/x/registry/types/message_update_dns_record_test.go b/x/registry/types/message_update_dns_record_test.go index 48d297f7..c65a8ea2 100644 --- a/x/registry/types/message_update_dns_record_test.go +++ b/x/registry/types/message_update_dns_record_test.go @@ -3,9 +3,10 @@ package types import ( "testing" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/mycel-domain/mycel/testutil/sample" ) diff --git a/x/registry/types/message_update_text_record_test.go b/x/registry/types/message_update_text_record_test.go index 2f5be020..1fb227c9 100644 --- a/x/registry/types/message_update_text_record_test.go +++ b/x/registry/types/message_update_text_record_test.go @@ -3,9 +3,10 @@ package types import ( "testing" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/mycel-domain/mycel/testutil/sample" ) diff --git a/x/registry/types/message_update_wallet_record.go b/x/registry/types/message_update_wallet_record.go index 24b0cb0e..46fa3511 100644 --- a/x/registry/types/message_update_wallet_record.go +++ b/x/registry/types/message_update_wallet_record.go @@ -2,6 +2,7 @@ package types import ( errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) diff --git a/x/registry/types/message_update_wallet_record_test.go b/x/registry/types/message_update_wallet_record_test.go index bc6a7fe9..331f1d0f 100644 --- a/x/registry/types/message_update_wallet_record_test.go +++ b/x/registry/types/message_update_wallet_record_test.go @@ -3,9 +3,10 @@ package types import ( "testing" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/mycel-domain/mycel/testutil/sample" ) diff --git a/x/registry/types/message_withdraw_registration_fee.go b/x/registry/types/message_withdraw_registration_fee.go index 3d632ef7..cbe369ba 100644 --- a/x/registry/types/message_withdraw_registration_fee.go +++ b/x/registry/types/message_withdraw_registration_fee.go @@ -2,6 +2,7 @@ package types import ( errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) diff --git a/x/registry/types/message_withdraw_registration_fee_test.go b/x/registry/types/message_withdraw_registration_fee_test.go index 802f9481..68cbafc6 100644 --- a/x/registry/types/message_withdraw_registration_fee_test.go +++ b/x/registry/types/message_withdraw_registration_fee_test.go @@ -3,9 +3,10 @@ package types import ( "testing" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/stretchr/testify/require" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/mycel-domain/mycel/testutil/sample" ) diff --git a/x/registry/types/params.go b/x/registry/types/params.go index fc1144b5..39eb58bb 100644 --- a/x/registry/types/params.go +++ b/x/registry/types/params.go @@ -1,8 +1,9 @@ package types import ( - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "gopkg.in/yaml.v2" + + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) var _ paramtypes.ParamSet = (*Params)(nil) diff --git a/x/registry/types/second_level_domain_test.go b/x/registry/types/second_level_domain_test.go index 23ebbcb1..5e96f61e 100644 --- a/x/registry/types/second_level_domain_test.go +++ b/x/registry/types/second_level_domain_test.go @@ -4,9 +4,11 @@ import ( fmt "fmt" "testing" + "github.com/stretchr/testify/require" + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" "github.com/mycel-domain/mycel/testutil" ) diff --git a/x/registry/types/subdomain_config.go b/x/registry/types/subdomain_config.go index 4f97f155..35127660 100644 --- a/x/registry/types/subdomain_config.go +++ b/x/registry/types/subdomain_config.go @@ -4,6 +4,7 @@ import ( "errors" errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/mycel-domain/mycel/app/params" diff --git a/x/registry/types/top_level_domain.go b/x/registry/types/top_level_domain.go index efcebfd5..f8e77ebf 100644 --- a/x/registry/types/top_level_domain.go +++ b/x/registry/types/top_level_domain.go @@ -5,6 +5,7 @@ import ( errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/mycel-domain/mycel/app/params" diff --git a/x/registry/types/top_level_domain_test.go b/x/registry/types/top_level_domain_test.go index 43d56ae5..be8ae831 100644 --- a/x/registry/types/top_level_domain_test.go +++ b/x/registry/types/top_level_domain_test.go @@ -5,9 +5,10 @@ import ( "testing" "time" - errorsmod "cosmossdk.io/errors" "github.com/stretchr/testify/require" + errorsmod "cosmossdk.io/errors" + "github.com/mycel-domain/mycel/testutil" ) diff --git a/x/registry/types/wallet_record.go b/x/registry/types/wallet_record.go index c5142050..51233037 100644 --- a/x/registry/types/wallet_record.go +++ b/x/registry/types/wallet_record.go @@ -4,9 +4,10 @@ import ( fmt "fmt" "regexp" - errorsmod "cosmossdk.io/errors" "filippo.io/edwards25519" "github.com/btcsuite/btcutil/base58" + + errorsmod "cosmossdk.io/errors" ) func WalletRecordFormats() map[string]string { diff --git a/x/resolver/client/cli/query.go b/x/resolver/client/cli/query.go index 2be00395..4a10a831 100644 --- a/x/resolver/client/cli/query.go +++ b/x/resolver/client/cli/query.go @@ -3,9 +3,10 @@ package cli import ( "fmt" - "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" + "github.com/mycel-domain/mycel/x/resolver/types" ) diff --git a/x/resolver/client/cli/query_all_records.go b/x/resolver/client/cli/query_all_records.go index 64f0d5cd..364bf86d 100644 --- a/x/resolver/client/cli/query_all_records.go +++ b/x/resolver/client/cli/query_all_records.go @@ -3,9 +3,10 @@ package cli import ( "strconv" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" "github.com/mycel-domain/mycel/x/resolver/types" ) diff --git a/x/resolver/client/cli/query_dns_record.go b/x/resolver/client/cli/query_dns_record.go index 24f77be9..017e46e4 100644 --- a/x/resolver/client/cli/query_dns_record.go +++ b/x/resolver/client/cli/query_dns_record.go @@ -3,9 +3,10 @@ package cli import ( "strconv" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" "github.com/mycel-domain/mycel/x/resolver/types" ) diff --git a/x/resolver/client/cli/query_params.go b/x/resolver/client/cli/query_params.go index 7f4a05b4..eb088df8 100644 --- a/x/resolver/client/cli/query_params.go +++ b/x/resolver/client/cli/query_params.go @@ -1,9 +1,10 @@ package cli import ( + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" "github.com/mycel-domain/mycel/x/resolver/types" ) diff --git a/x/resolver/client/cli/query_text_record.go b/x/resolver/client/cli/query_text_record.go index 3cfba301..8c5ac575 100644 --- a/x/resolver/client/cli/query_text_record.go +++ b/x/resolver/client/cli/query_text_record.go @@ -3,9 +3,10 @@ package cli import ( "strconv" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" "github.com/mycel-domain/mycel/x/resolver/types" ) diff --git a/x/resolver/client/cli/query_wallet_record.go b/x/resolver/client/cli/query_wallet_record.go index 7c7bfa39..09018b69 100644 --- a/x/resolver/client/cli/query_wallet_record.go +++ b/x/resolver/client/cli/query_wallet_record.go @@ -3,9 +3,10 @@ package cli import ( "strconv" + "github.com/spf13/cobra" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" "github.com/mycel-domain/mycel/x/resolver/types" ) diff --git a/x/resolver/client/cli/tx.go b/x/resolver/client/cli/tx.go index 06140423..c71c89e3 100644 --- a/x/resolver/client/cli/tx.go +++ b/x/resolver/client/cli/tx.go @@ -4,9 +4,10 @@ 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/mycel-domain/mycel/x/resolver/types" ) diff --git a/x/resolver/keeper/keeper.go b/x/resolver/keeper/keeper.go index 9128c98a..a7ad62f5 100644 --- a/x/resolver/keeper/keeper.go +++ b/x/resolver/keeper/keeper.go @@ -4,6 +4,7 @@ import ( "fmt" "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" diff --git a/x/resolver/keeper/msg_server_test.go b/x/resolver/keeper/msg_server_test.go index 980c287a..9f463da7 100644 --- a/x/resolver/keeper/msg_server_test.go +++ b/x/resolver/keeper/msg_server_test.go @@ -4,9 +4,10 @@ import ( "context" "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + keepertest "github.com/mycel-domain/mycel/testutil/keeper" "github.com/mycel-domain/mycel/x/resolver/keeper" "github.com/mycel-domain/mycel/x/resolver/types" diff --git a/x/resolver/keeper/query_all_records.go b/x/resolver/keeper/query_all_records.go index 9eeef0f6..8e822217 100644 --- a/x/resolver/keeper/query_all_records.go +++ b/x/resolver/keeper/query_all_records.go @@ -3,10 +3,11 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdk "github.com/cosmos/cosmos-sdk/types" + registrytypes "github.com/mycel-domain/mycel/x/registry/types" "github.com/mycel-domain/mycel/x/resolver/types" ) diff --git a/x/resolver/keeper/query_dns_record.go b/x/resolver/keeper/query_dns_record.go index 624dc401..e761c2c5 100644 --- a/x/resolver/keeper/query_dns_record.go +++ b/x/resolver/keeper/query_dns_record.go @@ -3,10 +3,11 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdk "github.com/cosmos/cosmos-sdk/types" + registrytypes "github.com/mycel-domain/mycel/x/registry/types" "github.com/mycel-domain/mycel/x/resolver/types" ) diff --git a/x/resolver/keeper/query_params.go b/x/resolver/keeper/query_params.go index 6f4d8980..c2d54970 100644 --- a/x/resolver/keeper/query_params.go +++ b/x/resolver/keeper/query_params.go @@ -3,10 +3,11 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/mycel-domain/mycel/x/resolver/types" ) diff --git a/x/resolver/keeper/query_params_test.go b/x/resolver/keeper/query_params_test.go index ee4d6197..1d0388ab 100644 --- a/x/resolver/keeper/query_params_test.go +++ b/x/resolver/keeper/query_params_test.go @@ -3,9 +3,10 @@ package keeper_test import ( "testing" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" + sdk "github.com/cosmos/cosmos-sdk/types" + testkeeper "github.com/mycel-domain/mycel/testutil/keeper" "github.com/mycel-domain/mycel/x/resolver/types" ) diff --git a/x/resolver/keeper/query_text_record.go b/x/resolver/keeper/query_text_record.go index 921a069e..67e31105 100644 --- a/x/resolver/keeper/query_text_record.go +++ b/x/resolver/keeper/query_text_record.go @@ -3,10 +3,11 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdk "github.com/cosmos/cosmos-sdk/types" + registrytypes "github.com/mycel-domain/mycel/x/registry/types" "github.com/mycel-domain/mycel/x/resolver/types" ) diff --git a/x/resolver/keeper/query_wallet_record.go b/x/resolver/keeper/query_wallet_record.go index 7c3b6304..9ca3c2bd 100644 --- a/x/resolver/keeper/query_wallet_record.go +++ b/x/resolver/keeper/query_wallet_record.go @@ -3,10 +3,11 @@ package keeper import ( "context" - sdk "github.com/cosmos/cosmos-sdk/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sdk "github.com/cosmos/cosmos-sdk/types" + registrytypes "github.com/mycel-domain/mycel/x/registry/types" "github.com/mycel-domain/mycel/x/resolver/types" ) diff --git a/x/resolver/keeper/setup_test.go b/x/resolver/keeper/setup_test.go index cf116850..45f6fc8d 100644 --- a/x/resolver/keeper/setup_test.go +++ b/x/resolver/keeper/setup_test.go @@ -4,11 +4,13 @@ import ( "testing" "time" + "github.com/stretchr/testify/suite" + tmproto "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/baseapp" sdk "github.com/cosmos/cosmos-sdk/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" - "github.com/stretchr/testify/suite" mycelapp "github.com/mycel-domain/mycel/app" "github.com/mycel-domain/mycel/app/params" diff --git a/x/resolver/module.go b/x/resolver/module.go index a883083e..3d317cac 100644 --- a/x/resolver/module.go +++ b/x/resolver/module.go @@ -6,14 +6,16 @@ import ( "fmt" "log" + "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/mycel-domain/mycel/x/resolver/client/cli" "github.com/mycel-domain/mycel/x/resolver/keeper" diff --git a/x/resolver/types/params.go b/x/resolver/types/params.go index 357196ad..cc90a6d8 100644 --- a/x/resolver/types/params.go +++ b/x/resolver/types/params.go @@ -1,8 +1,9 @@ package types import ( - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "gopkg.in/yaml.v2" + + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" ) var _ paramtypes.ParamSet = (*Params)(nil) From 4b8076849cbfa5f7f592c49ed4bfe5f4a490d6e0 Mon Sep 17 00:00:00 2001 From: foxytanuki Date: Tue, 19 Dec 2023 14:00:42 +0900 Subject: [PATCH 05/17] Fix warnings from thelper --- testutil/keeper/epochs.go | 6 ++++-- testutil/keeper/furnace.go | 6 ++++-- testutil/keeper/registry.go | 6 ++++-- testutil/keeper/resolver.go | 6 ++++-- testutil/network/network.go | 2 ++ x/epochs/keeper/msg_server_test.go | 4 ++-- x/furnace/keeper/msg_server_test.go | 6 ++++-- x/registry/keeper/msg_server_test.go | 4 ++-- x/resolver/keeper/msg_server_test.go | 6 ++++-- 9 files changed, 30 insertions(+), 16 deletions(-) diff --git a/testutil/keeper/epochs.go b/testutil/keeper/epochs.go index 41ae986d..48be9bb7 100644 --- a/testutil/keeper/epochs.go +++ b/testutil/keeper/epochs.go @@ -20,7 +20,9 @@ import ( "github.com/mycel-domain/mycel/x/epochs/types" ) -func EpochsKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { +func EpochsKeeper(tb testing.TB) (*keeper.Keeper, sdk.Context) { + tb.Helper() + storeKey := sdk.NewKVStoreKey(types.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) @@ -28,7 +30,7 @@ func EpochsKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { stateStore := store.NewCommitMultiStore(db) stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) - require.NoError(t, stateStore.LoadLatestVersion()) + require.NoError(tb, stateStore.LoadLatestVersion()) registry := codectypes.NewInterfaceRegistry() cdc := codec.NewProtoCodec(registry) diff --git a/testutil/keeper/furnace.go b/testutil/keeper/furnace.go index f0450b3f..fcee5065 100644 --- a/testutil/keeper/furnace.go +++ b/testutil/keeper/furnace.go @@ -20,7 +20,9 @@ import ( "github.com/mycel-domain/mycel/x/furnace/types" ) -func FurnaceKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { +func FurnaceKeeper(tb testing.TB) (*keeper.Keeper, sdk.Context) { + tb.Helper() + storeKey := sdk.NewKVStoreKey(types.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) @@ -28,7 +30,7 @@ func FurnaceKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { stateStore := store.NewCommitMultiStore(db) stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) - require.NoError(t, stateStore.LoadLatestVersion()) + require.NoError(tb, stateStore.LoadLatestVersion()) registry := codectypes.NewInterfaceRegistry() cdc := codec.NewProtoCodec(registry) diff --git a/testutil/keeper/registry.go b/testutil/keeper/registry.go index 9b6c20c3..69eb633f 100644 --- a/testutil/keeper/registry.go +++ b/testutil/keeper/registry.go @@ -20,7 +20,9 @@ import ( "github.com/mycel-domain/mycel/x/registry/types" ) -func RegistryKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { +func RegistryKeeper(tb testing.TB) (*keeper.Keeper, sdk.Context) { + tb.Helper() + storeKey := sdk.NewKVStoreKey(types.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) @@ -28,7 +30,7 @@ func RegistryKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { stateStore := store.NewCommitMultiStore(db) stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) - require.NoError(t, stateStore.LoadLatestVersion()) + require.NoError(tb, stateStore.LoadLatestVersion()) registry := codectypes.NewInterfaceRegistry() cdc := codec.NewProtoCodec(registry) diff --git a/testutil/keeper/resolver.go b/testutil/keeper/resolver.go index 4df79898..bbed4c2c 100644 --- a/testutil/keeper/resolver.go +++ b/testutil/keeper/resolver.go @@ -20,7 +20,9 @@ import ( "github.com/mycel-domain/mycel/x/resolver/types" ) -func ResolverKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { +func ResolverKeeper(tb testing.TB) (*keeper.Keeper, sdk.Context) { + tb.Helper() + storeKey := sdk.NewKVStoreKey(types.StoreKey) memStoreKey := storetypes.NewMemoryStoreKey(types.MemStoreKey) @@ -28,7 +30,7 @@ func ResolverKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { stateStore := store.NewCommitMultiStore(db) stateStore.MountStoreWithDB(storeKey, storetypes.StoreTypeIAVL, db) stateStore.MountStoreWithDB(memStoreKey, storetypes.StoreTypeMemory, nil) - require.NoError(t, stateStore.LoadLatestVersion()) + require.NoError(tb, stateStore.LoadLatestVersion()) registry := codectypes.NewInterfaceRegistry() cdc := codec.NewProtoCodec(registry) diff --git a/testutil/network/network.go b/testutil/network/network.go index bbcf9e68..81a5d990 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -32,6 +32,8 @@ type ( // New creates instance with fully configured cosmos network. // Accepts optional config, that will be used in place of the DefaultConfig() if provided. func New(t *testing.T, configs ...Config) *Network { + t.Helper() + if len(configs) > 1 { panic("at most one config should be provided") } diff --git a/x/epochs/keeper/msg_server_test.go b/x/epochs/keeper/msg_server_test.go index f0f7cc32..23233373 100644 --- a/x/epochs/keeper/msg_server_test.go +++ b/x/epochs/keeper/msg_server_test.go @@ -11,7 +11,7 @@ import ( "github.com/mycel-domain/mycel/x/epochs/types" ) -func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { - k, ctx := keepertest.EpochsKeeper(t) +func setupMsgServer(tb testing.TB) (types.MsgServer, context.Context) { + k, ctx := keepertest.EpochsKeeper(tb) return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) } diff --git a/x/furnace/keeper/msg_server_test.go b/x/furnace/keeper/msg_server_test.go index 222a4b76..51599bca 100644 --- a/x/furnace/keeper/msg_server_test.go +++ b/x/furnace/keeper/msg_server_test.go @@ -13,8 +13,10 @@ import ( "github.com/mycel-domain/mycel/x/furnace/types" ) -func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { - k, ctx := keepertest.FurnaceKeeper(t) +func setupMsgServer(tb testing.TB) (types.MsgServer, context.Context) { + tb.Helper() + + k, ctx := keepertest.FurnaceKeeper(tb) return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) } diff --git a/x/registry/keeper/msg_server_test.go b/x/registry/keeper/msg_server_test.go index f58a290e..aae64716 100644 --- a/x/registry/keeper/msg_server_test.go +++ b/x/registry/keeper/msg_server_test.go @@ -12,8 +12,8 @@ import ( "github.com/mycel-domain/mycel/x/registry/types" ) -func setupMsgServer(t testing.TB) (types.MsgServer, keeper.Keeper, context.Context) { - k, ctx := keepertest.RegistryKeeper(t) +func setupMsgServer(tb testing.TB) (types.MsgServer, keeper.Keeper, context.Context) { + k, ctx := keepertest.RegistryKeeper(tb) registry.InitGenesis(ctx, *k, *types.DefaultGenesis()) return keeper.NewMsgServerImpl(*k), *k, sdk.WrapSDKContext(ctx) } diff --git a/x/resolver/keeper/msg_server_test.go b/x/resolver/keeper/msg_server_test.go index 9f463da7..777772e3 100644 --- a/x/resolver/keeper/msg_server_test.go +++ b/x/resolver/keeper/msg_server_test.go @@ -13,8 +13,10 @@ import ( "github.com/mycel-domain/mycel/x/resolver/types" ) -func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { - k, ctx := keepertest.ResolverKeeper(t) +func setupMsgServer(tb testing.TB) (types.MsgServer, context.Context) { + tb.Helper() + + k, ctx := keepertest.ResolverKeeper(tb) return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) } From b420237b7741e918272f93e48de960a3eef15b20 Mon Sep 17 00:00:00 2001 From: foxytanuki Date: Tue, 19 Dec 2023 14:03:13 +0900 Subject: [PATCH 06/17] Fix warnings from unconvert --- x/furnace/keeper/hooks.go | 8 ++++---- x/furnace/keeper/hooks_test.go | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/x/furnace/keeper/hooks.go b/x/furnace/keeper/hooks.go index 6521952b..b1a25c9a 100644 --- a/x/furnace/keeper/hooks.go +++ b/x/furnace/keeper/hooks.go @@ -26,10 +26,10 @@ func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumb } // Get burn amount - burnAmount, found := k.GetBurnAmount(ctx, uint64(config.CurrentBurnAmountIndex)) + burnAmount, found := k.GetBurnAmount(ctx, config.CurrentBurnAmountIndex) // If not found, set default burn amount if !found { - burnAmount = k.NewBurnAmount(ctx, config, uint64(config.CurrentBurnAmountIndex)) + burnAmount = k.NewBurnAmount(ctx, config, config.CurrentBurnAmountIndex) } // Check if CurrentEpoch is smaller than TotalEpochs @@ -42,9 +42,9 @@ func (k Keeper) AfterEpochEnd(ctx sdk.Context, epochIdentifier string, epochNumb config.CurrentBurnAmountIndex++ k.SetEpochBurnConfig(ctx, config) - burnAmount, found = k.GetBurnAmount(ctx, uint64(config.CurrentBurnAmountIndex)) + burnAmount, found = k.GetBurnAmount(ctx, config.CurrentBurnAmountIndex) if !found { - burnAmount = k.NewBurnAmount(ctx, config, uint64(config.CurrentBurnAmountIndex)) + burnAmount = k.NewBurnAmount(ctx, config, config.CurrentBurnAmountIndex) } } diff --git a/x/furnace/keeper/hooks_test.go b/x/furnace/keeper/hooks_test.go index 67ae5fac..01093633 100644 --- a/x/furnace/keeper/hooks_test.go +++ b/x/furnace/keeper/hooks_test.go @@ -74,7 +74,7 @@ func (suite *KeeperTestSuite) TestAfterEpochEndCreateBurnAmount() { // Check if burn amount is expected config, found := suite.app.FurnaceKeeper.GetEpochBurnConfig(suite.ctx) suite.Require().True(found) - _, found = suite.app.FurnaceKeeper.GetBurnAmount(suite.ctx, uint64(config.CurrentBurnAmountIndex)) + _, found = suite.app.FurnaceKeeper.GetBurnAmount(suite.ctx, config.CurrentBurnAmountIndex) suite.Require().True(found) } @@ -238,7 +238,7 @@ func (suite *KeeperTestSuite) TestAfterEpochEnd() { // Check if burn amount is expected config, found := suite.app.FurnaceKeeper.GetEpochBurnConfig(suite.ctx) suite.Require().True(found) - _, found = suite.app.FurnaceKeeper.GetBurnAmount(suite.ctx, uint64(config.CurrentBurnAmountIndex)) + _, found = suite.app.FurnaceKeeper.GetBurnAmount(suite.ctx, config.CurrentBurnAmountIndex) suite.Require().True(found) } From 71a71c085485419f8cbfb8f1b8969ef1c1f4d56a Mon Sep 17 00:00:00 2001 From: foxytanuki Date: Tue, 19 Dec 2023 17:55:16 +0900 Subject: [PATCH 07/17] Fix warnings from staticcheck --- app/app.go | 2 +- cmd/myceld/dns/dns.go | 3 ++- x/epochs/module_simulation.go | 4 ++-- x/furnace/module_simulation.go | 5 ----- x/furnace/types/errors.go | 6 +++--- x/registry/module_simulation.go | 4 ++-- .../message_extend_top_level_domain_expiration_date.go | 4 +++- x/registry/types/message_update_text_record.go | 4 +++- x/resolver/module_simulation.go | 5 ----- x/resolver/types/errors.go | 4 ++-- 10 files changed, 18 insertions(+), 23 deletions(-) diff --git a/app/app.go b/app/app.go index f23f8b73..85eb1d42 100644 --- a/app/app.go +++ b/app/app.go @@ -1128,7 +1128,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(icacontrollertypes.SubModuleName) paramsKeeper.Subspace(icahosttypes.SubModuleName) // CosmWasm - paramsKeeper.Subspace(wasm.ModuleName) + paramsKeeper.Subspace(wasmtypes.ModuleName) // my modules paramsKeeper.Subspace(registrymoduletypes.ModuleName) paramsKeeper.Subspace(epochsmoduletypes.ModuleName) diff --git a/cmd/myceld/dns/dns.go b/cmd/myceld/dns/dns.go index afd1fb5b..2402a6e4 100644 --- a/cmd/myceld/dns/dns.go +++ b/cmd/myceld/dns/dns.go @@ -10,6 +10,7 @@ import ( "github.com/miekg/dns" "github.com/spf13/cobra" "google.golang.org/grpc" + "google.golang.org/grpc/credentials/insecure" resolver "github.com/mycel-domain/mycel/x/resolver/types" ) @@ -200,7 +201,7 @@ func (s *grpcService) HandleDNSRequest(w dns.ResponseWriter, r *dns.Msg) { func RunDnsServer(nodeAddress string, listenPort int) error { grpcConn, err := grpc.Dial(nodeAddress, - grpc.WithInsecure(), + grpc.WithTransportCredentials(insecure.NewCredentials()), ) if err != nil { log.Fatalf("Failed to connect to node: %v", err) diff --git a/x/epochs/module_simulation.go b/x/epochs/module_simulation.go index fbd65c56..3b393c13 100644 --- a/x/epochs/module_simulation.go +++ b/x/epochs/module_simulation.go @@ -40,8 +40,8 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&epochsGenesis) } -// ProposalContents doesn't return any content functions for governance proposals -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { +// ProposalMsgs doesn't return any content functions for governance proposals +func (AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { return nil } diff --git a/x/furnace/module_simulation.go b/x/furnace/module_simulation.go index a697fce5..899d1047 100644 --- a/x/furnace/module_simulation.go +++ b/x/furnace/module_simulation.go @@ -43,11 +43,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { // RegisterStoreDecoder registers a decoder. func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} -// ProposalContents doesn't return any content functions for governance proposals. -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { - return nil -} - // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) diff --git a/x/furnace/types/errors.go b/x/furnace/types/errors.go index 1485e8dd..2c692123 100644 --- a/x/furnace/types/errors.go +++ b/x/furnace/types/errors.go @@ -3,11 +3,11 @@ package types // DONTCOVER import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) // x/furnace module sentinel errors var ( - ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") - ErrInvalidRegistrationPeriod = sdkerrors.Register(ModuleName, 1101, "invalid registration period") + ErrSample = errorsmod.Register(ModuleName, 1100, "sample error") + ErrInvalidRegistrationPeriod = errorsmod.Register(ModuleName, 1101, "invalid registration period") ) diff --git a/x/registry/module_simulation.go b/x/registry/module_simulation.go index d620bd98..e1a61058 100644 --- a/x/registry/module_simulation.go +++ b/x/registry/module_simulation.go @@ -64,8 +64,8 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(®istryGenesis) } -// ProposalContents doesn't return any content functions for governance proposals -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { +// ProposalMsgs doesn't return any content functions for governance proposals +func (AppModule) ProposalMsgs(simState module.SimulationState) []simtypes.WeightedProposalMsg { return nil } diff --git a/x/registry/types/message_extend_top_level_domain_expiration_date.go b/x/registry/types/message_extend_top_level_domain_expiration_date.go index 309ae658..0ce0f7b4 100644 --- a/x/registry/types/message_extend_top_level_domain_expiration_date.go +++ b/x/registry/types/message_extend_top_level_domain_expiration_date.go @@ -1,6 +1,8 @@ package types import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -41,7 +43,7 @@ func (msg *MsgExtendTopLevelDomainExpirationDate) GetSignBytes() []byte { func (msg *MsgExtendTopLevelDomainExpirationDate) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) } return nil } diff --git a/x/registry/types/message_update_text_record.go b/x/registry/types/message_update_text_record.go index 0467c5ac..8edd9ba1 100644 --- a/x/registry/types/message_update_text_record.go +++ b/x/registry/types/message_update_text_record.go @@ -1,6 +1,8 @@ package types import ( + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) @@ -43,7 +45,7 @@ func (msg *MsgUpdateTextRecord) GetSignBytes() []byte { func (msg *MsgUpdateTextRecord) ValidateBasic() error { _, err := sdk.AccAddressFromBech32(msg.Creator) if err != nil { - return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) } return nil } diff --git a/x/resolver/module_simulation.go b/x/resolver/module_simulation.go index e184c701..95276b11 100644 --- a/x/resolver/module_simulation.go +++ b/x/resolver/module_simulation.go @@ -43,11 +43,6 @@ func (AppModule) GenerateGenesisState(simState *module.SimulationState) { // RegisterStoreDecoder registers a decoder. func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} -// ProposalContents doesn't return any content functions for governance proposals. -func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { - return nil -} - // WeightedOperations returns the all the gov module operations with their respective weights. func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { operations := make([]simtypes.WeightedOperation, 0) diff --git a/x/resolver/types/errors.go b/x/resolver/types/errors.go index 639cb6d4..e20fd895 100644 --- a/x/resolver/types/errors.go +++ b/x/resolver/types/errors.go @@ -3,10 +3,10 @@ package types // DONTCOVER import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + errorsmod "cosmossdk.io/errors" ) // x/resolver module sentinel errors var ( - ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") + ErrSample = errorsmod.Register(ModuleName, 1100, "sample error") ) From d3605efd3c5db23d34f3af1bfdcebce0fec46685 Mon Sep 17 00:00:00 2001 From: foxytanuki Date: Tue, 19 Dec 2023 19:46:36 +0900 Subject: [PATCH 08/17] Fix warnings from unparam --- x/registry/keeper/second_level_domain_test.go | 4 ++-- x/registry/keeper/top_level_domain_test.go | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/x/registry/keeper/second_level_domain_test.go b/x/registry/keeper/second_level_domain_test.go index 838953eb..534ae87b 100644 --- a/x/registry/keeper/second_level_domain_test.go +++ b/x/registry/keeper/second_level_domain_test.go @@ -47,10 +47,10 @@ func createNSecondLevelDomainResponse(keeper *keeper.Keeper, ctx sdk.Context, n // Register top-level domains with k.RegisterSecondLevelDomain() // Domain name is set to `n` (n is a incremantal number) // e.g.) `1`, `2`, `n`... -func registerNSecondLevelDomain(k *keeper.Keeper, ctx sdk.Context, creator string, n int) ([]types.SecondLevelDomain, error) { +func registerNSecondLevelDomain(k *keeper.Keeper, ctx sdk.Context, creatorAddr string, n int) ([]types.SecondLevelDomain, error) { items := make([]types.SecondLevelDomain, n) for i := range items { - creator, err := sdk.AccAddressFromBech32(testutil.Alice) + creator, err := sdk.AccAddressFromBech32(creatorAddr) if err != nil { return nil, err } diff --git a/x/registry/keeper/top_level_domain_test.go b/x/registry/keeper/top_level_domain_test.go index 460275ae..436be675 100644 --- a/x/registry/keeper/top_level_domain_test.go +++ b/x/registry/keeper/top_level_domain_test.go @@ -35,13 +35,12 @@ func createNTopLevelDomain(keeper *keeper.Keeper, ctx sdk.Context, n int) []type // Register top-level domains with k.RegisterTopLevelDomain() // Domain name is set to `celn` (n is a incremantal number) // e.g.) `cel1`, `cel2`, `celn`... -func registerNTopLevelDomain(k *keeper.Keeper, ctx sdk.Context, creator string, n int) ([]types.TopLevelDomain, error) { +func registerNTopLevelDomain(k *keeper.Keeper, ctx sdk.Context, creatorAddr string, n int) ([]types.TopLevelDomain, error) { items := make([]types.TopLevelDomain, n) for i := range items { - creator := testutil.Alice name := "cel" + strconv.Itoa(i) - tld, _, err := k.RegisterTopLevelDomain(ctx, creator, name, 1) + tld, _, err := k.RegisterTopLevelDomain(ctx, creatorAddr, name, 1) if err != nil { return nil, err } From f573f6f417515d665889384e551187937dcbf498 Mon Sep 17 00:00:00 2001 From: foxytanuki Date: Tue, 19 Dec 2023 20:08:59 +0900 Subject: [PATCH 09/17] Fix warnings from revive --- app/app.go | 4 +-- x/epochs/keeper/abci.go | 2 +- x/epochs/types/epoch_identifier.go | 5 +--- .../keeper/query_domain_registration_fee.go | 30 +++++++++---------- x/registry/types/top_level_domain.go | 4 +-- 5 files changed, 20 insertions(+), 25 deletions(-) diff --git a/app/app.go b/app/app.go index 85eb1d42..6b9accc3 100644 --- a/app/app.go +++ b/app/app.go @@ -1031,8 +1031,8 @@ func (app *App) TxConfig() client.TxConfig { } // DefaultGenesis returns a default genesis from the registered AppModuleBasic's. -func (a *App) DefaultGenesis() map[string]json.RawMessage { - return ModuleBasics.DefaultGenesis(a.appCodec) +func (app *App) DefaultGenesis() map[string]json.RawMessage { + return ModuleBasics.DefaultGenesis(app.appCodec) } // GetKey returns the KVStoreKey for the provided store key. diff --git a/x/epochs/keeper/abci.go b/x/epochs/keeper/abci.go index 1c3237ec..981c6aef 100644 --- a/x/epochs/keeper/abci.go +++ b/x/epochs/keeper/abci.go @@ -44,7 +44,7 @@ func (k Keeper) BeginBlocker(ctx sdk.Context) { ), ) k.AfterEpochEnd(ctx, epochInfo.Identifier, epochInfo.CurrentEpoch) - epochInfo.CurrentEpoch += 1 + epochInfo.CurrentEpoch++ epochInfo.CurrentEpochStartTime = epochInfo.CurrentEpochStartTime.Add(epochInfo.Duration) logger.Info(fmt.Sprintf("Starting epoch with identifier %s epoch number %d", epochInfo.Identifier, epochInfo.CurrentEpoch)) } diff --git a/x/epochs/types/epoch_identifier.go b/x/epochs/types/epoch_identifier.go index 791951dc..8150c6ab 100644 --- a/x/epochs/types/epoch_identifier.go +++ b/x/epochs/types/epoch_identifier.go @@ -14,11 +14,8 @@ func ValidateEpochIdentifierInterface(i interface{}) error { if !ok { return errorsmod.Wrapf(ErrInvalidParameterType, "%T", i) } - if err := ValidateEpochIdentifierString(v); err != nil { - return err - } - return nil + return ValidateEpochIdentifierString(v) } func ValidateEpochIdentifierString(s string) error { diff --git a/x/registry/keeper/query_domain_registration_fee.go b/x/registry/keeper/query_domain_registration_fee.go index a6fd8774..10492829 100644 --- a/x/registry/keeper/query_domain_registration_fee.go +++ b/x/registry/keeper/query_domain_registration_fee.go @@ -41,15 +41,14 @@ func (k Keeper) DomainRegistrationFee(goCtx context.Context, req *types.QueryDom fee, err := k.GetTopLevelDomainFee(ctx, domain, req.RegistrationPeriodInYear) if err != nil { return createErrorResponse(err), nil - } else { - return &types.QueryDomainRegistrationFeeResponse{ - IsRegistrable: true, - Fee: fee.TotalFee, - RegistrationPeriodInYear: 1, - MaxSubDomainRegistrations: config.MaxSubdomainRegistrations, - ErrorMessage: "", - }, nil } + return &types.QueryDomainRegistrationFeeResponse{ + IsRegistrable: true, + Fee: fee.TotalFee, + RegistrationPeriodInYear: 1, + MaxSubDomainRegistrations: config.MaxSubdomainRegistrations, + ErrorMessage: "", + }, nil } else { // Second level domain domain := types.SecondLevelDomain{Name: req.Name, Parent: req.Parent} @@ -61,14 +60,13 @@ func (k Keeper) DomainRegistrationFee(goCtx context.Context, req *types.QueryDom fee, err := config.GetRegistrationFee(domain.Name, req.RegistrationPeriodInYear) if err != nil { return createErrorResponse(err), nil - } else { - return &types.QueryDomainRegistrationFeeResponse{ - IsRegistrable: true, - Fee: sdk.NewCoins(fee), - RegistrationPeriodInYear: 1, - MaxSubDomainRegistrations: 0, - ErrorMessage: "", - }, nil } + return &types.QueryDomainRegistrationFeeResponse{ + IsRegistrable: true, + Fee: sdk.NewCoins(fee), + RegistrationPeriodInYear: 1, + MaxSubDomainRegistrations: 0, + ErrorMessage: "", + }, nil } } diff --git a/x/registry/types/top_level_domain.go b/x/registry/types/top_level_domain.go index f8e77ebf..c63ee194 100644 --- a/x/registry/types/top_level_domain.go +++ b/x/registry/types/top_level_domain.go @@ -37,12 +37,12 @@ func GetBeseFeeAmountInDenom(denom string, baseFeeInUsd int64) (amount math.Int, return amount, nil } -func (topLevelDommain TopLevelDomain) GetRegistrationFeeAmountInDenom(denom string, baseFeeInUsd int64, registrationPeriodInYear uint64) (amount math.Int, err error) { +func (topLevelDomain TopLevelDomain) GetRegistrationFeeAmountInDenom(denom string, baseFeeInUsd int64, registrationPeriodInYear uint64) (amount math.Int, err error) { baseFeeAmount, err := GetBeseFeeAmountInDenom(denom, baseFeeInUsd) if err != nil { return amount, err } - amount = sdk.NewInt(int64(registrationPeriodInYear) * int64(topLevelDommain.SubdomainConfig.MaxSubdomainRegistrations)).Mul(baseFeeAmount) + amount = sdk.NewInt(int64(registrationPeriodInYear) * int64(topLevelDomain.SubdomainConfig.MaxSubdomainRegistrations)).Mul(baseFeeAmount) return amount, nil } From a0b8f8b7c8c6b338aee13420ca217dcfae887c51 Mon Sep 17 00:00:00 2001 From: foxytanuki Date: Tue, 19 Dec 2023 20:10:48 +0900 Subject: [PATCH 10/17] Fix warnings from ineffassign --- x/registry/client/cli/query_domain_registration_fee.go | 3 +++ x/registry/client/cli/tx_register_top_level_domain.go | 3 +++ 2 files changed, 6 insertions(+) diff --git a/x/registry/client/cli/query_domain_registration_fee.go b/x/registry/client/cli/query_domain_registration_fee.go index 24a0e085..810db877 100644 --- a/x/registry/client/cli/query_domain_registration_fee.go +++ b/x/registry/client/cli/query_domain_registration_fee.go @@ -23,6 +23,9 @@ func CmdDomainRegistrationFee() *cobra.Command { reqName := args[0] reqParent := args[1] reqRegistrationPeriodInYear, err := cast.ToUint64E(args[2]) + if err != nil { + return err + } clientCtx, err := client.GetClientQueryContext(cmd) if err != nil { diff --git a/x/registry/client/cli/tx_register_top_level_domain.go b/x/registry/client/cli/tx_register_top_level_domain.go index 61d80be9..8dcf25d0 100644 --- a/x/registry/client/cli/tx_register_top_level_domain.go +++ b/x/registry/client/cli/tx_register_top_level_domain.go @@ -23,6 +23,9 @@ func CmdRegisterTopLevelDomain() *cobra.Command { RunE: func(cmd *cobra.Command, args []string) (err error) { argName := args[0] argRegistrationPeriodInYear, err := cast.ToUint64E(args[1]) + if err != nil { + return err + } clientCtx, err := client.GetClientTxContext(cmd) if err != nil { From dd60b9ff1b9a5028fc0b80aea7f3b0cff21d5565 Mon Sep 17 00:00:00 2001 From: foxytanuki Date: Tue, 19 Dec 2023 20:16:16 +0900 Subject: [PATCH 11/17] Fix warnings from nakedret --- x/epochs/keeper/abci.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x/epochs/keeper/abci.go b/x/epochs/keeper/abci.go index 981c6aef..7b144935 100644 --- a/x/epochs/keeper/abci.go +++ b/x/epochs/keeper/abci.go @@ -18,7 +18,7 @@ func (k Keeper) BeginBlocker(ctx sdk.Context) { // If blocktime < initial epoch start time, return if ctx.BlockTime().Before(epochInfo.StartTime) { - return + return false } // if epoch counting hasn't started, signal we need to start. shouldInitialEpochStart := !epochInfo.EpochCountingStarted From 0d2b04a3d32d018f25f68d624f000b967c3c12d0 Mon Sep 17 00:00:00 2001 From: foxytanuki Date: Tue, 19 Dec 2023 20:33:45 +0900 Subject: [PATCH 12/17] Fix warnings from gocritic --- cmd/myceld/dns/dns.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/myceld/dns/dns.go b/cmd/myceld/dns/dns.go index 2402a6e4..69773585 100644 --- a/cmd/myceld/dns/dns.go +++ b/cmd/myceld/dns/dns.go @@ -25,6 +25,11 @@ func (s *grpcService) QueryDnsToMycelResolver(domain string, recordType string) domain = strings.Trim(domain, ".") division := strings.Index(domain, ".") + if division < 0 { + log.Printf("QueryDnsToMycelResolver: %s, %s", "invalid domain format", domain) + return nil + } + argName := domain[:division] argParent := domain[division+1:] From 01a16def7cc1b4ee851ad841c69728941c55bcff Mon Sep 17 00:00:00 2001 From: foxytanuki Date: Tue, 19 Dec 2023 21:15:54 +0900 Subject: [PATCH 13/17] Fix warnings from gosec (G601: Implicit memory aliasing in for loop.) --- x/epochs/keeper/epoch_info_test.go | 3 ++- x/furnace/client/cli/query_burn_amount_test.go | 3 ++- x/furnace/keeper/burn_amount_test.go | 3 ++- x/registry/client/cli/query_domain_ownership_test.go | 6 ++++-- x/registry/client/cli/query_second_level_domain_test.go | 6 ++++-- x/registry/client/cli/query_top_level_domain_test.go | 3 ++- x/registry/keeper/domain_ownership_test.go | 3 ++- x/registry/keeper/second_level_domain_test.go | 3 ++- x/registry/keeper/top_level_domain_test.go | 3 ++- 9 files changed, 22 insertions(+), 11 deletions(-) diff --git a/x/epochs/keeper/epoch_info_test.go b/x/epochs/keeper/epoch_info_test.go index 980d99df..21f64324 100644 --- a/x/epochs/keeper/epoch_info_test.go +++ b/x/epochs/keeper/epoch_info_test.go @@ -30,7 +30,8 @@ func createNEpochInfo(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.Epo func TestEpochInfoGet(t *testing.T) { keeper, ctx := keepertest.EpochsKeeper(t) items := createNEpochInfo(keeper, ctx, 10) - for _, item := range items { + for i := range items { + item := items[i] rst, found := keeper.GetEpochInfo(ctx, item.Identifier, ) diff --git a/x/furnace/client/cli/query_burn_amount_test.go b/x/furnace/client/cli/query_burn_amount_test.go index fc4a7071..3f59fa53 100644 --- a/x/furnace/client/cli/query_burn_amount_test.go +++ b/x/furnace/client/cli/query_burn_amount_test.go @@ -70,7 +70,8 @@ func TestShowBurnAmount(t *testing.T) { err: status.Error(codes.NotFound, "not found"), }, } - for _, tc := range tests { + for i := range tests { + tc := tests[i] t.Run(tc.desc, func(t *testing.T) { args := []string{ strconv.Itoa(int(tc.idIndex)), diff --git a/x/furnace/keeper/burn_amount_test.go b/x/furnace/keeper/burn_amount_test.go index 1d599f61..18fea662 100644 --- a/x/furnace/keeper/burn_amount_test.go +++ b/x/furnace/keeper/burn_amount_test.go @@ -32,7 +32,8 @@ func createNBurnAmount(keeper *keeper.Keeper, ctx sdk.Context, n int) []types.Bu func TestBurnAmountGet(t *testing.T) { keeper, ctx := keepertest.FurnaceKeeper(t) items := createNBurnAmount(keeper, ctx, 10) - for _, item := range items { + for i := range items { + item := items[i] rst, found := keeper.GetBurnAmount(ctx, item.Index, ) diff --git a/x/registry/client/cli/query_domain_ownership_test.go b/x/registry/client/cli/query_domain_ownership_test.go index 746c7066..d9dd748f 100644 --- a/x/registry/client/cli/query_domain_ownership_test.go +++ b/x/registry/client/cli/query_domain_ownership_test.go @@ -49,7 +49,7 @@ func TestShowDomainOwnership(t *testing.T) { common := []string{ fmt.Sprintf("--%s=json", tmcli.OutputFlag), } - for _, tc := range []struct { + tests := []struct { desc string idOwner string @@ -71,7 +71,9 @@ func TestShowDomainOwnership(t *testing.T) { args: common, err: status.Error(codes.NotFound, "not found"), }, - } { + } + for i := range tests { + tc := tests[i] t.Run(tc.desc, func(t *testing.T) { args := []string{ tc.idOwner, diff --git a/x/registry/client/cli/query_second_level_domain_test.go b/x/registry/client/cli/query_second_level_domain_test.go index da652aac..ff88cf36 100644 --- a/x/registry/client/cli/query_second_level_domain_test.go +++ b/x/registry/client/cli/query_second_level_domain_test.go @@ -59,7 +59,7 @@ func TestShowSecondLevelDomain(t *testing.T) { common := []string{ fmt.Sprintf("--%s=json", tmcli.OutputFlag), } - for _, tc := range []struct { + tests := []struct { desc string idName string idParent string @@ -84,7 +84,9 @@ func TestShowSecondLevelDomain(t *testing.T) { args: common, err: status.Error(codes.NotFound, "not found"), }, - } { + } + for i := range tests { + tc := tests[i] t.Run(tc.desc, func(t *testing.T) { args := []string{ tc.idName, diff --git a/x/registry/client/cli/query_top_level_domain_test.go b/x/registry/client/cli/query_top_level_domain_test.go index 2ca72ded..4cba9084 100644 --- a/x/registry/client/cli/query_top_level_domain_test.go +++ b/x/registry/client/cli/query_top_level_domain_test.go @@ -71,7 +71,8 @@ func TestShowTopLevelDomain(t *testing.T) { err: status.Error(codes.NotFound, "not found"), }, } - for _, tc := range tests { + for i := range tests { + tc := tests[i] t.Run(tc.desc, func(t *testing.T) { args := []string{ tc.idName, diff --git a/x/registry/keeper/domain_ownership_test.go b/x/registry/keeper/domain_ownership_test.go index 4cce29dc..5548007d 100644 --- a/x/registry/keeper/domain_ownership_test.go +++ b/x/registry/keeper/domain_ownership_test.go @@ -30,7 +30,8 @@ func createNDomainOwnership(keeper *keeper.Keeper, ctx sdk.Context, n int) []typ func TestDomainOwnershipGet(t *testing.T) { keeper, ctx := keepertest.RegistryKeeper(t) items := createNDomainOwnership(keeper, ctx, 10) - for _, item := range items { + for i := range items { + item := items[i] rst, found := keeper.GetDomainOwnership(ctx, item.Owner, ) diff --git a/x/registry/keeper/second_level_domain_test.go b/x/registry/keeper/second_level_domain_test.go index 534ae87b..5e1b52d9 100644 --- a/x/registry/keeper/second_level_domain_test.go +++ b/x/registry/keeper/second_level_domain_test.go @@ -79,7 +79,8 @@ func registerNSecondLevelDomain(k *keeper.Keeper, ctx sdk.Context, creatorAddr s func TestSecondLevelDomainGet(t *testing.T) { keeper, ctx := keepertest.RegistryKeeper(t) items := createNSecondLevelDomain(keeper, ctx, 10) - for _, item := range items { + for i := range items { + item := items[i] rst, found := keeper.GetSecondLevelDomain(ctx, item.Name, item.Parent, diff --git a/x/registry/keeper/top_level_domain_test.go b/x/registry/keeper/top_level_domain_test.go index 436be675..0e06fab2 100644 --- a/x/registry/keeper/top_level_domain_test.go +++ b/x/registry/keeper/top_level_domain_test.go @@ -52,7 +52,8 @@ func registerNTopLevelDomain(k *keeper.Keeper, ctx sdk.Context, creatorAddr stri func TestTopLevelDomainGet(t *testing.T) { keeper, ctx := keepertest.RegistryKeeper(t) items := createNTopLevelDomain(keeper, ctx, 10) - for _, item := range items { + for i := range items { + item := items[i] rst, found := keeper.GetTopLevelDomain(ctx, item.Name, ) From 79e008b788259857211c601fa13b89920391d922 Mon Sep 17 00:00:00 2001 From: foxytanuki Date: Tue, 19 Dec 2023 21:31:04 +0900 Subject: [PATCH 14/17] Skip errors from gosec --- x/registry/module_simulation.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/x/registry/module_simulation.go b/x/registry/module_simulation.go index e1a61058..c3f2453a 100644 --- a/x/registry/module_simulation.go +++ b/x/registry/module_simulation.go @@ -24,27 +24,27 @@ var ( ) const ( - opWeightMsgUpdateWalletRecord = "op_weight_msg_update_wallet_record" + opWeightMsgUpdateWalletRecord = "op_weight_msg_update_wallet_record" // #nosec G101 // TODO: Determine the simulation weight value defaultWeightMsgUpdateWalletRecord int = 100 - opWeightMsgRegisterSecondLevelDomain = "op_weight_msg_register_domain" + opWeightMsgRegisterSecondLevelDomain = "op_weight_msg_register_domain" // #nosec G101 // TODO: Determine the simulation weight value defaultWeightMsgRegisterSecondLevelDomain int = 100 - opWeightMsgRegisterTopLevelDomain = "op_weight_msg_register_top_level_domain" + opWeightMsgRegisterTopLevelDomain = "op_weight_msg_register_top_level_domain" // #nosec G101 // TODO: Determine the simulation weight value defaultWeightMsgRegisterTopLevelDomain int = 100 - opWeightMsgWithdrawRegistrationFee = "op_weight_msg_withdraw_registration_fee" + opWeightMsgWithdrawRegistrationFee = "op_weight_msg_withdraw_registration_fee" // #nosec G101 // TODO: Determine the simulation weight value defaultWeightMsgWithdrawRegistrationFee int = 100 - opWeightMsgExtendTopLevelDomainExpirationDate = "op_weight_msg_extend_top_level_domain_expiration" + opWeightMsgExtendTopLevelDomainExpirationDate = "op_weight_msg_extend_top_level_domain_expiration" // #nosec G101 // TODO: Determine the simulation weight value defaultWeightMsgExtendTopLevelDomainExpirationDate int = 100 - opWeightMsgUpdateTextRecord = "op_weight_msg_update_text_record" + opWeightMsgUpdateTextRecord = "op_weight_msg_update_text_record" // #nosec G101 // TODO: Determine the simulation weight value defaultWeightMsgUpdateTextRecord int = 100 From 9021b0365e840357350effe43bcc33247e6968a6 Mon Sep 17 00:00:00 2001 From: foxytanuki Date: Tue, 19 Dec 2023 21:40:58 +0900 Subject: [PATCH 15/17] Remove unused from linters --- .golangci.yml | 1 - x/epochs/keeper/msg_server_test.go | 1 + x/registry/keeper/msg_server_test.go | 1 + 3 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index c2274921..57061a5c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -27,7 +27,6 @@ linters: - thelper - unconvert - unparam - - unused issues: exclude-rules: diff --git a/x/epochs/keeper/msg_server_test.go b/x/epochs/keeper/msg_server_test.go index 23233373..d98e3343 100644 --- a/x/epochs/keeper/msg_server_test.go +++ b/x/epochs/keeper/msg_server_test.go @@ -12,6 +12,7 @@ import ( ) func setupMsgServer(tb testing.TB) (types.MsgServer, context.Context) { + tb.Helper() k, ctx := keepertest.EpochsKeeper(tb) return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) } diff --git a/x/registry/keeper/msg_server_test.go b/x/registry/keeper/msg_server_test.go index aae64716..66e24392 100644 --- a/x/registry/keeper/msg_server_test.go +++ b/x/registry/keeper/msg_server_test.go @@ -13,6 +13,7 @@ import ( ) func setupMsgServer(tb testing.TB) (types.MsgServer, keeper.Keeper, context.Context) { + tb.Helper() k, ctx := keepertest.RegistryKeeper(tb) registry.InitGenesis(ctx, *k, *types.DefaultGenesis()) return keeper.NewMsgServerImpl(*k), *k, sdk.WrapSDKContext(ctx) From 213aea2305b74f02165306cad3838c856b8350b9 Mon Sep 17 00:00:00 2001 From: foxytanuki Date: Tue, 19 Dec 2023 21:41:33 +0900 Subject: [PATCH 16/17] Add nolint --- app/app.go | 2 +- x/furnace/keeper/epoch_burn_config_test.go | 2 +- x/registry/keeper/setup_test.go | 2 +- x/resolver/keeper/setup_test.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/app.go b/app/app.go index 6b9accc3..efe53f0f 100644 --- a/app/app.go +++ b/app/app.go @@ -1121,7 +1121,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(minttypes.ModuleName) paramsKeeper.Subspace(distrtypes.ModuleName) paramsKeeper.Subspace(slashingtypes.ModuleName) - paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) + paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govv1.ParamKeyTable()) //nolint:staticcheck paramsKeeper.Subspace(crisistypes.ModuleName) paramsKeeper.Subspace(ibctransfertypes.ModuleName) paramsKeeper.Subspace(ibcexported.ModuleName) diff --git a/x/furnace/keeper/epoch_burn_config_test.go b/x/furnace/keeper/epoch_burn_config_test.go index 2a2db14d..dc9ed518 100644 --- a/x/furnace/keeper/epoch_burn_config_test.go +++ b/x/furnace/keeper/epoch_burn_config_test.go @@ -13,7 +13,7 @@ import ( "github.com/mycel-domain/mycel/x/furnace/types" ) -func createTestEpochBurnConfig(keeper *keeper.Keeper, ctx sdk.Context) types.EpochBurnConfig { +func createTestEpochBurnConfig(keeper *keeper.Keeper, ctx sdk.Context) types.EpochBurnConfig { //nolint:unparam item := types.EpochBurnConfig{} keeper.SetEpochBurnConfig(ctx, item) return item diff --git a/x/registry/keeper/setup_test.go b/x/registry/keeper/setup_test.go index 45f6fc8d..11063150 100644 --- a/x/registry/keeper/setup_test.go +++ b/x/registry/keeper/setup_test.go @@ -71,7 +71,7 @@ func getBankGenesis() *banktypes.GenesisState { makeBalance(testutil.Bob, testutil.BalBob), makeBalance(testutil.Carol, testutil.BalCarol), } - supply := banktypes.Supply{ + supply := banktypes.Supply{ //nolint:staticcheck Total: coins[0].Coins.Add(coins[1].Coins...).Add(coins[2].Coins...), } diff --git a/x/resolver/keeper/setup_test.go b/x/resolver/keeper/setup_test.go index 45f6fc8d..11063150 100644 --- a/x/resolver/keeper/setup_test.go +++ b/x/resolver/keeper/setup_test.go @@ -71,7 +71,7 @@ func getBankGenesis() *banktypes.GenesisState { makeBalance(testutil.Bob, testutil.BalBob), makeBalance(testutil.Carol, testutil.BalCarol), } - supply := banktypes.Supply{ + supply := banktypes.Supply{ //nolint:staticcheck Total: coins[0].Coins.Add(coins[1].Coins...).Add(coins[2].Coins...), } From be2fd346d020cddbc344fd7c78a23db01118aa1c Mon Sep 17 00:00:00 2001 From: foxytanuki Date: Thu, 21 Dec 2023 18:54:43 +0900 Subject: [PATCH 17/17] Fix remaining warnings --- .golangci.yml | 2 +- cmd/myceld/cmd/root.go | 4 +- cmd/myceld/dns/dns.go | 6 +-- cmd/myceld/docs/docs.go | 2 +- .../keeper/query_domain_registration_fee.go | 38 +++++++++---------- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 57061a5c..87fc0d68 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -95,7 +95,7 @@ linters-settings: - name: exported - name: if-return - name: increment-decrement - - name: var-naming + # - name: var-naming - name: var-declaration - name: range - name: receiver-naming diff --git a/cmd/myceld/cmd/root.go b/cmd/myceld/cmd/root.go index 51be9550..1467074d 100644 --- a/cmd/myceld/cmd/root.go +++ b/cmd/myceld/cmd/root.go @@ -160,12 +160,12 @@ func initRootCmd( // add DNS command rootCmd.AddCommand( - dns.DnsCommand(), + dns.Command(), ) // add docs command rootCmd.AddCommand( - docs.DocsCommand(rootCmd), + docs.Command(rootCmd), ) } diff --git a/cmd/myceld/dns/dns.go b/cmd/myceld/dns/dns.go index 69773585..31366033 100644 --- a/cmd/myceld/dns/dns.go +++ b/cmd/myceld/dns/dns.go @@ -19,7 +19,7 @@ type grpcService struct { grpcConn *grpc.ClientConn } -type DnsRecord interface{} +type DnsRecord interface{} //nolint:revive func (s *grpcService) QueryDnsToMycelResolver(domain string, recordType string) (dnsRecord DnsRecord) { domain = strings.Trim(domain, ".") @@ -224,8 +224,8 @@ func RunDnsServer(nodeAddress string, listenPort int) error { return err } -// DnsCommand returns command to start DNS server -func DnsCommand() *cobra.Command { +// Command returns command to start DNS server +func Command() *cobra.Command { cmd := &cobra.Command{ Use: "dns", Short: "Run DNS server", diff --git a/cmd/myceld/docs/docs.go b/cmd/myceld/docs/docs.go index ab3efbd2..d560a7eb 100644 --- a/cmd/myceld/docs/docs.go +++ b/cmd/myceld/docs/docs.go @@ -8,7 +8,7 @@ import ( "github.com/spf13/cobra/doc" ) -func DocsCommand(rootCmd *cobra.Command) *cobra.Command { +func Command(rootCmd *cobra.Command) *cobra.Command { cmd := &cobra.Command{ Use: "docs", Short: "Generate markdowns docs for all myceld commands", diff --git a/x/registry/keeper/query_domain_registration_fee.go b/x/registry/keeper/query_domain_registration_fee.go index 10492829..c31a7f62 100644 --- a/x/registry/keeper/query_domain_registration_fee.go +++ b/x/registry/keeper/query_domain_registration_fee.go @@ -49,24 +49,24 @@ func (k Keeper) DomainRegistrationFee(goCtx context.Context, req *types.QueryDom MaxSubDomainRegistrations: config.MaxSubdomainRegistrations, ErrorMessage: "", }, nil - } else { - // Second level domain - domain := types.SecondLevelDomain{Name: req.Name, Parent: req.Parent} - err := k.ValidateSecondLevelDomainIsRegistrable(ctx, domain) - if err != nil { - return createErrorResponse(err), nil - } - config := k.GetSecondLevelDomainParentsSubdomainConfig(ctx, domain) - fee, err := config.GetRegistrationFee(domain.Name, req.RegistrationPeriodInYear) - if err != nil { - return createErrorResponse(err), nil - } - return &types.QueryDomainRegistrationFeeResponse{ - IsRegistrable: true, - Fee: sdk.NewCoins(fee), - RegistrationPeriodInYear: 1, - MaxSubDomainRegistrations: 0, - ErrorMessage: "", - }, nil } + + // Second level domain + domain := types.SecondLevelDomain{Name: req.Name, Parent: req.Parent} + err := k.ValidateSecondLevelDomainIsRegistrable(ctx, domain) + if err != nil { + return createErrorResponse(err), nil + } + config := k.GetSecondLevelDomainParentsSubdomainConfig(ctx, domain) + fee, err := config.GetRegistrationFee(domain.Name, req.RegistrationPeriodInYear) + if err != nil { + return createErrorResponse(err), nil + } + return &types.QueryDomainRegistrationFeeResponse{ + IsRegistrable: true, + Fee: sdk.NewCoins(fee), + RegistrationPeriodInYear: 1, + MaxSubDomainRegistrations: 0, + ErrorMessage: "", + }, nil }