Skip to content

Commit

Permalink
chore: apply comment
Browse files Browse the repository at this point in the history
  • Loading branch information
Woosang Son committed Mar 29, 2021
1 parent 99a776f commit 34b5d90
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 28 deletions.
7 changes: 0 additions & 7 deletions .releaserc

This file was deleted.

15 changes: 0 additions & 15 deletions errors/errors.go

This file was deleted.

1 change: 1 addition & 0 deletions x/coin/internal/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ var (
ErrSendDisabled = sdkerrors.Register(Codespace, 4, "send transactions are disabled")
ErrCanNotTransferToBlacklisted = sdkerrors.Register(Codespace, 5, "Cannot transfer to safety box addresses")
ErrRequestGetsLimit = sdkerrors.Register(Codespace, 6, "the gets should be limited")
ErrInvalidDenom = sdkerrors.Register(Codespace, 7, "invalid denom")
)
3 changes: 1 addition & 2 deletions x/coin/internal/types/msgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/line/lbm-sdk/v2/errors"
)

const RouterKey = ModuleName
Expand Down Expand Up @@ -196,7 +195,7 @@ func ValidateInputsOutputs(inputs []Input, outputs []Output) error {
func validateDenomination(coins sdk.Coins) error {
for _, coin := range coins {
if err := ValidateSymbolReserved(coin.Denom); err != nil {
return sdkerrors.Wrapf(errors.ErrInvalidDenom, "invalid denom [%s] send message supports 3~5 length denom only", coin.Denom)
return sdkerrors.Wrapf(ErrInvalidDenom, "invalid denom [%s] send message supports 3~5 length denom only", coin.Denom)
}
}
return nil
Expand Down
1 change: 1 addition & 0 deletions x/collection/internal/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ var (
ErrCompositionTooDeep = sdkerrors.Register(ModuleName, 45, "cannot attach token (composition too deep)")
ErrCompositionTooWide = sdkerrors.Register(ModuleName, 46, "cannot attach token (composition too wide)")
ErrBurnNonRootNFT = sdkerrors.Register(ModuleName, 47, "cannot burn non-root NFTs")
ErrInvalidPermissionAction = sdkerrors.Register(ModuleName, 48, "invalid permission action")
)

func WrapIfOverflowPanic(r interface{}) error {
Expand Down
4 changes: 2 additions & 2 deletions x/collection/internal/types/msgs_perm.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/line/lbm-sdk/v2/errors"
"github.com/line/lbm-sdk/v2/x/contract"
)

Expand Down Expand Up @@ -91,5 +90,6 @@ func validateAction(action string, actions ...string) error {
return nil
}
}
return sdkerrors.Wrap(errors.ErrInvalidPermission, fmt.Sprintf("permission should be one of [%s]", strings.Join(actions, ",")))
return sdkerrors.Wrap(ErrInvalidPermissionAction,
fmt.Sprintf("permission action should be one of [%s]", strings.Join(actions, ",")))
}
1 change: 1 addition & 0 deletions x/token/internal/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ var (
ErrApproverProxySame = sdkerrors.Register(ModuleName, 22, "approver is same with proxy")
ErrTokenNotApproved = sdkerrors.Register(ModuleName, 23, "proxy is not approved on the token")
ErrTokenAlreadyApproved = sdkerrors.Register(ModuleName, 24, "proxy is already approved on the token")
ErrInvalidPermissionAction = sdkerrors.Register(ModuleName, 25, "invalid permission action")
)

func WrapIfOverflowPanic(r interface{}) error {
Expand Down
4 changes: 2 additions & 2 deletions x/token/internal/types/msgs_perm.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (

sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/line/lbm-sdk/v2/errors"
"github.com/line/lbm-sdk/v2/x/contract"
)

Expand Down Expand Up @@ -91,5 +90,6 @@ func validateAction(action string, actions ...string) error {
return nil
}
}
return sdkerrors.Wrap(errors.ErrInvalidPermission, fmt.Sprintf("permission should be one of [%s]", strings.Join(actions, ",")))
return sdkerrors.Wrap(ErrInvalidPermissionAction,
fmt.Sprintf("permission action should be one of [%s]", strings.Join(actions, ",")))
}

0 comments on commit 34b5d90

Please sign in to comment.