election

package module
v0.0.0-...-739a9b5 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

README

{Module Name}

Overview of the module.

Concepts

Describe specialized concepts and definitions used throughout the spec.

State

Specify and describe structures expected to marshalled into the store, and their keys

State Transitions

Standard state transition operations triggered by hooks, messages, etc.

Messages

Specify message structure(s) and expected state machine behaviour(s).

Begin Block

Specify any begin-block operations.

End Block

Specify any end-block operations.

Hooks

Describe available hooks to be called by/from this module.

Events

List and describe event tags used.

Client

List and describe CLI commands and gRPC and REST endpoints.

Params

List all module parameters, their types (in JSON) and elections.

Future Improvements

Describe future improvements of this module.

Tests

Acceptance tests.

Appendix

Supplementary details referenced elsewhere within the spec.

Documentation

Index

Constants

View Source
const ModuleName = "election"

Variables

View Source
var (
	ParamsKey  = collections.NewPrefix(0)
	CounterKey = collections.NewPrefix(1)
)
View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthTypes        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTypes          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTypes = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	// ErrDuplicateAddress error if there is a duplicate address
	ErrDuplicateAddress = errors.Register(ModuleName, 2, "duplicate address")
)

Functions

func RegisterInterfaces

func RegisterInterfaces(registry types.InterfaceRegistry)

RegisterInterfaces registers the interfaces types with the interface registry.

func RegisterMsgServer

func RegisterMsgServer(s grpc1.Server, srv MsgServer)

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type Election

type Election struct {
	NewDecisionId uint64                 `protobuf:"varint,1,opt,name=new_decision_id,json=newDecisionId,proto3" json:"new_decision_id,omitempty"`
	Options       []string               `protobuf:"bytes,2,rep,name=options,proto3" json:"options,omitempty"`
	StartTime     *timestamppb.Timestamp `protobuf:"bytes,4,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	EndTime       *timestamppb.Timestamp `protobuf:"bytes,5,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
}

func (*Election) Descriptor

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

func (*Election) GetEndTime

func (m *Election) GetEndTime() *timestamppb.Timestamp

func (*Election) GetNewDecisionId

func (m *Election) GetNewDecisionId() uint64

func (*Election) GetOptions

func (m *Election) GetOptions() []string

func (*Election) GetStartTime

func (m *Election) GetStartTime() *timestamppb.Timestamp

func (*Election) Marshal

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

func (*Election) MarshalTo

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

func (*Election) MarshalToSizedBuffer

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

func (*Election) ProtoMessage

func (*Election) ProtoMessage()

func (*Election) Reset

func (m *Election) Reset()

func (*Election) Size

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

func (*Election) String

func (m *Election) String() string

func (*Election) Unmarshal

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

func (*Election) XXX_DiscardUnknown

func (m *Election) XXX_DiscardUnknown()

func (*Election) XXX_Marshal

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

func (*Election) XXX_Merge

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

func (*Election) XXX_Size

func (m *Election) XXX_Size() int

func (*Election) XXX_Unmarshal

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

type GenesisState

type GenesisState struct {
	// params defines all the parameters of the module.
	Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
}

GenesisState is the state that must be provided at genesis.

func NewGenesisState

func NewGenesisState() *GenesisState

NewGenesisState creates a new genesis state with default values.

func (*GenesisState) Descriptor

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

func (*GenesisState) GetParams

func (m *GenesisState) GetParams() Params

func (*GenesisState) Marshal

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

func (*GenesisState) MarshalTo

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

func (*GenesisState) MarshalToSizedBuffer

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

func (*GenesisState) ProtoMessage

func (*GenesisState) ProtoMessage()

func (*GenesisState) Reset

func (m *GenesisState) Reset()

func (*GenesisState) Size

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

func (*GenesisState) String

func (m *GenesisState) String() string

func (*GenesisState) Unmarshal

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

func (*GenesisState) Validate

func (gs *GenesisState) Validate() error

Validate performs basic genesis state validation returning an error upon any

func (*GenesisState) XXX_DiscardUnknown

func (m *GenesisState) XXX_DiscardUnknown()

