types

package
v0.0.0-...-d8b13bf Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2021 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package types is a reverse proxy.

It translates gRPC into RESTful JSON APIs.

Index

Constants

View Source
const (
	// ModuleName is the name of the module
	ModuleName = "faucet"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName

	RouterKey = ModuleName // this was defined in your key.go file

	QuerierRoute = ModuleName
)
View Source
const (
	TypeMint = "mint"
)
View Source
const (
	TypeMintHistory = "mint-history"
)

Variables

View Source
var (
	// ErrWithdrawTooOften withdraw too often
	ErrWithdrawTooOften  = sdkerrors.Register(ModuleName, 100, "Each address can withdraw only once")
	ErrFaucetKeyEmpty    = sdkerrors.Register(ModuleName, 101, "Armor should Not be empty.")
	ErrFaucetKeyExisted  = sdkerrors.Register(ModuleName, 102, "Faucet key existed")
	ErrCantWithdrawStake = sdkerrors.Register(ModuleName, 103, "Can't withdraw staking token")
	ErrNoEmoji           = sdkerrors.Register(ModuleName, 104, "No emoji present in denom")
)
View Source
var (
	ErrInvalidLengthGenesis        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGenesis          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrInvalidLengthHistory        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowHistory          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupHistory = fmt.Errorf("proto: unexpected end of group")
)
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 (
	ModuleCdc = codec.NewAminoCodec(amino)
)

Functions

func RegisterInterfaces

func RegisterInterfaces(registry cdctypes.InterfaceRegistry)

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 (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead.

func RegisterQueryServer

func RegisterQueryServer(s grpc1.Server, srv QueryServer)

Types

type GenesisState

type GenesisState struct {
}

GenesisState - all oracle state that must be provided at genesis

func (*GenesisState) Descriptor

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

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) 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 MintHistory

type MintHistory struct {
	Minter   string `protobuf:"bytes,1,opt,name=minter,proto3" json:"minter,omitempty"`
	Lasttime int64  `protobuf:"varint,2,opt,name=lasttime,proto3" json:"lasttime,omitempty"`
	Tally    int64  `protobuf:"varint,3,opt,name=tally,proto3" json:"tally,omitempty"`
}

func NewMintHistory

func NewMintHistory(minter sdk.AccAddress, tally int64) *MintHistory

NewMining returns a new Mining Message

func (*MintHistory) Descriptor

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

func (*MintHistory) GetLasttime

func (m *MintHistory) GetLasttime() int64

func (*MintHistory) GetMinter

func (m *MintHistory) GetMinter() string

func (MintHistory) GetSigners

func (msg MintHistory) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (*MintHistory) GetTally

func (m *MintHistory) GetTally() int64

func (*MintHistory) Marshal

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

func (*MintHistory) MarshalTo

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

func (*MintHistory) MarshalToSizedBuffer

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

func (*MintHistory) ProtoMessage

func (*MintHistory) ProtoMessage()

func (*MintHistory) Reset

func (m *MintHistory) Reset()

func (MintHistory) Route

func (msg MintHistory) Route() string

Route should return the name of the module

func (*MintHistory) Size

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

func (*MintHistory) String

func (m *MintHistory) String() string

func (MintHistory) Type

func (msg MintHistory) Type() string

Type should return the action

func (*MintHistory) Unmarshal

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

func (MintHistory) ValidateBasic

func (msg MintHistory) ValidateBasic() error

ValidateBasic runs stateless checks on the message

func (*MintHistory) XXX_DiscardUnknown

func (m *MintHistory) XXX_DiscardUnknown()

func (*MintHistory) XXX_Marshal

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

func (*MintHistory) XXX_Merge

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

func (*MintHistory) XXX_Size

func (m *MintHistory) XXX_Size() int

func (*MintHistory) XXX_Unmarshal

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

type MsgClient

