Documentation ¶
Index ¶
Constants ¶
MaxDurationSeconds the maximum number of seconds (when expressed as nanoseconds) which can fit in an int64. gogoproto encodes google.protobuf.Duration as a time.Duration, which is 64-bit signed integer.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder is a JSON encoder that uses the Amino JSON encoding rules for protobuf messages.
func NewAminoJSON ¶
func NewAminoJSON() Encoder
NewAminoJSON returns a new Encoder capable of serializing protobuf messages to JSON using the Amino JSON encoding rules.
func (Encoder) DefineFieldEncoding ¶
func (enc Encoder) DefineFieldEncoding(name string, encoder FieldEncoder) Encoder
DefineFieldEncoding defines a custom encoding for a protobuf field. The `name` field must match a usage of an (amino.encoding) option in the protobuf message as in the following example. This encoding will be used instead of the default encoding for all usages of the tagged field.
message Balance { repeated cosmos.base.v1beta1.Coin coins = 2 [ (amino.encoding) = "legacy_coins", (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", (gogoproto.nullable) = false, (amino.dont_omitempty) = true ]; ... }
func (Encoder) DefineMessageEncoding ¶
func (enc Encoder) DefineMessageEncoding(name string, encoder MessageEncoder) Encoder
DefineMessageEncoding defines a custom encoding for a protobuf message. The `name` field must match a usage of an (amino.message_encoding) option in the protobuf message as in the following example. This encoding will be used instead of the default encoding for all usages of the tagged message.
message ModuleAccount { option (amino.name) = "cosmos-sdk/ModuleAccount"; option (amino.message_encoding) = "module_account"; ... }
type FieldEncoder ¶
FieldEncoder is a function that can encode a protobuf protoreflect.Value to JSON.
type MessageEncoder ¶
MessageEncoder is a function that can encode a protobuf protoreflect.Message to JSON.
type SignModeHandler ¶ added in v0.5.1
type SignModeHandler struct {
// contains filtered or unexported fields
}
SignModeHandler implements the SIGN_MODE_LEGACY_AMINO_JSON signing mode.
func NewSignModeHandler ¶ added in v0.5.1
func NewSignModeHandler(options SignModeHandlerOptions) *SignModeHandler
NewSignModeHandler returns a new SignModeHandler.
func (SignModeHandler) GetSignBytes ¶ added in v0.5.1
func (h SignModeHandler) GetSignBytes(_ context.Context, signerData signing.SignerData, txData signing.TxData) ([]byte, error)
GetSignBytes implements the GetSignBytes method of the SignModeHandler interface.
func (SignModeHandler) Mode ¶ added in v0.5.1
func (h SignModeHandler) Mode() signingv1beta1.SignMode
Mode implements the Mode method of the SignModeHandler interface.
type SignModeHandlerOptions ¶ added in v0.5.1
type SignModeHandlerOptions struct { FileResolver protodesc.Resolver TypeResolver protoregistry.MessageTypeResolver Encoder *Encoder }
SignModeHandlerOptions are the options for the SignModeHandler.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
aminojsonpb
Code generated by protoc-gen-go-pulsar.
|
Code generated by protoc-gen-go-pulsar. |
testpb
Code generated by protoc-gen-go-pulsar.
|
Code generated by protoc-gen-go-pulsar. |