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

update error code. #146

Merged
merged 1 commit into from
Jul 30, 2020
Merged
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
21 changes: 20 additions & 1 deletion types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ package types
import sdkTypes "github.com/cosmos/cosmos-sdk/types"

const (

// Kyc
CodeNotKyc sdkTypes.CodeType = 1000
CodeKycDuplicated sdkTypes.CodeType = 1001
CodeReceicerNotKyc sdkTypes.CodeType = 1002

// Token
CodeTokenDuplicated sdkTypes.CodeType = 2001
CodeTokenInvalidSymbol sdkTypes.CodeType = 2002
Expand Down Expand Up @@ -45,6 +51,19 @@ func newErrorWithMXWCodespace(code sdkTypes.CodeType, format string, args ...int
return sdkTypes.NewError(CodespaceMXW, code, format, args...)
}

// --- Kyc errors
func ErrNotKyc() sdkTypes.Error {
return newErrorWithMXWCodespace(CodeNotKyc, "All signers must pass kyc.")
}

func ErrKycDuplicated() sdkTypes.Error {
return newErrorWithMXWCodespace(CodeKycDuplicated, "Kyc Address duplicated.")
}

func ErrReceiverNotKyc() sdkTypes.Error {
return newErrorWithMXWCodespace(CodeReceicerNotKyc, "Receiver kyc is required.")
}

/// --- Fee errors
func ErrFeeSettingNotExists(feeName string) sdkTypes.Error {
return newErrorWithMXWCodespace(CodeFeeNotFound, "Fee setting in not valid: %s", feeName)
Expand Down Expand Up @@ -140,7 +159,7 @@ func ErrInvalidEndorser() sdkTypes.Error {
return newErrorWithMXWCodespace(CodeTokenInvalidEndorser, "Token item endorser invalid.")
}

func ErrTokenItemFronzen() sdkTypes.Error {
func ErrTokenItemFrozen() sdkTypes.Error {
return newErrorWithMXWCodespace(CodeTokenItemFrozen, "Token item frozen.")
}
func ErrTokenItemNotModifiable() sdkTypes.Error {
Expand Down