Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Refactor: Improve error messages and type annotations in wasm types #2172

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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/wasm/types/errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ var (
// ErrInvalidMsg error when we cannot process the error returned from the contract
ErrInvalidMsg = errorsmod.Register(DefaultCodespace, 10, "invalid CosmosMsg from the contract")

// ErrMigrationFailed error for rust execution contract failure
// ErrMigrationFailed error for rust migration contract failure
ErrMigrationFailed = errorsmod.Register(DefaultCodespace, 11, "migrate wasm contract failed")

// ErrEmpty error for empty content
Expand Down
4 changes: 2 additions & 2 deletions x/wasm/types/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
)

var AllAccessTypes = []AccessType{
var AllAccessTypes []AccessType = []AccessType{
AccessTypeNobody,
AccessTypeAnyOfAddresses,
AccessTypeEverybody,
Expand Down Expand Up @@ -101,7 +101,7 @@ func (p Params) String() string {
// ValidateBasic performs basic validation on wasm parameters
func (p Params) ValidateBasic() error {
if err := validateAccessType(p.InstantiateDefaultPermission); err != nil {
return errors.Wrap(err, "instantiate default permission")
return errorsmod.Wrap(err, "instantiate default permission")
}
if err := p.CodeUploadAccess.ValidateBasic(); err != nil {
return errors.Wrap(err, "upload access")
Expand Down