Skip to content

Commit

Permalink
Merge pull request #1649 from aelesbao/aelesbao/fix/propagate-funds-err
Browse files Browse the repository at this point in the history
fix: propagate funds validation errors
  • Loading branch information
alpe authored Oct 5, 2023
2 parents e0da419 + 6b8b45c commit 3ea8575
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions x/wasm/types/tx.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ func (msg MsgInstantiateContract) ValidateBasic() error {
return errorsmod.Wrap(err, "label")
}

if !msg.Funds.IsValid() {
return sdkerrors.ErrInvalidCoins
if err := msg.Funds.Validate(); err != nil {
return errorsmod.Wrap(err, "funds")
}

if len(msg.Admin) != 0 {
Expand Down Expand Up @@ -142,8 +142,8 @@ func (msg MsgExecuteContract) ValidateBasic() error {
return errorsmod.Wrap(err, "contract")
}

if !msg.Funds.IsValid() {
return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, "sentFunds")
if err := msg.Funds.Validate(); err != nil {
return errorsmod.Wrap(err, "funds")
}
if err := msg.Msg.ValidateBasic(); err != nil {
return errorsmod.Wrap(err, "payload msg")
Expand Down Expand Up @@ -336,8 +336,8 @@ func (msg MsgInstantiateContract2) ValidateBasic() error {
return errorsmod.Wrap(err, "label")
}

if !msg.Funds.IsValid() {
return sdkerrors.ErrInvalidCoins
if err := msg.Funds.Validate(); err != nil {
return errorsmod.Wrap(err, "funds")
}

if len(msg.Admin) != 0 {
Expand Down Expand Up @@ -537,8 +537,8 @@ func (msg MsgStoreAndInstantiateContract) ValidateBasic() error {
return errorsmod.Wrap(err, "label")
}

if !msg.Funds.IsValid() {
return sdkerrors.ErrInvalidCoins
if err := msg.Funds.Validate(); err != nil {
return errorsmod.Wrap(err, "funds")
}

if len(msg.Admin) != 0 {
Expand Down

0 comments on commit 3ea8575

Please sign in to comment.