Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve lint issues #80

Merged
merged 1 commit into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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