Skip to content

Commit

Permalink
Revert "convert all module error code 1 to others" (#429)
Browse files Browse the repository at this point in the history
This reverts commit 9695e97.
  • Loading branch information
hanjukim authored Nov 10, 2020
1 parent 4ae926c commit f2b6cd6
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion x/market/internal/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

// Market errors
var (
ErrNoEffectivePrice = sdkerrors.Register(ModuleName, 1, "no price registered with oracle")
ErrInvalidOfferCoin = sdkerrors.Register(ModuleName, 2, "invalid offer coin")
ErrRecursiveSwap = sdkerrors.Register(ModuleName, 3, "recursive swap")
ErrNoEffectivePrice = sdkerrors.Register(ModuleName, 4, "no price registered with oracle")
)
2 changes: 1 addition & 1 deletion x/msgauth/internal/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)

// x/msgauth module sentinel errors
// x/gov module sentinel errors
var (
ErrInvalidPeriod = sdkerrors.Register(ModuleName, 3, "period of authorization should be positive time duration")
ErrInvalidMsgType = sdkerrors.Register(ModuleName, 4, "given msg type is not grantable")
Expand Down
2 changes: 1 addition & 1 deletion x/oracle/internal/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (

// Oracle Errors
var (
ErrUnknowDenom = sdkerrors.Register(ModuleName, 1, "unknown denom")
ErrInvalidExchangeRate = sdkerrors.Register(ModuleName, 2, "invalid exchange rate")
ErrNoPrevote = sdkerrors.Register(ModuleName, 3, "no prevote")
ErrNoVote = sdkerrors.Register(ModuleName, 4, "no vote")
Expand All @@ -21,5 +22,4 @@ var (
ErrNoAggregatePrevote = sdkerrors.Register(ModuleName, 11, "no aggregate prevote")
ErrNoAggregateVote = sdkerrors.Register(ModuleName, 12, "no aggregate vote")
ErrNoTobinTax = sdkerrors.Register(ModuleName, 13, "no tobin tax")
ErrUnknowDenom = sdkerrors.Register(ModuleName, 14, "unknown denom")
)
1 change: 1 addition & 0 deletions x/treasury/alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ const (
var (
// functions aliases
RegisterCodec = types.RegisterCodec
ErrInvalidEpoch = types.ErrInvalidEpoch
NewGenesisState = types.NewGenesisState
DefaultGenesisState = types.DefaultGenesisState
ValidateGenesis = types.ValidateGenesis
Expand Down
11 changes: 11 additions & 0 deletions x/treasury/internal/types/errors.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package types

import (
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)

// x/treasury module sentinel errors
//
var (
ErrInvalidEpoch = sdkerrors.Register(ModuleName, 1, "The query epoch should be between [0, current epoch]")
)
2 changes: 1 addition & 1 deletion x/wasm/internal/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (

// Wasm Errors
var (
ErrStoreCodeFailed = sdkerrors.Register(ModuleName, 1, "store wasm contract failed")
ErrAccountExists = sdkerrors.Register(ModuleName, 2, "contract account already exists")
ErrInstantiateFailed = sdkerrors.Register(ModuleName, 3, "instantiate wasm contract failed")
ErrExecuteFailed = sdkerrors.Register(ModuleName, 4, "execute wasm contract failed")
Expand All @@ -17,5 +18,4 @@ var (
ErrNoRegisteredParser = sdkerrors.Register(ModuleName, 10, "failed to find parser for route")
ErrMigrationFailed = sdkerrors.Register(ModuleName, 11, "migrate wasm contract failed")
ErrNotMigratable = sdkerrors.Register(ModuleName, 12, "the contract is not migratable ")
ErrStoreCodeFailed = sdkerrors.Register(ModuleName, 13, "store wasm contract failed")
)

0 comments on commit f2b6cd6

Please sign in to comment.