From ef7d0a3e38a5a502e4d7cefe609b8d97b23810ae Mon Sep 17 00:00:00 2001 From: expertdicer Date: Tue, 2 Apr 2024 21:29:07 +0700 Subject: [PATCH] lint --- app/fork_test.go | 32 +++++++++++------------ app/forks.go | 9 ++++--- x/asset/keeper/msg_server_create_token.go | 1 - 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/app/fork_test.go b/app/fork_test.go index bd2c0bb2..80ee371d 100644 --- a/app/fork_test.go +++ b/app/fork_test.go @@ -73,7 +73,6 @@ func TestFork(t *testing.T) { vals := stakingKeeper.GetUnbondingValidators(ctx, timeKey, ForkHeight) require.Equal(t, vals[0], duplicativeVal.OperatorAddress) - } func checkDuplicateUBDQueue(ctx sdk.Context, realio RealioNetwork) bool { @@ -91,13 +90,13 @@ func checkDuplicateUBDQueue(ctx sdk.Context, realio RealioNetwork) bool { return false } -func checkDuplicateUBD(eles []stakingtypes.DVPair) bool { - unique_eles := map[string]bool{} - for _, ele := range eles { - unique_eles[ele.String()] = true +func checkDuplicateUBD(eels []stakingtypes.DVPair) bool { + unique_eels := map[string]bool{} + for _, ele := range eels { + unique_eels[ele.String()] = true } - return len(unique_eles) != len(eles) + return len(unique_eels) != len(eels) } func checkDuplicateRelegationQueue(ctx sdk.Context, realio RealioNetwork) bool { @@ -115,13 +114,13 @@ func checkDuplicateRelegationQueue(ctx sdk.Context, realio RealioNetwork) bool { return false } -func checkDuplicateRedelegation(eles []stakingtypes.DVVTriplet) bool { - unique_eles := map[string]bool{} - for _, ele := range eles { - unique_eles[ele.String()] = true +func checkDuplicateRedelegation(eels []stakingtypes.DVVTriplet) bool { + unique_eels := map[string]bool{} + for _, ele := range eels { + unique_eels[ele.String()] = true } - return len(unique_eles) != len(eles) + return len(unique_eels) != len(eels) } func checkDuplicateValQueue(ctx sdk.Context, realio RealioNetwork) bool { @@ -138,11 +137,12 @@ func checkDuplicateValQueue(ctx sdk.Context, realio RealioNetwork) bool { } return false } -func checkDuplicateValAddr(eles []string) bool { - unique_eles := map[string]bool{} - for _, ele := range eles { - unique_eles[ele] = true + +func checkDuplicateValAddr(eels []string) bool { + unique_eels := map[string]bool{} + for _, ele := range eels { + unique_eels[ele] = true } - return len(unique_eles) != len(eles) + return len(unique_eels) != len(eels) } diff --git a/app/forks.go b/app/forks.go index eb4051d9..4f4640b1 100644 --- a/app/forks.go +++ b/app/forks.go @@ -8,8 +8,10 @@ import ( stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" ) -var ForkHeight = int64(5989487) -var oneEnternityLater = time.Date(9999, 9, 9, 9, 9, 9, 9, time.UTC) +var ( + ForkHeight = int64(5989487) + oneEnternityLater = time.Date(9999, 9, 9, 9, 9, 9, 9, time.UTC) +) // ScheduleForkUpgrade executes any necessary fork logic for based upon the current // block height and chain ID (mainnet or testnet). It sets an upgrade plan once @@ -77,7 +79,6 @@ func removeDuplicateValueRedelegationQueueKey(app *RealioNetwork, ctx sdk.Contex store.Set(redelegationTimesliceIterator.Key(), bz) } - } func removeDuplicateDVVTriplets(triplets []stakingtypes.DVVTriplet) []stakingtypes.DVVTriplet { @@ -115,7 +116,7 @@ func removeDuplicateUnbondingValidator(app *RealioNetwork, ctx sdk.Context) { } unique_addrs := []string{} - for valAddr, _ := range vals { + for valAddr := range vals { unique_addrs = append(unique_addrs, valAddr) } sort.Strings(unique_addrs) diff --git a/x/asset/keeper/msg_server_create_token.go b/x/asset/keeper/msg_server_create_token.go index ae24c8d1..90f2290e 100644 --- a/x/asset/keeper/msg_server_create_token.go +++ b/x/asset/keeper/msg_server_create_token.go @@ -59,7 +59,6 @@ func (k msgServer) CreateToken(goCtx context.Context, msg *types.MsgCreateToken) coin := sdk.Coins{{Denom: baseDenom, Amount: canonicalAmount}} err = k.bankKeeper.MintCoins(ctx, types.ModuleName, coin) - if err != nil { panic(err) }