Update utility functions to check empty and return consistent errors #1245
Labels
Scope: x/ecocredit
Issues that update the x/ecocredit module
Type: Refactor
A code change that neither fixes a bug nor adds a feature
Summary
Ref: #1233 (comment)
Currently we check for an empty string inside basic message validation for credit class, project id, batch denom, etc. We should check for empty string within the validation functions defined in
utils.go
. We should also make sure we are returning consistent errors for these validation functions, i.e. all should include the expected format and consistent sdk errors.Problem Definition
We are duplicating a lot of empty string checks in message validation and returning inconsistent errors and errors that could provide more information about the expected format.
Proposal
Add empty string checks for validation functions in
utils.go
(for core, basket, and marketplace) and remove the empty string checks in basic message validation. Also make sure all errors returned include the expected format within an sdk error.For Admin Use
The text was updated successfully, but these errors were encountered: