Documentation ¶
Index ¶
- Variables
- func RejectUnknownFields(bz []byte, desc protoreflect.MessageDescriptor, allowUnknownNonCriticals bool, ...) (hasUnknownNonCriticals bool, err error)
- func RejectUnknownFieldsStrict(bz []byte, msg protoreflect.MessageDescriptor, resolver protodesc.Resolver) error
- func WireTypeToString(wt protowire.Type) string
- type DecodedTx
- type Decoder
- type Options
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTxDecode is returned if we cannot parse a transaction ErrTxDecode = errors.Register(txCodespace, 1, "tx parse error") ErrUnknownField = errors.Register(txCodespace, 2, "unknown protobuf field") )
Functions ¶
func RejectUnknownFields ¶
func RejectUnknownFields(bz []byte, desc protoreflect.MessageDescriptor, allowUnknownNonCriticals bool, resolver protodesc.Resolver) (hasUnknownNonCriticals bool, err error)
RejectUnknownFields rejects any bytes bz with an error that has unknown fields for the provided proto.Message type with an option to allow non-critical fields (specified as those fields with bit 11) to pass through. In either case, the hasUnknownNonCriticals will be set to true if non-critical fields were encountered during traversal. This flag can be used to treat a message with non-critical field different in different security contexts (such as transaction signing). This function traverses inside of messages nested via google.protobuf.Any. It does not do any deserialization of the proto.Message. An AnyResolver must be provided for traversing inside google.protobuf.Any's.
func RejectUnknownFieldsStrict ¶
func RejectUnknownFieldsStrict(bz []byte, msg protoreflect.MessageDescriptor, resolver protodesc.Resolver) error
RejectUnknownFieldsStrict operates by the same rules as RejectUnknownFields, but returns an error if any unknown non-critical fields are encountered.
func WireTypeToString ¶
WireTypeToString returns a string representation of the given protowire.Type.
Types ¶
type DecodedTx ¶ added in v0.5.1
type DecodedTx struct { Messages []proto.Message Tx *v1beta1.Tx TxRaw *v1beta1.TxRaw Signers [][]byte TxBodyHasUnknownNonCriticals bool }
DecodedTx contains the decoded transaction, its signers, and other flags.
type Decoder ¶ added in v0.5.1
type Decoder struct {
// contains filtered or unexported fields
}
Decoder contains the dependencies required for decoding transactions.
func NewDecoder ¶ added in v0.5.1
NewDecoder creates a new Decoder for decoding transactions.