crs

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: 31 Imported by: 2

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 crss.

Future Improvements

Describe future improvements of this module.

Tests

Acceptance tests.

Appendix

Supplementary details referenced elsewhere within the spec.

Documentation

Overview

Package crs is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const ModuleName = "crs"

Variables

View Source
var (
	ParamsKey     = collections.NewPrefix(0)
	DecisionIDKey = collections.NewPrefix(1)
	DecisionKey   = collections.NewPrefix(2)
	CommitKey     = collections.NewPrefix(3)
	RevealKey     = collections.NewPrefix(4)
)
View Source
var (
	ErrInvalidLengthQuery        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowQuery          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group")
)
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 RegisterQueryHandler

func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error

RegisterQueryHandler registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over "conn".

func RegisterQueryHandlerClient

func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error

RegisterQueryHandlerClient registers the http handlers for service Query to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "QueryClient" to call the correct interceptors.

func RegisterQueryHandlerFromEndpoint

func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)

RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.

func RegisterQueryHandlerServer

func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error

RegisterQueryHandlerServer registers the http handlers for service Query to "mux". UnaryRPC :call QueryServer directly. StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type Commit

type Commit struct {
	Commit []byte `protobuf:"bytes,1,opt,name=commit,proto3" json:"commit,omitempty"`
}

func (*Commit) Descriptor

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

func (*Commit) GetCommit

func (m *Commit) GetCommit() []byte

func (*Commit) Marshal

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

func (*Commit) MarshalTo

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

func (*Commit) MarshalToSizedBuffer

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

func (*Commit) ProtoMessage

func (*Commit) ProtoMessage()

func (*Commit) Reset

func (m *Commit) Reset()

func (*Commit) Size

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

func (*Commit) String

func (m *Commit) String() string

func (*Commit) Unmarshal

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

func (*Commit) XXX_DiscardUnknown

func (m *Commit) XXX_DiscardUnknown()

func (*Commit) XXX_Marshal

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

func (*Commit) XXX_Merge

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

func (*Commit) XXX_Size

func (m *Commit) XXX_Size() int

func (*Commit) XXX_Unmarshal

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

type Decision

type Decision struct {
	EntryFee      types.Coin `protobuf:"bytes,1,opt,name=entry_fee,json=entryFee,proto3" json:"entry_fee"`
	Options       [][]byte   `protobuf:"bytes,2,rep,name=options,proto3" json:"options,omitempty"`
	CommitTimeout time.Time  `protobuf:"bytes,3,opt,name=commit_timeout,json=commitTimeout,proto3,stdtime" json:"commit_timeout"`
	RevealTimeout time.Time  `protobuf:"bytes,4,opt,name=reveal_timeout,json=revealTimeout,proto3,stdtime" json:"reveal_timeout"`
	Refund        bool       `protobuf:"varint,5,opt,name=refund,proto3" json:"refund,omitempty"`
	// if refund is true, only the funds from participants that did not reveal will be sent to this address
	PayoutAddress string `protobuf:"bytes,6,opt,name=payout_address,json=payoutAddress,proto3" json:"payout_address,omitempty"`
}

func (*Decision) Descriptor

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

func (*Decision) GetCommitTimeout

func (m *Decision) GetCommitTimeout() time.Time

func (*Decision) GetEntryFee

func (m *Decision) GetEntryFee() types.Coin

func (*Decision) GetOptions

func (m *Decision) GetOptions() [][]byte

func (*Decision) GetPayoutAddress

func (m *Decision) GetPayoutAddress() string

func (*Decision) GetRefund

func (m *Decision) GetRefund() bool

func (*Decision) GetRevealTimeout

func (m *Decision) GetRevealTimeout() time.Time

func (*Decision) Marshal

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

func (*Decision) MarshalTo

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

func (*Decision) MarshalToSizedBuffer

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

func (*Decision) ProtoMessage

func (*Decision) ProtoMessage()

func (*Decision) Reset

func (m *Decision) Reset()

func (*Decision) Size

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

func (*Decision) String

func (m *Decision) String() string

func (*Decision) Unmarshal

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

func (*Decision) XXX_DiscardUnknown

func (m *Decision) XXX_DiscardUnknown()

func (*Decision) XXX_Marshal

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

func (*Decision) XXX_Merge

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

func (*Decision) XXX_Size

func (m *Decision) XXX_Size() int

func (*Decision) XXX_Unmarshal