func (*GenesisState) XXX_Marshal

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

func (*GenesisState) XXX_Merge

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

func (*GenesisState) XXX_Size

func (m *GenesisState) XXX_Size() int

func (*GenesisState) XXX_Unmarshal

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

type MsgClient

type MsgClient interface {
	NewElection(ctx context.Context, in *MsgNewElection, opts ...grpc.CallOption) (*MsgNewElectionResponse, error)
	UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
}

MsgClient is the client API for Msg service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewMsgClient

func NewMsgClient(cc grpc1.ClientConn) MsgClient

type MsgNewElection

type MsgNewElection struct {
	Sender  string   `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	Options []string `protobuf:"bytes,2,rep,name=options,proto3" json:"options,omitempty"`
}

func (*MsgNewElection) Descriptor

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

func (*MsgNewElection) GetOptions

func (m *MsgNewElection) GetOptions() []string

func (*MsgNewElection) GetSender

func (m *MsgNewElection) GetSender() string

func (*MsgNewElection) Marshal

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

func (*MsgNewElection) MarshalTo

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

func (*MsgNewElection) MarshalToSizedBuffer

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

func (*MsgNewElection) ProtoMessage

func (*MsgNewElection) ProtoMessage()

func (*MsgNewElection) Reset

func (m *MsgNewElection) Reset()

func (*MsgNewElection) Size

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

func (*MsgNewElection) String

func (m *MsgNewElection) String() string

func (*MsgNewElection) Unmarshal

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

func (*MsgNewElection) XXX_DiscardUnknown

func (m *MsgNewElection) XXX_DiscardUnknown()

func (*MsgNewElection) XXX_Marshal

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

func (*MsgNewElection) XXX_Merge

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

func (*MsgNewElection) XXX_Size

func (m *MsgNewElection) XXX_Size() int

func (*MsgNewElection) XXX_Unmarshal

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

type MsgNewElectionResponse

type MsgNewElectionResponse struct {
}

func (*MsgNewElectionResponse) Descriptor

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

func (*MsgNewElectionResponse) Marshal

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

func (*MsgNewElectionResponse) MarshalTo

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

func (*MsgNewElectionResponse) MarshalToSizedBuffer

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

func (*MsgNewElectionResponse) ProtoMessage

func (*MsgNewElectionResponse) ProtoMessage()

func (*MsgNewElectionResponse) Reset

func (m *MsgNewElectionResponse) Reset()

func (*MsgNewElectionResponse) Size

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

func (*MsgNewElectionResponse) String

func (m *MsgNewElectionResponse) String() string

func (*MsgNewElectionResponse) Unmarshal

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

func (*MsgNewElectionResponse) XXX_DiscardUnknown

func (m *MsgNewElectionResponse) XXX_DiscardUnknown()

func (*MsgNewElectionResponse) XXX_Marshal

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

func (*MsgNewElectionResponse) XXX_Merge

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

func (*MsgNewElectionResponse) XXX_Size

func (m *MsgNewElectionResponse) XXX_Size() int

func (*MsgNewElectionResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	NewElection(context.Context, *MsgNewElection) (*MsgNewElectionResponse, error)
	UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
}

MsgServer is the server API for Msg service.

type MsgUpdateParams

type MsgUpdateParams struct {
	// authority is the address that controls the module
	// NOTE: Defaults to the governance module unless overwritten.
	Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"`
	// params defines the module parameters to update.
	// NOTE: All parameters must be supplied.
	Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"`
}

MsgUpdateParams is the Msg/UpdateParams request type.

func (*MsgUpdateParams) Descriptor

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

func (*MsgUpdateParams) GetAuthority

func (m *MsgUpdateParams) GetAuthority() string

func (*MsgUpdateParams) GetParams

func (m *MsgUpdateParams) GetParams() Params

func (*MsgUpdateParams) Marshal

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

func (*MsgUpdateParams) MarshalTo

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

func (*MsgUpdateParams) MarshalToSizedBuffer

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

func (*MsgUpdateParams) ProtoMessage

func (*MsgUpdateParams) ProtoMessage()

func (*MsgUpdateParams) Reset

