govcodec

package
v0.0.0-...-8551cdf Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2020 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthCodec        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowCodec          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupCodec = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	Gov_Cdc = NewGovCodec(gov.Amino)
)

Functions

This section is empty.

Types

type Codec

type Codec struct {
	codec.Marshaler
	// contains filtered or unexported fields
}

func NewAppCodec

func NewAppCodec(amino *codec.Codec) *Codec

func NewGovCodec

func NewGovCodec(amino *codec.Codec) *Codec

func (*Codec) MarshalProposal

func (c *Codec) MarshalProposal(p gov.Proposal) ([]byte, error)

MarshalProposal marshals a Proposal. It accepts a Proposal defined by the x/gov module and uses the application-level Proposal type which has the concrete Content implementation to serialize.

func (*Codec) UnmarshalProposal

func (c *Codec) UnmarshalProposal(bz []byte) (gov.Proposal, error)

UnmarshalProposal decodes a Proposal defined by the x/gov module and uses the application-level Proposal type which has the concrete Content implementation to deserialize.

type CodecContent

type CodecContent struct {
	// sum defines a set of all acceptable concrete governance proposal Content types.
	//
	// Types that are valid to be assigned to Sum:
	//	*CodecContent_Text
	//	*CodecContent_ParameterChange
	Sum isCodecContent_Sum `protobuf_oneof:"sum"`
}

Content defines the application-level allowed Content to be included in a governance proposal.

func (*CodecContent) Descriptor

func (*CodecContent) Descriptor() ([]byte, []int)

func (*CodecContent) Equal

func (this *CodecContent) Equal(that interface{}) bool

func (*CodecContent) GetContent

func (*CodecContent) GetParameterChange

func (m *CodecContent) GetParameterChange() *proposal.ParameterChangeProposal

func (*CodecContent) GetSum

func (m *CodecContent) GetSum() isCodecContent_Sum

func (*CodecContent) GetText

func (m *CodecContent) GetText() *types.TextProposal

func (*CodecContent) Marshal

func (m *CodecContent) Marshal() (dAtA []byte, err error)

func (*CodecContent) MarshalTo

func (m *CodecContent) MarshalTo(dAtA []byte) (int, error)

func (*CodecContent) MarshalToSizedBuffer

func (m *CodecContent) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CodecContent) ProtoMessage

func (*CodecContent) ProtoMessage()

func (*CodecContent) Reset

func (m *CodecContent) Reset()

func (*CodecContent) SetContent

func (*CodecContent) Size

func (m *CodecContent) Size() (n int)

func (*CodecContent) String

func (m *CodecContent) String() string

func (*CodecContent) Unmarshal

func (m *CodecContent) Unmarshal(dAtA []byte) error

func (*CodecContent) XXX_DiscardUnknown

func (m *CodecContent) XXX_DiscardUnknown()

func (*CodecContent) XXX_Marshal

func (m *CodecContent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CodecContent) XXX_Merge

func (m *CodecContent) XXX_Merge(src proto.Message)

func (*CodecContent) XXX_OneofWrappers

func (*CodecContent) XXX_OneofWrappers() []interface{}

XXX_OneofWrappers is for the internal use of the proto package.

func (*CodecContent) XXX_Size

func (m *CodecContent) XXX_Size() int

func (*CodecContent) XXX_Unmarshal

func (m *CodecContent) XXX_Unmarshal(b []byte) error

type CodecContent_ParameterChange

type CodecContent_ParameterChange struct {
	ParameterChange *proposal.ParameterChangeProposal `protobuf:"bytes,2,opt,name=parameter_change,json=parameterChange,proto3,oneof" json:"parameter_change,omitempty"`
}

func (*CodecContent_ParameterChange) Equal

func (this *CodecContent_ParameterChange) Equal(that interface{}) bool

func (*CodecContent_ParameterChange) MarshalTo

func (m *CodecContent_ParameterChange) MarshalTo(dAtA []byte) (int, error)

func (*CodecContent_ParameterChange) MarshalToSizedBuffer

func (m *CodecContent_ParameterChange) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CodecContent_ParameterChange) Size

func (m *CodecContent_ParameterChange) Size() (n int)

type CodecContent_Text

type CodecContent_Text struct {
	Text *types.TextProposal `protobuf:"bytes,1,opt,name=text,proto3,oneof" json:"text,omitempty"`
}

func (*CodecContent_Text) Equal

func (this *CodecContent_Text) Equal(that interface{}) bool