func (m *Decision) 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 {
	CreateDecision(ctx context.Context, in *MsgCreateDecision, opts ...grpc.CallOption) (*MsgCreateDecisionResponse, error)
	Commit(ctx context.Context, in *MsgCommit, opts ...grpc.CallOption) (*MsgCommitResponse, error)
	Reveal(ctx context.Context, in *MsgReveal, opts ...grpc.CallOption) (*MsgRevealResponse, 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 MsgCommit

type MsgCommit struct {
	Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	// id of the decision
	DecisionId uint64 `protobuf:"varint,2,opt,name=decision_id,json=decisionId,proto3" json:"decision_id,omitempty"`
	// hash of the commit, must be sha256(decision_id + ":" + option_chosen + ":" + salt)
	// salt must be exactly 32 bytes
	Commit []byte `protobuf:"bytes,3,opt,name=commit,proto3" json:"commit,omitempty"`
}

func (*MsgCommit) Descriptor

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

func (*MsgCommit) GetCommit

func (m *MsgCommit) GetCommit() []byte

func (*MsgCommit) GetDecisionId

func (m *MsgCommit) GetDecisionId() uint64

func (*MsgCommit) GetSender

func (m *MsgCommit) GetSender() string

func (*MsgCommit) Marshal

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

func (*MsgCommit) MarshalTo

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

func (*MsgCommit) MarshalToSizedBuffer

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

func (*MsgCommit) ProtoMessage

func (*MsgCommit) ProtoMessage()

func (*MsgCommit) Reset

func (m *MsgCommit) Reset()

func (*MsgCommit) Size

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

func (*MsgCommit) String

func (m *MsgCommit) String() string

func (*MsgCommit) Unmarshal

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

func (*MsgCommit) XXX_DiscardUnknown

func (m *MsgCommit) XXX_DiscardUnknown()

func (*MsgCommit) XXX_Marshal

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

func (*MsgCommit) XXX_Merge

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

func (*MsgCommit) XXX_Size

func (m *MsgCommit) XXX_Size() int

func (*MsgCommit) XXX_Unmarshal

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

type MsgCommitResponse

type MsgCommitResponse struct {
}

func (*MsgCommitResponse) Descriptor

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

func (*MsgCommitResponse) Marshal

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

func (*MsgCommitResponse) MarshalTo

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

func (*MsgCommitResponse) MarshalToSizedBuffer

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

func (*MsgCommitResponse) ProtoMessage

func (*MsgCommitResponse) ProtoMessage()

func (*MsgCommitResponse) Reset

func (m *MsgCommitResponse) Reset()

func (*MsgCommitResponse) Size

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

func (*MsgCommitResponse) String

func (m *MsgCommitResponse) String() string

func (*MsgCommitResponse) Unmarshal

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

func (*MsgCommitResponse) XXX_DiscardUnknown

func (m *MsgCommitResponse) XXX_DiscardUnknown()

func (*MsgCommitResponse) XXX_Marshal

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

func (*MsgCommitResponse) XXX_Merge

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

func (*MsgCommitResponse) XXX_Size

func (m *MsgCommitResponse) XXX_Size() int

func (*MsgCommitResponse) XXX_Unmarshal

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

type MsgCreateDecision

type MsgCreateDecision struct {
	// creator of the decision, can be a user or a module
	Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	// options for the decision for example political candidate names or game moves.
	// It can also be empty to allow use cases like a price oracle or a RNG.
	Options [][]byte `protobuf:"bytes,2,rep,name=options,proto3" json:"options,omitempty"`
	// time in which the commit can be done in seconds
	CommitDuration uint64 `protobuf:"varint,3,opt,name=commit_duration,json=commitDuration,proto3" json:"commit_duration,omitempty"`
	// time in which the reveal can be done in seconds
	RevealDuration uint64 `protobuf:"varint,4,opt,name=reveal_duration,json=revealDuration,proto3" json:"reveal_duration,omitempty"`
	// entry price for the decision
	EntryFee types.Coin `protobuf:"bytes,5,opt,name=entry_fee,json=entryFee,proto3" json:"entry_fee"`
	// if the entry fee should be refunded to participants after the reveal period ends
	Refund bool `protobuf:"varint,6,opt,name=refund,proto3" json:"refund,omitempty"`
	// address to which send the entry fees to, if refund is true, only the fees of the
	// participants which NOT revealed will be sent to this address (sort of a slashing)
	SendFundsTo string `protobuf:"bytes,7,opt,name=send_funds_to,json=sendFundsTo,proto3" json:"send_funds_to,omitempty"`
}

MsgCreateDecision represents a request to create a new decision-making process.

func (*MsgCreateDecision) Descriptor

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

func (*MsgCreateDecision) GetCommitDuration

func (m *MsgCreateDecision) GetCommitDuration() uint64

func (*MsgCreateDecision) GetEntryFee

func (m *MsgCreateDecision) GetEntryFee() types.Coin

func (*MsgCreateDecision) GetOptions

func (m *MsgCreateDecision) GetOptions() [][]byte

func (*MsgCreateDecision) GetRefund

func (m *MsgCreateDecision) GetRefund() bool

func (*MsgCreateDecision) GetRevealDuration

func (m *MsgCreateDecision) GetRevealDuration() uint64

func (*MsgCreateDecision) GetSendFundsTo

func (m *MsgCreateDecision) GetSendFundsTo() string

func (*MsgCreateDecision) GetSender

func (m *MsgCreateDecision) GetSender() string

func (*MsgCreateDecision) Marshal

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

func (*MsgCreateDecision) MarshalTo

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

func (*MsgCreateDecision) MarshalToSizedBuffer

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

func (*MsgCreateDecision) ProtoMessage

func (*MsgCreateDecision) ProtoMessage()

func (*MsgCreateDecision) Reset

func (m *MsgCreateDecision) Reset()

func (*MsgCreateDecision) Size

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

func (*MsgCreateDecision) String

func (m *MsgCreateDecision) String() string

func (*MsgCreateDecision) Unmarshal

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

func (*MsgCreateDecision) XXX_DiscardUnknown

func (m *MsgCreateDecision) XXX_DiscardUnknown()

func (*MsgCreateDecision) XXX_Marshal

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

func (*MsgCreateDecision) XXX_Merge

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

func (*MsgCreateDecision) XXX_Size

func (m *MsgCreateDecision) XXX_Size() int

func (*MsgCreateDecision) XXX_Unmarshal

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

type MsgCreateDecisionResponse

type MsgCreateDecisionResponse struct {
	// id of the decision, must be provided in the commit and reveal messages
	Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}

func (*MsgCreateDecisionResponse) Descriptor

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

func (*MsgCreateDecisionResponse) GetId

func (m *MsgCreateDecisionResponse) GetId() uint64

func (*MsgCreateDecisionResponse) Marshal

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

func (*MsgCreateDecisionResponse) MarshalTo

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

func (*MsgCreateDecisionResponse) MarshalToSizedBuffer

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

func (*MsgCreateDecisionResponse) ProtoMessage

func (*MsgCreateDecisionResponse) ProtoMessage()

func (*MsgCreateDecisionResponse) Reset

func (m *MsgCreateDecisionResponse) Reset()

func (*MsgCreateDecisionResponse) Size

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

func (*MsgCreateDecisionResponse) String

func (m *MsgCreateDecisionResponse) String() string

func (*MsgCreateDecisionResponse) Unmarshal

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

func (*MsgCreateDecisionResponse) XXX_DiscardUnknown

func (m *MsgCreateDecisionResponse) XXX_DiscardUnknown()

func (*MsgCreateDecisionResponse) XXX_Marshal

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

func (*MsgCreateDecisionResponse) XXX_Merge

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

func (*MsgCreateDecisionResponse) XXX_Size

func (m *MsgCreateDecisionResponse) XXX_Size() int

func (*MsgCreateDecisionResponse) XXX_Unmarshal

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

type MsgReveal

type MsgReveal struct {
	Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty"`
	// id of the decision to reveal
	DecisionId uint64 `protobuf:"varint,2,opt,name=decision_id,json=decisionId,proto3" json:"decision_id,omitempty"`
	// salt used in the commit
	Salt []byte `protobuf:"bytes,3,opt,name=salt,proto3" json:"salt,omitempty"`
	// option chosen
	OptionChosen []byte `protobuf:"bytes,4,opt,name=option_chosen,json=optionChosen,proto3" json:"option_chosen,omitempty"`
}

func (*MsgReveal) Descriptor

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

func (*MsgReveal) GetDecisionId

func (m *MsgReveal) GetDecisionId() uint64

func (*MsgReveal) GetOptionChosen

func (m *MsgReveal) GetOptionChosen() []byte

func (*MsgReveal) GetSalt

func (m *MsgReveal) GetSalt() []byte

func (*MsgReveal) GetSender

func (m *MsgReveal) GetSender() string

func (*MsgReveal) Marshal

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

func (*MsgReveal) MarshalTo

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

func (*MsgReveal) MarshalToSizedBuffer

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

func (*MsgReveal) ProtoMessage

func (*MsgReveal) ProtoMessage()

func (*MsgReveal) Reset

func (m *MsgReveal) Reset()

func (*MsgReveal) Size

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

func (*MsgReveal) String

func (m *MsgReveal) String() string

func (*MsgReveal) Unmarshal

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

func (*MsgReveal) XXX_DiscardUnknown

func (m *MsgReveal) XXX_DiscardUnknown()

func (*MsgReveal) XXX_Marshal

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

func (*MsgReveal) XXX_Merge

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

func (*MsgReveal) XXX_Size

func (m *MsgReveal) XXX_Size() int

func (*MsgReveal) XXX_Unmarshal

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

type MsgRevealResponse

type MsgRevealResponse struct {
}

func (*MsgRevealResponse) Descriptor

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

func (*MsgRevealResponse) Marshal

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

func (*MsgRevealResponse) MarshalTo

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

func (*MsgRevealResponse) MarshalToSizedBuffer

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

func (*MsgRevealResponse) ProtoMessage

func (*MsgRevealResponse) ProtoMessage()

func (*MsgRevealResponse) Reset

func (m *MsgRevealResponse) Reset()

func (*MsgRevealResponse) Size

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

func (*MsgRevealResponse) String

func (m *MsgRevealResponse) String() string

func (*MsgRevealResponse) Unmarshal

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

func (*MsgRevealResponse) XXX_DiscardUnknown

func (m *MsgRevealResponse) XXX_DiscardUnknown()

func (*MsgRevealResponse) XXX_Marshal

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

func (*MsgRevealResponse) XXX_Merge

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

func (*MsgRevealResponse) XXX_Size

func (m *MsgRevealResponse) XXX_Size() int

func (*MsgRevealResponse) XXX_Unmarshal

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

type MsgServer

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 {
	// Counter returns the current counter value.
	Decision(ctx context.Context, in *QueryDecisionRequest, opts ...grpc.CallOption) (*QueryDecisionResponse, error)
	// Params returns the module parameters.
	Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
}

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 QueryDecisionRequest

type QueryDecisionRequest struct {
	// id defines the id of the decision to query for.
	Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
}

func (*QueryDecisionRequest) Descriptor

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

func (*QueryDecisionRequest) GetId

func (m *QueryDecisionRequest) GetId() uint64

func (*QueryDecisionRequest) Marshal

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

func (*QueryDecisionRequest) MarshalTo

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

func (*QueryDecisionRequest) MarshalToSizedBuffer

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

func (*QueryDecisionRequest) ProtoMessage

func (*QueryDecisionRequest) ProtoMessage()

func (*QueryDecisionRequest) Reset

func (m *QueryDecisionRequest) Reset()

func (*QueryDecisionRequest) Size

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

func (*QueryDecisionRequest) String

func (m *QueryDecisionRequest) String() string

func (*QueryDecisionRequest) Unmarshal

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

func (*QueryDecisionRequest) XXX_DiscardUnknown

func (m *QueryDecisionRequest) XXX_DiscardUnknown()

func (*QueryDecisionRequest) XXX_Marshal

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

func (*QueryDecisionRequest) XXX_Merge

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

func (*QueryDecisionRequest) XXX_Size

func (m *QueryDecisionRequest) XXX_Size() int

func (*QueryDecisionRequest) XXX_Unmarshal

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

type QueryDecisionResponse

type QueryDecisionResponse struct {
	// decision defines the decision for the given id.
	Decision *Decision `protobuf:"bytes,1,opt,name=decision,proto3" json:"decision,omitempty"`
}

func (*QueryDecisionResponse) Descriptor

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

func (*QueryDecisionResponse) GetDecision

func (m *QueryDecisionResponse) GetDecision() *Decision

func (*QueryDecisionResponse) Marshal

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

func (*QueryDecisionResponse) MarshalTo

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

func (*QueryDecisionResponse) MarshalToSizedBuffer

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

func (*QueryDecisionResponse) ProtoMessage

func (*QueryDecisionResponse) ProtoMessage()

func (*QueryDecisionResponse) Reset

func (m *QueryDecisionResponse) Reset()

func (*QueryDecisionResponse) Size

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

func (*QueryDecisionResponse) String

func (m *QueryDecisionResponse) String() string

func (*QueryDecisionResponse) Unmarshal

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

func (*QueryDecisionResponse) XXX_DiscardUnknown

func (m *QueryDecisionResponse) XXX_DiscardUnknown()

func (*QueryDecisionResponse) XXX_Marshal

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

func (*QueryDecisionResponse) XXX_Merge

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

func (*QueryDecisionResponse) XXX_Size

func (m *QueryDecisionResponse) XXX_Size() int

func (*QueryDecisionResponse) XXX_Unmarshal

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

type QueryParamsRequest

type QueryParamsRequest struct {
}

QueryParamsRequest is the request type for the Query/Params RPC method.

func (*QueryParamsRequest) Descriptor

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

func (*QueryParamsRequest) Marshal

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

func (*QueryParamsRequest) MarshalTo

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

func (*QueryParamsRequest) MarshalToSizedBuffer

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

func (*QueryParamsRequest) ProtoMessage

func (*QueryParamsRequest) ProtoMessage()

func (*QueryParamsRequest) Reset

func (m *QueryParamsRequest) Reset()

func (*QueryParamsRequest) Size

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

func (*QueryParamsRequest) String

func (m *QueryParamsRequest) String() string

func (*QueryParamsRequest) Unmarshal

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

func (*QueryParamsRequest) XXX_DiscardUnknown

func (m *QueryParamsRequest) XXX_DiscardUnknown()

func (*QueryParamsRequest) XXX_Marshal

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

func (*QueryParamsRequest) XXX_Merge

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

func (*QueryParamsRequest) XXX_Size

func (m *QueryParamsRequest) XXX_Size() int

func (*QueryParamsRequest) XXX_Unmarshal

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

type QueryParamsResponse

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

QueryParamsResponse is the response type for the Query/Params RPC method.

func (*QueryParamsResponse) Descriptor

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

func (*QueryParamsResponse) GetParams

func (m *QueryParamsResponse) GetParams() Params

func (*QueryParamsResponse) Marshal

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

func (*QueryParamsResponse) MarshalTo

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

func (*QueryParamsResponse) MarshalToSizedBuffer

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

func (*QueryParamsResponse) ProtoMessage

func (*QueryParamsResponse) ProtoMessage()

func (*QueryParamsResponse) Reset

func (m *QueryParamsResponse) Reset()

func (*QueryParamsResponse) Size

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

func (*QueryParamsResponse) String

func (m *QueryParamsResponse) String() string

func (*QueryParamsResponse) Unmarshal

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

func (*QueryParamsResponse) XXX_DiscardUnknown

func (m *QueryParamsResponse) XXX_DiscardUnknown()

func (*QueryParamsResponse) XXX_Marshal

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

func (*QueryParamsResponse) XXX_Merge

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

func (*QueryParamsResponse) XXX_Size

func (m *QueryParamsResponse) XXX_Size() int

func (*QueryParamsResponse) XXX_Unmarshal

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

type QueryServer

type QueryServer interface {
	// Counter returns the current counter value.
	Decision(context.Context, *QueryDecisionRequest) (*QueryDecisionResponse, error)
	// Params returns the module parameters.
	Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
}

QueryServer is the server API for Query service.

type Reveal

type Reveal struct {
	Option []byte `protobuf:"bytes,1,opt,name=option,proto3" json:"option,omitempty"`
}

func (*Reveal) Descriptor

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

func (*Reveal) GetOption

func (m *Reveal) GetOption() []byte

func (*Reveal) Marshal

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

func (*Reveal) MarshalTo

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

func (*Reveal) MarshalToSizedBuffer

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

func (*Reveal) ProtoMessage

func (*Reveal) ProtoMessage()

func (*Reveal) Reset

func (m *Reveal) Reset()

func (*Reveal) Size

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

func (*Reveal) String

func (m *Reveal) String() string

func (*Reveal) Unmarshal

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

func (*Reveal) XXX_DiscardUnknown

func (m *Reveal) XXX_DiscardUnknown()

func (*Reveal) XXX_Marshal

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

func (*Reveal) XXX_Merge

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

func (*Reveal) XXX_Size

func (m *Reveal) XXX_Size() int

func (*Reveal) XXX_Unmarshal

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

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) Commit

func (*UnimplementedMsgServer) CreateDecision

func (*UnimplementedMsgServer) Reveal

func (*UnimplementedMsgServer) UpdateParams

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) Decision

func (*UnimplementedQueryServer) Params

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.
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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