Skip to content

Commit 3ea8575

Browse files
authored
Merge pull request #1649 from aelesbao/aelesbao/fix/propagate-funds-err
fix: propagate funds validation errors
2 parents e0da419 + 6b8b45c commit 3ea8575

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

x/wasm/types/tx.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,8 @@ func (msg MsgInstantiateContract) ValidateBasic() error {
103103
return errorsmod.Wrap(err, "label")
104104
}
105105

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

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

145-
if !msg.Funds.IsValid() {
146-
return errorsmod.Wrap(sdkerrors.ErrInvalidCoins, "sentFunds")
145+
if err := msg.Funds.Validate(); err != nil {
146+
return errorsmod.Wrap(err, "funds")
147147
}
148148
if err := msg.Msg.ValidateBasic(); err != nil {
149149
return errorsmod.Wrap(err, "payload msg")
@@ -336,8 +336,8 @@ func (msg MsgInstantiateContract2) ValidateBasic() error {
336336
return errorsmod.Wrap(err, "label")
337337
}
338338

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

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

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

544544
if len(msg.Admin) != 0 {

0 commit comments

Comments
 (0)