Skip to content

Commit

Permalink
Merge pull request #80 from TERITORI/lint-fixes
Browse files Browse the repository at this point in the history
Resolve lint issues
  • Loading branch information
go7066 authored Jan 12, 2024
2 parents 401e458 + 38144e7 commit e43314f
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 14 deletions.
3 changes: 1 addition & 2 deletions app/fee.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ func (dfd DeductFeeDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bo
msgs := tx.GetMsgs()
if len(msgs) == 1 {
msg := msgs[0]
switch msg.(type) {
switch msg := msg.(type) {
case *airdroptypes.MsgClaimAllocation:
msg := msg.(*airdroptypes.MsgClaimAllocation)
signer := msg.GetSigners()[0]
cacheCtx, _ := ctx.CacheContext()
if acc := dfd.ak.GetAccount(ctx, signer); acc == nil {
Expand Down
2 changes: 1 addition & 1 deletion cmd/teritorid/cmd/richest_snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ Example:

for _, delegation := range stakingGen.Delegations {
address := delegation.DelegatorAddress
if excludeAddrs[address] == true {
if excludeAddrs[address] {
continue
}

Expand Down
3 changes: 3 additions & 0 deletions x/airdrop/client/cli/fetch_and_remove_airdrop.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ func saveAllocation(path string, allocations []airdroptypes.AirdropAllocation) {
}

f, err := os.Create(path)
if err != nil {
panic(err)
}
defer f.Close()

if err != nil {
Expand Down
6 changes: 6 additions & 0 deletions x/airdrop/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ func GetTxClaimAllocationCmd() *cobra.Command {
Args: cobra.ExactArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientTxContext(cmd)
if err != nil {
return err
}

msg := types.NewMsgClaimAllocation(
args[0],
Expand Down Expand Up @@ -71,6 +74,9 @@ func GetTxSetAllocationCmd() *cobra.Command {
Args: cobra.ExactArgs(4),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientTxContext(cmd)
if err != nil {
return err
}

amount, err := sdk.ParseCoinNormalized(args[2])
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions x/mint/client/cli/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ func GetTxBurnTokensCmd() *cobra.Command {
Args: cobra.ExactArgs(1),
RunE: func(cmd *cobra.Command, args []string) error {
clientCtx, err := client.GetClientTxContext(cmd)
if err != nil {
return err
}

amount, err := sdk.ParseCoinsNormalized(args[0])
if err != nil {
Expand Down
10 changes: 0 additions & 10 deletions x/mint/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package keeper
import (
"fmt"

"cosmossdk.io/math"
"github.com/cometbft/cometbft/libs/log"

"github.com/TERITORI/teritori-chain/x/mint/types"
Expand Down Expand Up @@ -35,15 +34,6 @@ func (e invalidRatioError) Error() string {
return fmt.Sprintf("mint allocation ratio (%s) is greater than 1", e.ActualRatio)
}

type insufficientDevVestingBalanceError struct {
ActualBalance math.Int
AttemptedDistribution math.Int
}

func (e insufficientDevVestingBalanceError) Error() string {
return fmt.Sprintf("developer vesting balance (%s) is smaller than requested distribution of (%s)", e.ActualBalance, e.AttemptedDistribution)
}

const emptyAddressReceiver = ""

// NewKeeper creates a new mint Keeper instance.
Expand Down
5 changes: 4 additions & 1 deletion x/mint/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ func addressTable() map[string]string {
}`

var addressMap map[string]string
json.Unmarshal([]byte(addressJSON), &addressMap)
err := json.Unmarshal([]byte(addressJSON), &addressMap)
if err != nil {
panic(err)
}
return addressMap
}

Expand Down

0 comments on commit e43314f

Please sign in to comment.