func (*CodecContent_Text) MarshalTo

func (m *CodecContent_Text) MarshalTo(dAtA []byte) (int, error)

func (*CodecContent_Text) MarshalToSizedBuffer

func (m *CodecContent_Text) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CodecContent_Text) Size

func (m *CodecContent_Text) Size() (n int)

type CodecMsgSubmitProposal

type CodecMsgSubmitProposal struct {
	types.MsgSubmitProposalBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:"base"`
	Content                     *CodecContent `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
}

MsgSubmitProposal defines the application-level message type for handling governance proposals.

func (*CodecMsgSubmitProposal) Descriptor

func (*CodecMsgSubmitProposal) Descriptor() ([]byte, []int)

func (*CodecMsgSubmitProposal) Equal

func (this *CodecMsgSubmitProposal) Equal(that interface{}) bool

func (*CodecMsgSubmitProposal) Marshal

func (m *CodecMsgSubmitProposal) Marshal() (dAtA []byte, err error)

func (*CodecMsgSubmitProposal) MarshalTo

func (m *CodecMsgSubmitProposal) MarshalTo(dAtA []byte) (int, error)

func (*CodecMsgSubmitProposal) MarshalToSizedBuffer

func (m *CodecMsgSubmitProposal) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CodecMsgSubmitProposal) ProtoMessage

func (*CodecMsgSubmitProposal) ProtoMessage()

func (*CodecMsgSubmitProposal) Reset

func (m *CodecMsgSubmitProposal) Reset()

func (*CodecMsgSubmitProposal) Size

func (m *CodecMsgSubmitProposal) Size() (n int)

func (*CodecMsgSubmitProposal) String

func (m *CodecMsgSubmitProposal) String() string

func (*CodecMsgSubmitProposal) Unmarshal

func (m *CodecMsgSubmitProposal) Unmarshal(dAtA []byte) error

func (*CodecMsgSubmitProposal) XXX_DiscardUnknown

func (m *CodecMsgSubmitProposal) XXX_DiscardUnknown()

func (*CodecMsgSubmitProposal) XXX_Marshal

func (m *CodecMsgSubmitProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CodecMsgSubmitProposal) XXX_Merge

func (m *CodecMsgSubmitProposal) XXX_Merge(src proto.Message)

func (*CodecMsgSubmitProposal) XXX_Size

func (m *CodecMsgSubmitProposal) XXX_Size() int

func (*CodecMsgSubmitProposal) XXX_Unmarshal

func (m *CodecMsgSubmitProposal) XXX_Unmarshal(b []byte) error

type CodecProposal

type CodecProposal struct {
	types.ProposalBase `protobuf:"bytes,1,opt,name=base,proto3,embedded=base" json:"base"`
	Content            CodecContent `protobuf:"bytes,2,opt,name=content,proto3" json:"content"`
}

Proposal defines the application-level concrete proposal type used in governance proposals.

func (*CodecProposal) Descriptor

func (*CodecProposal) Descriptor() ([]byte, []int)

func (*CodecProposal) Equal

func (this *CodecProposal) Equal(that interface{}) bool

func (*CodecProposal) GetContent

func (m *CodecProposal) GetContent() CodecContent

func (*CodecProposal) Marshal

func (m *CodecProposal) Marshal() (dAtA []byte, err error)

func (*CodecProposal) MarshalTo

func (m *CodecProposal) MarshalTo(dAtA []byte) (int, error)

func (*CodecProposal) MarshalToSizedBuffer

func (m *CodecProposal) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*CodecProposal) ProtoMessage

func (*CodecProposal) ProtoMessage()

func (*CodecProposal) Reset

func (m *CodecProposal) Reset()

func (*CodecProposal) Size

func (m *CodecProposal) Size() (n int)

func (*CodecProposal) String

func (m *CodecProposal) String() string

func (*CodecProposal) Unmarshal

func (m *CodecProposal) Unmarshal(dAtA []byte) error

func (*CodecProposal) XXX_DiscardUnknown

func (m *CodecProposal) XXX_DiscardUnknown()

func (*CodecProposal) XXX_Marshal

func (m *CodecProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*CodecProposal) XXX_Merge

func (m *CodecProposal) XXX_Merge(src proto.Message)

func (*CodecProposal) XXX_Size

func (m *CodecProposal) XXX_Size() int

func (*CodecProposal) XXX_Unmarshal

func (m *CodecProposal) XXX_Unmarshal(b []byte) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL