cosmos-sdk/types/tx_msg.go

39 lines
1.0 KiB
Go
Raw Normal View History

package types
2018-01-06 14:22:21 -08:00
import crypto "github.com/tendermint/go-crypto"
type Msg interface {
// Get some property of the Msg.
Get(key interface{}) (value interface{})
// Get the canonical byte representation of the Msg.
SignBytes() []byte
// ValidateBasic does a simple validation check that
// doesn't require access to any other information.
ValidateBasic() error
// Signers returns the addrs of signers that must sign.
// CONTRACT: All signatures must be present to be valid.
// CONTRACT: Returns addrs in some deterministic order.
2018-01-06 14:22:21 -08:00
Signers() []crypto.Address
}
type Tx interface {
Msg
// Get the canonical byte representation of the Tx.
// Includes any signatures (or empty slots).
TxBytes() []byte
// Signatures returns the signature of signers who signed the Msg.
// CONTRACT: Length returned is same as length of
// pubkeys returned from MsgKeySigners, and the order
// matches.
// CONTRACT: If the signature is missing (ie the Msg is
// invalid), then the corresponding signature is
// .Empty().
Signatures() []StdSignature
}