feat: optional validate basic (#15735)

This commit is contained in:
Julien Robert
2023-04-07 13:13:15 +00:00
committed by GitHub
parent ee70c1475d
commit df161c214c
18 changed files with 76 additions and 46 deletions
+6 -1
View File
@@ -40,7 +40,12 @@ func GenerateOrBroadcastTxWithFactory(clientCtx client.Context, txf Factory, msg
// Right now, we're factorizing that call inside this function.
// ref: https://github.com/cosmos/cosmos-sdk/pull/9236#discussion_r623803504
for _, msg := range msgs {
if err := msg.ValidateBasic(); err != nil {
m, ok := msg.(sdk.HasValidateBasic)
if !ok {
continue
}
if err := m.ValidateBasic(); err != nil {
return err
}
}