type MsgClient interface {
	Mint(ctx context.Context, in *MsgMint, opts ...grpc.CallOption) (*MsgMintResponse, 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 MsgMint

type MsgMint struct {
	Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"`
	Minter string `protobuf:"bytes,2,opt,name=minter,proto3" json:"minter,omitempty" yaml:"minter"`
	Denom  string `protobuf:"bytes,3,opt,name=denom,proto3" json:"denom,omitempty" yaml:"denom"`
}

func NewMsgMint

func NewMsgMint(sender sdk.AccAddress, minter sdk.AccAddress, denom string) *MsgMint

NewMsgMint is a constructor function for NewMsgMint

func (*MsgMint) Descriptor

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

func (*MsgMint) GetDenom

func (m *MsgMint) GetDenom() string

func (*MsgMint) GetMinter

func (m *MsgMint) GetMinter() string

func (*MsgMint) GetSender

func (m *MsgMint) GetSender() string

func (*MsgMint) GetSignBytes

func (msg *MsgMint) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (*MsgMint) GetSigners

func (msg *MsgMint) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (*MsgMint) Marshal

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

func (*MsgMint) MarshalTo

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

func (*MsgMint) MarshalToSizedBuffer

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

func (*MsgMint) ProtoMessage

func (*MsgMint) ProtoMessage()

func (*MsgMint) Reset

func (m *MsgMint) Reset()

func (*MsgMint) Route

func (msg *MsgMint) Route() string

Route should return the name of the module

func (*MsgMint) Size

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

func (*MsgMint) String

func (m *MsgMint) String() string

func (*MsgMint) Type

func (msg *MsgMint) Type() string

Type should return the action

func (*MsgMint) Unmarshal

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

func (*MsgMint) ValidateBasic

func (msg *MsgMint) ValidateBasic() error

ValidateBasic runs stateless checks on the message

func (*MsgMint) XXX_DiscardUnknown

func (m *MsgMint) XXX_DiscardUnknown()

func (*MsgMint) XXX_Marshal

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

func (*MsgMint) XXX_Merge

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

func (*MsgMint) XXX_Size

func (m *MsgMint) XXX_Size() int

func (*MsgMint) XXX_Unmarshal

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

type MsgMintResponse

type MsgMintResponse struct {
}

func (*MsgMintResponse) Descriptor

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

func (*MsgMintResponse) Marshal

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

func (*MsgMintResponse) MarshalTo

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

func (*MsgMintResponse) MarshalToSizedBuffer

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

func (*MsgMintResponse) ProtoMessage

func (*MsgMintResponse) ProtoMessage()

func (*MsgMintResponse) Reset

func (m *MsgMintResponse) Reset()

func (*MsgMintResponse) Size

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

func (*MsgMintResponse) String

func (m *MsgMintResponse) String() string

func (*MsgMintResponse) Unmarshal

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

func (*MsgMintResponse) XXX_DiscardUnknown

func (m *MsgMintResponse) XXX_DiscardUnknown()

func (*MsgMintResponse) XXX_Marshal

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

func (*MsgMintResponse) XXX_Merge

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

func (*MsgMintResponse) XXX_Size

func (m *MsgMintResponse) XXX_Size() int

func (*MsgMintResponse) XXX_Unmarshal

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

type MsgServer

type MsgServer interface {
	Mint(context.Context, *MsgMint) (*MsgMintResponse, error)
}

MsgServer is the server API for Msg service.

type QueryClient

type QueryClient interface {
	// WhenBrr queries the last time an address minted
	QueryWhenBrr(ctx context.Context, in *QueryWhenBrrRequest, opts ...grpc.CallOption) (*QueryWhenBrrResponse, 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 QueryServer

type QueryServer interface {
	// WhenBrr queries the last time an address minted
	QueryWhenBrr(context.Context, *QueryWhenBrrRequest) (*QueryWhenBrrResponse, error)
}

QueryServer is the server API for Query service.

type QueryWhenBrrRequest

type QueryWhenBrrRequest struct {
	Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
}

func (*QueryWhenBrrRequest) Descriptor

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

func (*QueryWhenBrrRequest) GetAddress

func (m *QueryWhenBrrRequest) GetAddress() string

func (*QueryWhenBrrRequest) Marshal

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

func (*QueryWhenBrrRequest) MarshalTo

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

func (*QueryWhenBrrRequest) MarshalToSizedBuffer

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

func (*QueryWhenBrrRequest) ProtoMessage

func (*QueryWhenBrrRequest) ProtoMessage()

func (*QueryWhenBrrRequest) Reset

func (m *QueryWhenBrrRequest) Reset()

func (*QueryWhenBrrRequest) Size

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

func (*QueryWhenBrrRequest) String

func (m *QueryWhenBrrRequest) String() string

func (*QueryWhenBrrRequest) Unmarshal

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

func (*QueryWhenBrrRequest) XXX_DiscardUnknown

func (m *QueryWhenBrrRequest) XXX_DiscardUnknown()

func (*QueryWhenBrrRequest) XXX_Marshal

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

func (*QueryWhenBrrRequest) XXX_Merge

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

func (*QueryWhenBrrRequest) XXX_Size

func (m *QueryWhenBrrRequest) XXX_Size() int

func (*QueryWhenBrrRequest) XXX_Unmarshal

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

type QueryWhenBrrResponse

type QueryWhenBrrResponse struct {
	TimeLeft int64 `protobuf:"varint,1,opt,name=timeLeft,proto3" json:"timeLeft,omitempty"`
}

func (*QueryWhenBrrResponse) Descriptor

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

func (*QueryWhenBrrResponse) GetTimeLeft

func (m *QueryWhenBrrResponse) GetTimeLeft() int64

func (*QueryWhenBrrResponse) Marshal

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

func (*QueryWhenBrrResponse) MarshalTo

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

func (*QueryWhenBrrResponse) MarshalToSizedBuffer

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

func (*QueryWhenBrrResponse) ProtoMessage

func (*QueryWhenBrrResponse) ProtoMessage()

func (*QueryWhenBrrResponse) Reset

func (m *QueryWhenBrrResponse) Reset()

func (*QueryWhenBrrResponse) Size

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

func (*QueryWhenBrrResponse) String

func (m *QueryWhenBrrResponse) String() string

func (*QueryWhenBrrResponse) Unmarshal

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

func (*QueryWhenBrrResponse) XXX_DiscardUnknown

func (m *QueryWhenBrrResponse) XXX_DiscardUnknown()

func (*QueryWhenBrrResponse) XXX_Marshal

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

func (*QueryWhenBrrResponse) XXX_Merge

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

func (*QueryWhenBrrResponse) XXX_Size

func (m *QueryWhenBrrResponse) XXX_Size() int

func (*QueryWhenBrrResponse) XXX_Unmarshal

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

type UnimplementedMsgServer

type UnimplementedMsgServer struct {
}

UnimplementedMsgServer can be embedded to have forward compatible implementations.

func (*UnimplementedMsgServer) Mint

type UnimplementedQueryServer

type UnimplementedQueryServer struct {
}

UnimplementedQueryServer can be embedded to have forward compatible implementations.

func (*UnimplementedQueryServer) QueryWhenBrr

Jump to

Keyboard shortcuts

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