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
+11 -8
View File
@@ -16,10 +16,6 @@ type (
Msg interface {
proto.Message
// ValidateBasic does a simple validation check that
// doesn't require access to any other information.
ValidateBasic() error
// GetSigners returns the addrs of signers that must sign.
// CONTRACT: All signatures must be present to be valid.
// CONTRACT: Returns addrs in some deterministic order.
@@ -42,12 +38,10 @@ type (
// Tx defines the interface a transaction must fulfill.
Tx interface {
HasValidateBasic
// GetMsgs gets the all the transaction's messages.
GetMsgs() []Msg
// ValidateBasic does a simple and lightweight validation check that doesn't
// require access to any other information.
ValidateBasic() error
}
// FeeTx defines the interface to be implemented by Tx to use the FeeDecorators
@@ -72,6 +66,15 @@ type (
GetTimeoutHeight() uint64
}
// HasValidateBasic defines a type that has a ValidateBasic method.
// ValidateBasic is deprecated and now facultative.
// Prefer validating messages directly in the msg server.
HasValidateBasic interface {
// ValidateBasic does a simple validation check that
// doesn't require access to any other information.
ValidateBasic() error
}
)
// TxDecoder unmarshals transaction bytes