func (m *MsgUpdateParams) Reset()

func (*MsgUpdateParams) Size

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

func (*MsgUpdateParams) String

func (m *MsgUpdateParams) String() string

func (*MsgUpdateParams) Unmarshal

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

func (*MsgUpdateParams) XXX_DiscardUnknown

func (m *MsgUpdateParams) XXX_DiscardUnknown()

func (*MsgUpdateParams) XXX_Marshal

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

func (*MsgUpdateParams) XXX_Merge

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

func (*MsgUpdateParams) XXX_Size

func (m *MsgUpdateParams) XXX_Size() int

func (*MsgUpdateParams) XXX_Unmarshal

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

type MsgUpdateParamsResponse

type MsgUpdateParamsResponse struct {
}

MsgUpdateParamsResponse defines the response structure for executing a MsgUpdateParams message.

func (*MsgUpdateParamsResponse) Descriptor

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

func (*MsgUpdateParamsResponse) Marshal

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

func (*MsgUpdateParamsResponse) MarshalTo

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

func (*MsgUpdateParamsResponse) MarshalToSizedBuffer

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

func (*MsgUpdateParamsResponse) ProtoMessage

func (*MsgUpdateParamsResponse) ProtoMessage()

func (*MsgUpdateParamsResponse) Reset

func (m *MsgUpdateParamsResponse) Reset()

func (*MsgUpdateParamsResponse) Size

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

func (*MsgUpdateParamsResponse) String

func (m *MsgUpdateParamsResponse) String() string

func (*MsgUpdateParamsResponse) Unmarshal

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

func (*MsgUpdateParamsResponse) XXX_DiscardUnknown

func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown()

func (*MsgUpdateParamsResponse) XXX_Marshal

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

func (*MsgUpdateParamsResponse) XXX_Merge

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

func (*MsgUpdateParamsResponse) XXX_Size

func (m *MsgUpdateParamsResponse) XXX_Size() int

func (*MsgUpdateParamsResponse) XXX_Unmarshal

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

type Params

type Params struct {
	CommitTimeout uint64 `protobuf:"varint,1,opt,name=commit_timeout,json=commitTimeout,proto3" json:"commit_timeout,omitempty"`
	RevealTimeout uint64 `protobuf:"varint,2,opt,name=reveal_timeout,json=revealTimeout,proto3" json:"reveal_timeout,omitempty"`
}

Params defines the parameters of the module.

func DefaultParams

func DefaultParams() Params

DefaultParams returns default module parameters.

func (*Params) Descriptor

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

func (*Params) GetCommitTimeout

func (m *Params) GetCommitTimeout() uint64

func (*Params) GetRevealTimeout

func (m *Params) GetRevealTimeout() uint64

func (*Params) Marshal

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

func (*Params) MarshalTo

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

func (*Params) MarshalToSizedBuffer

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

func (*Params) ProtoMessage

func (*Params) ProtoMessage()

func (*Params) Reset

func (m *Params) Reset()

func (*Params) Size

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

func (*Params) String

func (m *Params) String() string

func (*Params) Unmarshal

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

func (Params) Validate

func (p Params) Validate() error

Validate does the sanity check on the params.

func (*Params) XXX_DiscardUnknown

func (m *Params) XXX_DiscardUnknown()

func (*Params) XXX_Marshal

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

func (*Params) XXX_Merge

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

func (*Params) XXX_Size

func (m *Params) XXX_Size() int

func (*Params) XXX_Unmarshal

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

type QueryClient

type QueryClient interface {
}

QueryClient is the client API for Query service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewQueryClient

func NewQueryClient(cc grpc1.ClientConn) QueryClient

type QueryServer

type QueryServer interface {
}

QueryServer is the server API for Query service.

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) NewElection

func (*UnimplementedMsgServer) UpdateParams

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

Directories

Path Synopsis
api
module/v1
Code generated by protoc-gen-go-pulsar.
Code generated by protoc-gen-go-pulsar.
v1
Code generated by protoc-gen-go-pulsar.
Code generated by protoc-gen-go-pulsar.

Jump to

Keyboard shortcuts

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