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

correct error types #542

Merged
merged 1 commit into from
Oct 25, 2022
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
2 changes: 1 addition & 1 deletion x/asset/keeper/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ func (k Keeper) AddAppRecords(ctx sdk.Context, msg types.AppData) error {
}

if !IsLetter(msg.Name) || len(msg.Name) > 10 {
return types.ErrorNameDidNotMeetCriterion
return types.ErrorAppNameDidNotMeetCriterion
}

if msg.MinGovDeposit.LT(sdk.ZeroInt()) {
Expand Down
2 changes: 1 addition & 1 deletion x/asset/keeper/pairs_vault.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func (k Keeper) WasmAddExtendedPairsVaultRecords(ctx sdk.Context, pairVaultBindi
IsLetter := regexp.MustCompile(`^[A-Z-]+$`).MatchString

if !IsLetter(pairVaultBinding.PairName) {
return types.ErrorNameDidNotMeetCriterion
return types.ErrorPairNameDidNotMeetCriterion
}

id := k.GetPairsVaultID(ctx)
Expand Down
6 changes: 4 additions & 2 deletions x/asset/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@ var (
ErrorFeeShouldNotBeGTOne = errors.Register(ModuleName, 215, "Fee Should Not Be Greater than One and less than zero")
ErrorExtendedPairDoesNotExistForTheApp = errors.Register(ModuleName, 216, "extended pair does not exist for the app")
ErrorMinGovDepositIsZero = errors.Register(ModuleName, 217, "min gov deposit is zero")
ErrorShortNameDidNotMeetCriterion = errors.Register(ModuleName, 218, "App ShortName did't meet the criterion")
ErrorNameDidNotMeetCriterion = errors.Register(ModuleName, 219, "Asset Name did't meet the criterion")
ErrorShortNameDidNotMeetCriterion = errors.Register(ModuleName, 218, "App ShortName didn't meet the criterion")
ErrorNameDidNotMeetCriterion = errors.Register(ModuleName, 219, "Asset Name didn't meet the criterion")
ErrorReversePairAlreadyExist = errors.Register(ModuleName, 220, "Reverse pair already exists")
ErrorValueCantBeNegative = errors.Register(ModuleName, 221, "Value can't be negative")
ErrorAppNameDidNotMeetCriterion = errors.Register(ModuleName, 222, "App Name didn't meet the criterion")
ErrorPairNameDidNotMeetCriterion = errors.Register(ModuleName, 223, "Pair Name didn't meet the criterion")
)

var (
Expand Down