From f2b6cd640af64014fed8cbcb3a481173e64f9cad Mon Sep 17 00:00:00 2001 From: Paul Kim Date: Tue, 10 Nov 2020 22:26:37 +0900 Subject: [PATCH] Revert "convert all module error code 1 to others" (#429) This reverts commit 9695e97a7a0b191b7e51404ef1439b74c66a0d23. --- x/market/internal/types/errors.go | 2 +- x/msgauth/internal/types/errors.go | 2 +- x/oracle/internal/types/errors.go | 2 +- x/treasury/alias.go | 1 + x/treasury/internal/types/errors.go | 11 +++++++++++ x/wasm/internal/types/errors.go | 2 +- 6 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 x/treasury/internal/types/errors.go diff --git a/x/market/internal/types/errors.go b/x/market/internal/types/errors.go index e5434f814..cddbb3046 100644 --- a/x/market/internal/types/errors.go +++ b/x/market/internal/types/errors.go @@ -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") ) diff --git a/x/msgauth/internal/types/errors.go b/x/msgauth/internal/types/errors.go index 647ad8488..b96d8aa7d 100644 --- a/x/msgauth/internal/types/errors.go +++ b/x/msgauth/internal/types/errors.go @@ -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") diff --git a/x/oracle/internal/types/errors.go b/x/oracle/internal/types/errors.go index b22df1e6d..23896804c 100644 --- a/x/oracle/internal/types/errors.go +++ b/x/oracle/internal/types/errors.go @@ -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") @@ -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") ) diff --git a/x/treasury/alias.go b/x/treasury/alias.go index b54ab26a0..68ead9ff8 100644 --- a/x/treasury/alias.go +++ b/x/treasury/alias.go @@ -29,6 +29,7 @@ const ( var ( // functions aliases RegisterCodec = types.RegisterCodec + ErrInvalidEpoch = types.ErrInvalidEpoch NewGenesisState = types.NewGenesisState DefaultGenesisState = types.DefaultGenesisState ValidateGenesis = types.ValidateGenesis diff --git a/x/treasury/internal/types/errors.go b/x/treasury/internal/types/errors.go new file mode 100644 index 000000000..75ba37d6f --- /dev/null +++ b/x/treasury/internal/types/errors.go @@ -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]") +) diff --git a/x/wasm/internal/types/errors.go b/x/wasm/internal/types/errors.go index 682bfc343..322d24270 100644 --- a/x/wasm/internal/types/errors.go +++ b/x/wasm/internal/types/errors.go @@ -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") @@ -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") )