Documentation ¶
Overview ¶
package decoder provides a decoder for Cosmos SDK messages The code has been added from https://github.com/calvinlauyh/cosmosutils which hasn't been updated in many years
Index ¶
- Variables
- func RegisterDefaultInterfaces(interfaceRegistry types.InterfaceRegistry)
- func RegisterInterfaces(registry types.InterfaceRegistry)
- type Amount
- type AuthInfo
- type Bitarray
- type Body
- type CosmosTx
- type Decoder
- type ExtensionData
- func (*ExtensionData) Descriptor() ([]byte, []int)
- func (m *ExtensionData) GetData() []byte
- func (m *ExtensionData) GetProtocolId() string
- func (m *ExtensionData) GetProtocolVersion() string
- func (m *ExtensionData) Marshal() (dAtA []byte, err error)
- func (m *ExtensionData) MarshalTo(dAtA []byte) (int, error)
- func (m *ExtensionData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ExtensionData) ProtoMessage()
- func (m *ExtensionData) Reset()
- func (m *ExtensionData) Size() (n int)
- func (m *ExtensionData) String() string
- func (m *ExtensionData) Unmarshal(dAtA []byte) error
- func (m *ExtensionData) XXX_DiscardUnknown()
- func (m *ExtensionData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ExtensionData) XXX_Merge(src proto.Message)
- func (m *ExtensionData) XXX_MessageName() string
- func (m *ExtensionData) XXX_Size() int
- func (m *ExtensionData) XXX_Unmarshal(b []byte) error
- type Fee
- type Message
- type ModeInfo
- type Multi
- type PublicKey
- type SignerInfo
- type SignerInfoPublicKey
- type Single
- type SingleModeInfo
- type Tx
- type TxExtensionOptionI
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidLengthExtensions = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowExtensions = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupExtensions = fmt.Errorf("proto: unexpected end of group") )
View Source
var DefaultDecoder = NewDecoder().RegisterInterfaces(RegisterDefaultInterfaces)
DefaultDecoder is a decoder with all Cosmos builtin modules interfaces registered
Functions ¶
func RegisterDefaultInterfaces ¶
func RegisterDefaultInterfaces(interfaceRegistry types.InterfaceRegistry)
func RegisterInterfaces ¶
func RegisterInterfaces(registry types.InterfaceRegistry)
Types ¶
type AuthInfo ¶
type AuthInfo struct { SignerInfos []SignerInfo `json:"signer_infos"` Fee Fee `json:"fee"` }
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
func (*Decoder) DecodeBase64 ¶
Decode decodes the base64-encoded transaction bytes to Tx
func (*Decoder) RegisterInterfaces ¶
func (decoder *Decoder) RegisterInterfaces(registry func(registry codectypes.InterfaceRegistry)) *Decoder
RegisterInterfaces register decoding interface to the decoder by using the provided interface registry.
type ExtensionData ¶
type ExtensionData struct { // protocol_id is the identifier of the protocol // the field is not used internally but it is validated for correctness ProtocolId string `protobuf:"bytes,1,opt,name=protocol_id,json=protocolId,proto3" json:"protocol_id,omitempty"` // protocol_version is the identifier of the protocol version // the field is not used internally but it is validated for correctness ProtocolVersion string `protobuf:"bytes,2,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"` // arbitrary bytes data that can be used to store any data // the field is not used internally but it is validated and must be provided Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` }
ExtensionData is a data structure that can be used in transaction extensions.
func (*ExtensionData) Descriptor ¶
func (*ExtensionData) Descriptor() ([]byte, []int)
func (*ExtensionData) GetData ¶
func (m *ExtensionData) GetData() []byte
func (*ExtensionData) GetProtocolId ¶
func (m *ExtensionData) GetProtocolId() string
func (*ExtensionData) GetProtocolVersion ¶
func (m *ExtensionData) GetProtocolVersion() string
func (*ExtensionData) Marshal ¶
func (m *ExtensionData) Marshal() (dAtA []byte, err error)
func (*ExtensionData) MarshalToSizedBuffer ¶
func (m *ExtensionData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ExtensionData) ProtoMessage ¶
func (*ExtensionData) ProtoMessage()
func (*ExtensionData) Reset ¶
func (m *ExtensionData) Reset()
func (*ExtensionData) Size ¶
func (m *ExtensionData) Size() (n int)
func (*ExtensionData) String ¶
func (m *ExtensionData) String() string
func (*ExtensionData) Unmarshal ¶
func (m *ExtensionData) Unmarshal(dAtA []byte) error
func (*ExtensionData) XXX_DiscardUnknown ¶
func (m *ExtensionData) XXX_DiscardUnknown()
func (*ExtensionData) XXX_Marshal ¶
func (m *ExtensionData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ExtensionData) XXX_Merge ¶
func (m *ExtensionData) XXX_Merge(src proto.Message)
func (*ExtensionData) XXX_MessageName ¶
func (m *ExtensionData) XXX_MessageName() string
func (*ExtensionData) XXX_Size ¶
func (m *ExtensionData) XXX_Size() int
func (*ExtensionData) XXX_Unmarshal ¶
func (m *ExtensionData) XXX_Unmarshal(b []byte) error
type Multi ¶
type Multi struct { Bitarray Bitarray `json:"bitarray"` ModeInfos []SingleModeInfo `json:"mode_infos"` }
type SignerInfo ¶
type SignerInfo struct { PublicKey SignerInfoPublicKey `json:"public_key"` ModeInfo ModeInfo `json:"mode_info"` Sequence string `json:"sequence"` }
type SignerInfoPublicKey ¶
type SingleModeInfo ¶
type SingleModeInfo struct {
Single Single `json:"single"`
}
type Tx ¶
type Tx struct { cosmostypes.Tx // contains filtered or unexported fields }
func (*Tx) MarshalToJSON ¶
type TxExtensionOptionI ¶
type TxExtensionOptionI interface{}
Click to show internal directories.
Click to hide internal directories.